diff --git a/moto/ec2/models.py b/moto/ec2/models.py index b84e67804..32b6b1660 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -1280,6 +1280,7 @@ class VPC(TaggedEC2Resource): self.id = vpc_id self.cidr_block = cidr_block self.dhcp_options = None + self.state = 'available' @classmethod def create_from_cloudformation_json(cls, resource_name, cloudformation_json): diff --git a/moto/ec2/responses/vpcs.py b/moto/ec2/responses/vpcs.py index 380016d6b..30df1ea95 100644 --- a/moto/ec2/responses/vpcs.py +++ b/moto/ec2/responses/vpcs.py @@ -56,7 +56,7 @@ DESCRIBE_VPCS_RESPONSE = """ {% for vpc in vpcs %} {{ vpc.id }} - available + {{ vpc.state }} {{ vpc.cidr_block }} dopt-7a8b9c2d default diff --git a/tests/test_ec2/test_vpcs.py b/tests/test_ec2/test_vpcs.py index ae18e4ce9..4fecf0974 100644 --- a/tests/test_ec2/test_vpcs.py +++ b/tests/test_ec2/test_vpcs.py @@ -207,4 +207,4 @@ def test_vpc_get_by_tag_value_subset(): vpcs.should.have.length_of(2) vpc_ids = tuple(map(lambda v: v.id, vpcs)) vpc1.id.should.be.within(vpc_ids) - vpc2.id.should.be.within(vpc_ids) \ No newline at end of file + vpc2.id.should.be.within(vpc_ids)