Skip to content

Commit

Permalink
Invert Ipv6CidrBlock Check (#2216)
Browse files Browse the repository at this point in the history
Invert Ipv6CidrBlock check. AssignIpv6AddressOnCreation depends on Ipv6CidrBlock, not the other way round.
  • Loading branch information
benbridts authored Jan 29, 2024
1 parent 6a2ab81 commit a7a6c8a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions troposphere/validators/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,11 @@ def validate_subnet(self):
"""
Class: Subnet
"""
if "Ipv6CidrBlock" in self.properties:
if not self.properties.get("AssignIpv6AddressOnCreation"):
if self.properties.get("AssignIpv6AddressOnCreation"):
if "Ipv6CidrBlock" not in self.properties:
raise ValueError(
"If Ipv6CidrBlock is present, "
"AssignIpv6AddressOnCreation must be set to True"
"If AssignIpv6AddressOnCreation is set to True, "
"Ipv6CidrBlock must be present"
)


Expand Down

0 comments on commit a7a6c8a

Please sign in to comment.