简体   繁体   English

如何在 CloudFormation 中获取手动创建的 dynamodb 表的 streamArn

[英]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.

相关问题 “截断”通过CloudFormation(SAM)创建的DynamoDB表 - “Truncating” a DynamoDB Table Created via CloudFormation (SAM) 如何将“手动创建”的资源添加到 cloudformation 模板 - how to add "manually created" resources to the cloudformation template CloudFormation中的PutItem在DynamoDB表中 - PutItem in DynamoDB table by CloudFormation 如何列出手动创建的AWS资源而不是CloudFormation模板创建的资源? - How to list manually created AWS resources and not resources created by CloudFormation templates? 如何从 cloudformation 中的现有表中引用 dynamodb stream arn? - How to reference a dynamodb stream arn from an existing table in cloudformation? 如何使用 CloudFormation 创建这个 DynamoDb 表组? - how can I create this DynamoDb table group with CloudFormation? AWS CloudFormation:如何获取 DynamoDB GlobalTable 副本的 stream ARN? - AWS CloudFormation: How to get stream ARN of DynamoDB GlobalTable replica? DynamoDB - 使用 PITR 为 CloudFormation 管理的 DynamoDB 表恢复表 - DynamoDB - restoring table using PITR for DynamoDB table managed by CloudFormation AWS CloudFormation:如何在cloudformation模板中引用默认/主路由表(在创建VPC时创建)? - AWS CloudFormation: how do I refer to the default/main route table (that is created when a VPC is created) in a cloudformation template? CloudFormation - 为 DynamoDB 创建表启用 TTL - CloudFormation - Enable TTL for DynamoDB Create Table
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM