I have my CloudFormation script like this now:
"SecurityGroupIngress" : [{ "IpProtocol" : "tcp", "FromPort" : "0", "ToPort" : "65535", "CidrIp" : "0.0.0.0/0" }]
and it looks like this, which is fine:
But I am wondering how to I update the template to get this:
Notice the Ports say All. I also wonder if they are different?
In the Port Range box, enter a specific port number used by your server applications as secure alternative to the range of ports. In the Source section, select Anywhere, Custom or My IP to define the appropriate source of incoming traffic.
A security group acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic. Inbound rules control the incoming traffic to your instance, and outbound rules control the outgoing traffic from your instance. When you launch an instance, you can specify one or more security groups.
To create a security group, use the VpcId property to specify the VPC for which to create the security group. This type supports updates. For more information about updating stacks, see AWS CloudFormation Stacks Updates.
If you are looking to allow all protocols and all ports, then you can do the following
{ "IpProtocol" : "-1" "CidrIp" : "0.0.0.0/0" }
The original solution I posted (and accepted by the original poster) stopped working as AWS no longer supports it. To avoid the barrage of downvotes, I deleted the answer. The alternatives are:
or
Open all ports for all protocols not just TCP (as suggested by thewire247
below)
"SecurityGroupIngress" : [{ "IpProtocol" : "-1", "CidrIp" : "0.0.0.0/0" }]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With