[英]How to get streamArn of a manually created dynamodb table in CloudFormation
I am trying to create a cloudformation template to deploy a lambda and this lambda will have DynamoDB as trigger.我正在尝试创建一个 cloudformation 模板来部署一个 lambda 而这个 lambda 将有 DynamoDB 作为触发器。 So, to accommodate that I am using AWS::Lambda::EventSourceMapping in my cloudformation template and hardcoding EventSourceArn for each dynamodb table.
因此,为了适应这一点,我在我的 cloudformation 模板中使用 AWS::Lambda::EventSourceMapping 并为每个 dynamodb 表硬编码 EventSourceArn。
My question, is there any way to get streamArn of a existing DynamoDB table, which is created manually?我的问题是,有没有办法获取手动创建的现有 DynamoDB 表的 streamArn? or I have to pass this value hardcoded from parameter section.
或者我必须从参数部分硬编码传递这个值。
Please help me with you advice.请帮助我给你建议。
All the things you create manually are available in AWS console and you could check all arns.您手动创建的所有内容都在 AWS 控制台中可用,您可以检查所有 arn。
For you specific case go to AWS Console -> DynamoDB -> Select your table
.对于您的特定情况 go 到
AWS Console -> DynamoDB -> Select your table
。
Note: I would recommend using cloudformation and avoid using manual things if this is deployed somewhere for real.注意:我建议使用 cloudformation 并避免使用手动的东西,如果这确实部署在某个地方。
There is no native CloudFormation functionality to retrieve the manually created resource Arns with the exception of certain parameter types .除某些参数类型外,没有用于检索手动创建的资源 Arns 的本机 CloudFormation 功能。
If you intend to keep this resource as a manually created resource you would need to pass in as a parameter into your template so that you can reference it, either referencing as a string or a SSM based parameter .如果您打算将此资源保留为手动创建的资源,则需要将其作为参数传递到模板中,以便您可以引用它,引用为字符串或基于SSM 的参数。
Alternatively you could construct a Custom resource that accepts the DynamoDB table name as a parameter and triggers a Lambda to get the Arn of the stream.或者,您可以构建一个自定义资源,该资源接受 DynamoDB 表名称作为参数并触发 Lambda 以获取 stream 的 Arn。
If you wanted to managed the table in CloudFormation you could construct the resource in your CloudFormation template and then import into the stack .如果您想在 CloudFormation 中管理表,您可以在 CloudFormation 模板中构建资源,然后导入到堆栈中。 By doing this you could then reference the
StreamArn
of the DynamoDB table resource .通过这样做,您可以引用
StreamArn
表资源的 StreamArn。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.