Amazon-CloudFormation – AWS CloudFormation Template: Can you add a lot of CIDRIP as a list?

I want to create inbound rules for security groups in the cloud formation template. I want to open port 3306 from many different IPs.

"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"CidrIp": "0.0.0.0/0",
"FromPort": "3306",
"ToPort": "3306"
}

I know that the document says that String is of type CidrIp but it can do something like this [“100.10.77.66/32”, “100.10.66.66 / 32”, “101.10.77.66 / 32”] to avoid writing the same block multiple times?

Don’t be afraid, because the document states that it only accepts String instead of List, so multiple blocks are required.

It can be imagined that it is the same way of creating entry rules in the web console, and each CIDR has a new rule.

I I want to create inbound rules for security groups in the cloud formation template. I want to open port 3306 from many different IPs.

"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"CidrIp": "0.0.0.0/0",
"FromPort": "3306",
"ToPort": "3306"
}

I know that the document says that String is of type CidrIp but it can do something like this [“100.10.77.66/32”, “100.10.66.66 / 32”, “101.10.77.66 / 32”] to avoid writing the same block multiple times?

Don’t be afraid, because the document states that it only accepts String instead of List, so multiple blocks are needed.

You can imagine It is the same as the way to create entry rules in the web console, each CIDR has a new rule.

Leave a Comment

Your email address will not be published.