是否可以使用 AWS CDK 获取 DynamoDB 表的流 ARN?
我尝试了以下操作,但是当我使用 getTableStreamArn
访问streamArn 时,它返回 null。
ITable table = Table.fromTableArn(this, "existingTable", <<existingTableArn>>);
System.out.println("ITable Stream Arn : " + table.getTableStreamArn());
也尝试使用fromTableAttribute
,但流arn仍然是空的。
ITable table =
Table.fromTableAttributes(
this, "existingTable", TableAttributes.builder().tableArn(<<existingTableArn>>).build());
最佳答案
这对于 fromTableArn
方法是不可能的...请参阅此处的文档:
https://docs.aws.amazon.com/cdk/api/latest/docs/aws-dynamodb-readme.html#importing-existing-tables
If you intend to use the tableStreamArn (including indirectly, for example by creating an @aws-cdk/aws-lambda-event-source.DynamoEventSource on the imported table), you must use the Table.fromTableAttributes method and the tableStreamArn property must be populated.
关于java - AWS CDK 获取 DynamoDB Stream ARN 返回 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67616165/