1 Resposta
- Mais recentes
- Mais votos
- Mais comentários
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,
}
);
respondido há 4 anos
Conteúdo relevante
- AWS OFICIALAtualizada há 10 meses
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há 2 anos