From aedfebed98b7dc027f052ee37c2c876478cd452a Mon Sep 17 00:00:00 2001 From: Rasmus Larsen Date: Fri, 26 Jan 2018 14:48:11 +0100 Subject: [PATCH 1/3] Add support for CidrIpv6 in Security Ingress rules. --- moto/ec2/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moto/ec2/models.py b/moto/ec2/models.py index f877d3772..352960fd5 100755 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -1709,6 +1709,7 @@ class SecurityGroupIngress(object): group_id = properties.get('GroupId') ip_protocol = properties.get("IpProtocol") cidr_ip = properties.get("CidrIp") + cidr_ipv6 = properties.get("CidrIpv6" from_port = properties.get("FromPort") source_security_group_id = properties.get("SourceSecurityGroupId") source_security_group_name = properties.get("SourceSecurityGroupName") @@ -1717,7 +1718,7 @@ class SecurityGroupIngress(object): to_port = properties.get("ToPort") assert group_id or group_name - assert source_security_group_name or cidr_ip or source_security_group_id + assert source_security_group_name or cidr_ip or cidr_ipv6 or source_security_group_id assert ip_protocol if source_security_group_id: From 59c49ca34f911da15b9385743b7d2a5124247fd5 Mon Sep 17 00:00:00 2001 From: Rasmus Larsen Date: Fri, 26 Jan 2018 14:55:53 +0100 Subject: [PATCH 2/3] Fix typo. --- moto/ec2/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moto/ec2/models.py b/moto/ec2/models.py index 352960fd5..74bc9d166 100755 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -1709,7 +1709,7 @@ class SecurityGroupIngress(object): group_id = properties.get('GroupId') ip_protocol = properties.get("IpProtocol") cidr_ip = properties.get("CidrIp") - cidr_ipv6 = properties.get("CidrIpv6" + cidr_ipv6 = properties.get("CidrIpv6") from_port = properties.get("FromPort") source_security_group_id = properties.get("SourceSecurityGroupId") source_security_group_name = properties.get("SourceSecurityGroupName") From 796145d62d2b7db9e84d00d6119488a1d44a27da Mon Sep 17 00:00:00 2001 From: Rasmus Larsen Date: Fri, 26 Jan 2018 15:32:22 +0100 Subject: [PATCH 3/3] Make DestinationCidrBlock optional (ipv6). --- moto/ec2/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moto/ec2/models.py b/moto/ec2/models.py index 74bc9d166..f80861c10 100755 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -2591,7 +2591,7 @@ class Route(object): ec2_backend = ec2_backends[region_name] route_table = ec2_backend.create_route( route_table_id=route_table_id, - destination_cidr_block=properties['DestinationCidrBlock'], + destination_cidr_block=properties.get('DestinationCidrBlock'), gateway_id=gateway_id, instance_id=instance_id, interface_id=interface_id,