From 5e6b7ee5297e200b4d5ba41a096ac5f2a8aa6c71 Mon Sep 17 00:00:00 2001 From: Macwan Nevil Date: Tue, 10 Aug 2021 11:43:39 +0530 Subject: [PATCH] removed depricated account id (#4156) --- moto/ec2/models.py | 11 ++++++++--- moto/ec2/responses/route_tables.py | 3 ++- tests/terraform-tests.success.txt | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/moto/ec2/models.py b/moto/ec2/models.py index 08bf22da9..fdf58ee30 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -3490,7 +3490,6 @@ class Subnet(TaggedEC2Resource, CloudFormationModel): availability_zone, default_for_az, map_public_ip_on_launch, - owner_id=OWNER_ID, assign_ipv6_address_on_creation=False, ): self.ec2_backend = ec2_backend @@ -3504,7 +3503,6 @@ class Subnet(TaggedEC2Resource, CloudFormationModel): self._availability_zone = availability_zone self.default_for_az = default_for_az self.map_public_ip_on_launch = map_public_ip_on_launch - self.owner_id = owner_id self.assign_ipv6_address_on_creation = assign_ipv6_address_on_creation self.ipv6_cidr_block_associations = [] @@ -3517,6 +3515,10 @@ class Subnet(TaggedEC2Resource, CloudFormationModel): self._subnet_ips = {} # has IP: instance self.state = "available" + @property + def owner_id(self): + return ACCOUNT_ID + @staticmethod def cloudformation_name_type(): return None @@ -3750,7 +3752,6 @@ class SubnetBackend(object): availability_zone_data, default_for_az, map_public_ip_on_launch, - owner_id=context.get_current_user() if context else OWNER_ID, assign_ipv6_address_on_creation=False, ) @@ -4133,6 +4134,10 @@ class RouteTable(TaggedEC2Resource, CloudFormationModel): self.associations = {} self.routes = {} + @property + def owner_id(self): + return ACCOUNT_ID + @staticmethod def cloudformation_name_type(): return None diff --git a/moto/ec2/responses/route_tables.py b/moto/ec2/responses/route_tables.py index 185c8c091..af515236f 100644 --- a/moto/ec2/responses/route_tables.py +++ b/moto/ec2/responses/route_tables.py @@ -123,6 +123,7 @@ CREATE_ROUTE_TABLE_RESPONSE = """ {{ route_table.id }} {{ route_table.vpc_id }} + {{ route_table.owner_id }} {% for route in route_table.routes.values() %} {% if route.local %} @@ -157,7 +158,7 @@ DESCRIBE_ROUTE_TABLES_RESPONSE = """ {{ route_table.id }} {{ route_table.vpc_id }} - + {% for route in route_table.routes.values() %} {{ route.destination_cidr_block }} diff --git a/tests/terraform-tests.success.txt b/tests/terraform-tests.success.txt index 55c4cbbaf..142342f9b 100644 --- a/tests/terraform-tests.success.txt +++ b/tests/terraform-tests.success.txt @@ -71,3 +71,4 @@ TestAccAWSUserGroupMembership TestAccAWSUserPolicyAttachment TestAccAWSUserSSHKey TestAccAWSVpc_ +TestAccAWSRouteTable_disappears