【问题标题】:How to get the subnet id for existing vpc subnet in cloudformation如何在 cloudformation 中获取现有 vpc 子网的子网 ID
【发布时间】:2021-11-26 08:51:51
【问题描述】:

我想为 redshift 集群创建一个子网组:我找到了这个模板:

RedshiftClusterSubnetGroup:
    Type: AWS::Redshift::ClusterSubnetGroup
    Properties:
      Description: Cluster subnet group
      SubnetIds:
        - !Ref SubnetA
        - !Ref SubnetB

假设我有两个已经存在的子网名称是:subnetA 和subnet B 如果我不想从模板创建子网,如何使用它?

【问题讨论】:

    标签: amazon-web-services amazon-cloudformation aws-cloudformation-custom-resource


    【解决方案1】:

    你可以定义两个parameters:

    Parameters:
      SubnetA:
        Type: AWS::EC2::Subnet::Id
      SubnetB:
        Type: AWS::EC2::Subnet::Id   
    

    这样您可以轻松地为您的RedshiftClusterSubnetGroup 选择现有子网。

    【讨论】:

      猜你喜欢
      • 2018-02-05
      • 2017-03-12
      • 2015-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-23
      • 2017-12-03
      • 1970-01-01
      相关资源
      最近更新 更多