1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
1
You can do this in CDK by few lines of code:
import * as cr from "@aws-cdk/custom-resources";
const ddbToKinesis = new cr.AwsCustomResource(
this,
"CustomResourceDDBtoKinesis",
{
policy: cr.AwsCustomResourcePolicy.fromStatements([
new iam.PolicyStatement({
actions: [
"dynamodb:EnableKinesisStreamingDestination",
"dynamodb:DisableKinesisStreamingDestination",
"dynamodb:DescribeKinesisStreamingDestination",
],
effect: iam.Effect.ALLOW,
resources: [tableArn],
}),
new iam.PolicyStatement({
actions: ["kinesis:*"],
effect: iam.Effect.ALLOW,
resources: [streamArn],
}),
]),
onCreate: {
service: "DynamoDB",
action: "enableKinesisStreamingDestination",
parameters: {
StreamArn: streamArn,
TableName: tableName,
},
physicalResourceId: cr.PhysicalResourceId.of(Date.now().toString()),
},
onDelete: {
service: "DynamoDB",
action: "disableKinesisStreamingDestination",
parameters: {
StreamArn: replicationStream.streamArn,
TableName: tableName,
},
physicalResourceId: cr.PhysicalResourceId.of(Date.now().toString()),
},
installLatestAwsSdk: true,
}
);
답변함 4년 전
관련 콘텐츠
- AWS 공식업데이트됨 10달 전
- AWS 공식업데이트됨 4년 전
- AWS 공식업데이트됨 일 년 전
- AWS 공식업데이트됨 일 년 전