gpt4 book ai didi

amazon-web-services - AWS Cloudformation 为安全组配置 ICMP 协议(protocol)

转载 作者:行者123 更新时间:2023-12-03 07:28:49 31 4
gpt4 key购买 nike

如何使用 CloudFormation 创建安全组以允许“ALL ICMP”

类型:所有 ICMP

协议(protocol):全部

端口范围:不适用

来源:0.0.0.0/0

我尝试了以下操作,但它给出了“回显回复”。 “ICMP all”的正确语法是什么? "CidrIp": "0.0.0.0/0", "来自端口": "0", "IpProtocol": "icmp", “到端口”:“-1”

最佳答案

AWS::EC2::SecurityGroupIngress有一个允许 ICMP Ping 的代码示例:

"SGPing" : {
"Type" : "AWS::EC2::SecurityGroup",
"DependsOn": "VPC",
"Properties" : {
"GroupDescription" : "SG to test ping",
"VpcId" : {"Ref" : "VPC"},
"SecurityGroupIngress" : [
{ "IpProtocol" : "icmp", "FromPort" : "8", "ToPort" : "-1", "CidrIp" : "10.0.0.0/24" }
]
}
}

奇怪的是,该页面还建议使用 -1 作为 FromPort

关于amazon-web-services - AWS Cloudformation 为安全组配置 ICMP 协议(protocol),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40582768/

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