java - AWS CDK 获取 DynamoDB Stream ARN 返回 null

标签 java amazon-web-services aws-cdk amazon-dynamodb-streams

是否可以使用 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/

相关文章:

amazon-web-services - AWS : The CIDR '10.30.1.0/24' conflicts with another subnet

amazon-web-services - 推送到 ECR 时的 Docker 镜像大小与本地不同

aws-cloudformation - 如何使用 aws cloudformation 或 aws cdk 设置 aws aurora mysql 表?

amazon-web-services - 在其他区域部署 AWS-CDK 堆栈

amazon-web-services - 如何访问CDK创建的EC2实例?

java - Android CountDownTimer 中的 .cancel() 问题

java - java中的范围锁

java - 我的文本编辑器应用程序和 DocumentListener 的怪癖

java.sql.SQLTransientConnectionException : spring HikariCP - Connection is not available, 请求超时后

mysql - 如何在node.js lambda aws中的httpget请求中获取mysql数据