2016-11-14 88 views
-1

如何使用CloudFormation创建一个安全组,让“所有ICMP”AWS Cloudformation配置ICMP协议安全组

类型:所有ICMP

协议:所有

端口范围: N/A

来源:0.0.0.0/0

我尝试以下,但它给 “回声应答”。什么是“ICMP all”的正确语法? “CidrIp”: “0.0.0.0/0”, “FromPort”: “0”, “IpProtocol”: “ICMP”, “ToPort”: “1”

回答

0

能否请您尝试以下语法?

类型:所有ICMP 协议:TCP 端口范围:0 - 65535 来源:任何地方 - 0.0.0.0/0

+0

是的,但那些对控制台的说明。 OP请求Amazon CloudFormation的语法。 –

+0

{“IpProtocol”:“icmp”,“FromPort”:“8”,“ToPort”:“-1”,“CidrIp”:“10.0.0.0/24”} –

0

AWS::EC2::SecurityGroupIngress具有代码示例允许ICMP平

"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

0

在Cloudformation(CFN),这将允许所有ICMP流量:

"IpProtocol" : "icmp", "FromPort" : "-1", "ToPort" : "-1", "CidrIp" : "10.0.0.0/8"