Merge pull request #2647 from aimannajjar/2646_create_default_ipv6_egress_rule

Security Groups - Create a second default egress rule for IPv6
This commit is contained in:
Steve Pulec 2020-03-07 11:33:57 -06:00 committed by GitHub
commit 4cb23837e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View file

@ -1722,6 +1722,12 @@ class SecurityGroup(TaggedEC2Resource):
self.vpc_id = vpc_id
self.owner_id = OWNER_ID
# Append default IPv6 egress rule for VPCs with IPv6 support
if vpc_id:
vpc = self.ec2_backend.vpcs.get(vpc_id)
if vpc and len(vpc.get_cidr_block_association_set(ipv6=True)) > 0:
self.egress_rules.append(SecurityRule("-1", None, None, [], []))
@classmethod
def create_from_cloudformation_json(
cls, resource_name, cloudformation_json, region_name