【问题标题】:How to set Inbound Rule Name via Cloudformation in AWS如何在 AWS 中通过 Cloudformation 设置入站规则名称
【发布时间】:2022-01-14 04:43:37
【问题描述】:

我正在尝试在我的安全组中设置此入口规则的名称:

我尝试了两种方法并查看了文档但找不到方法。我试过了:

      SecurityGroupIngress:
      - IpProtocol: icmp
        FromPort: 0
        ToPort: -1
        Name: Allow ICMP
        Description: Allow ICMP 
        CidrIp: 0.0.0.0/0

我已经试过了:

      SecurityGroupIngress:
      - IpProtocol: icmp
        FromPort: 0
        ToPort: -1
        Description: Allow ICMP 
        CidrIp: 0.0.0.0/0
        Tags:
        - Key: Name
          Value: Allow ICMP

我查找了示例,并查看了文档,但没有看到对此的参考。有什么想法吗?

【问题讨论】:

    标签: amazon-cloudformation


    【解决方案1】:

    您在控制台中看到的Name 是资源的名称标签。目前在 CloudFormation 中,AWS::EC2::SecurityGroup 中的 AWS::EC2::SecurityGroupIngressIngress 对象都不支持标签(单个规则的标签是最近的功能,在 July 2021 中添加。CloudFormation 不支持发布的所有新功能)。如果这是一项关键要求,您可以使用 Lambda backed custom CloudFormation resources 创建一个 AWS Lambda 函数,该函数将为您标记资源。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-12-14
      • 2018-11-07
      • 2019-04-10
      • 2019-05-19
      • 2018-01-27
      • 2016-06-27
      • 2014-09-22
      相关资源
      最近更新 更多