gpt4 book ai didi

aws-cloudformation - 如何在 AWS 中通过 Cloudformation 设置入站规则名称

转载 作者:行者123 更新时间:2023-12-03 07:19:51 24 4
gpt4 key购买 nike

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

enter image description here

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

      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

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

最佳答案

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

关于aws-cloudformation - 如何在 AWS 中通过 Cloudformation 设置入站规则名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70701933/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com