1 Risposta
- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
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,
}
);
con risposta 4 anni fa
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 6 mesi fa
- AWS UFFICIALEAggiornata 10 mesi fa
- AWS UFFICIALEAggiornata 2 anni fa