简体   繁体   English

如何使用CloudFormation基于现有ARN创建AWS资源?

[英]How to create AWS resources based on an existing ARN using CloudFormation?

I'm wondering is there a way to create AWS resource in CloudFormation template using existing ARN (Amazon Resource Name). 我想知道是否有一种方法可以使用现有的ARN(Amazon资源名称)在CloudFormation模板中创建AWS资源。

For example, I already have a Dynamo DB whose ARN is something like arn:aws:dynamodb:us-west-2:111111111111:table/MyTable . 例如,我已经有一个Dynamo DB,其ARN类似于arn:aws:dynamodb:us-west-2:111111111111:table/MyTable Now I want to create a table in CloudFormation which essentially is pointing to this existing DynamoTable. 现在,我想在CloudFormation中创建一个表,该表实际上指向此现有DynamoTable。 May be something like: 可能是这样的:

Resources:
  MyTable:
    Type: 'AWS::DynamoDB::Table'
    ARN: 'arn:aws:dynamodb:us-west-2:111111111111:table/MyTable'

I know the code above doesn't work, but does anyone know how can I achieve this? 我知道上面的代码行不通,但是有人知道我该如何实现吗? Lots of thanks! 非常感谢!

It's not possible to "connect" a new Cloudformation template to existing AWS infrastructure. 不可能将新的Cloudformation模板“连接”到现有的AWS基础设施。

You'd have to create a new DynamoDB with your template and migrate the data over. 您必须使用模板创建一个新的DynamoDB并迁移数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM