From 6d2c9d9960bfe66d3d55e79d6d46e76936281ec4 Mon Sep 17 00:00:00 2001 From: Tyler Sanders Date: Fri, 14 Nov 2014 17:31:08 -0600 Subject: [PATCH] Move call to associate default Network ACL with a new subnet. --- 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 40e8ac179..8c65553ad 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -1606,11 +1606,11 @@ class SubnetBackend(object): def create_subnet(self, vpc_id, cidr_block): subnet_id = random_subnet_id() subnet = Subnet(self, subnet_id, vpc_id, cidr_block) + vpc = self.get_vpc(vpc_id) # Validate VPC exists # AWS associates a new subnet with the default Network ACL self.associate_default_network_acl_with_subnet(subnet_id) - vpc = self.get_vpc(vpc_id) # Validate VPC exists self.subnets[subnet_id] = subnet return subnet