【问题标题】:Is it possible to describe existing resources in CloudFormation?是否可以在 CloudFormation 中描述现有资源?
【发布时间】:2018-09-04 15:15:26
【问题描述】:

我有一个场景,我想为我的 AWS 账户中的所有现有 VPC(现有的我是指不是由 Cloud-formation 堆栈创建的 VPC)启用流日志。对于这些,我需要从我的 AWS 账户中描述所有现有的 VPC(比如说特定于区域)并获取他们的 Vpc-id,然后我会将其提供给 create-flow-log。 是否可以通过 Cloud Formation Stack 描述现有资源,因为我没有找到任何用于此目的的 AWS 文档?是否有任何其他可能性可以做到这一点并且仍在使用 Cloud-Formation?

【问题讨论】:

  • 这可能不是通过 CloudFormation 完成的。通常,CloudFormation 用于以已知配置部署基础架构,这些配置可以在未来重复使用和重新部署。如果 CloudFormation 最初部署了这些 VPC,那么只需更改 CloudFormation 模板中的参数,然后更新堆栈。否则, CloudFormation 之外进行(例如使用AWS Command-Line Interface (CLI) 或程序)更合适。
  • @JohnRotenstein 这很有意义。谢谢

标签: amazon-web-services amazon-cloudformation


【解决方案1】:

马来文 - 可以引用非 CFN 创建的现有资源。但是,不可能修改它们。

下面是一个将现有 VPC ID 作为输入参数的示例:

List<AWS::EC2::VPC::Id>
An array of VPC IDs, such as vpc-a123baa3, vpc-b456baa3.

希望对你有帮助。

【讨论】:

    猜你喜欢
    • 2021-06-23
    • 2017-01-16
    • 2017-03-01
    • 2019-02-26
    • 1970-01-01
    • 2021-10-15
    • 2017-03-04
    • 2011-03-19
    • 1970-01-01
    相关资源
    最近更新 更多