1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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,
}
);
répondu il y a 4 ans
Contenus pertinents
- demandé il y a 4 mois
- demandé il y a 7 mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 7 mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 4 ans