From b3795d312afe2135d8c4d781908a277d88d7e2af Mon Sep 17 00:00:00 2001 From: Mohit Alonja Date: Tue, 7 Sep 2021 21:51:05 +0530 Subject: [PATCH] added owner_id for igw (#4271) --- moto/ec2/models.py | 4 ++++ moto/ec2/responses/internet_gateways.py | 6 ++---- tests/terraform-tests.success.txt | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/moto/ec2/models.py b/moto/ec2/models.py index 03b690113..9b382a1aa 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -5050,6 +5050,10 @@ class InternetGateway(TaggedEC2Resource, CloudFormationModel): self.id = random_internet_gateway_id() self.vpc = None + @property + def owner_id(self): + return ACCOUNT_ID + @staticmethod def cloudformation_name_type(): return None diff --git a/moto/ec2/responses/internet_gateways.py b/moto/ec2/responses/internet_gateways.py index e9704429a..732faa7c0 100644 --- a/moto/ec2/responses/internet_gateways.py +++ b/moto/ec2/responses/internet_gateways.py @@ -64,11 +64,10 @@ CREATE_INTERNET_GATEWAY_RESPONSE = """ {{ igw.id }} + {{ igw.owner_id or none }} {% if igw.vpc %} @@ -102,8 +102,6 @@ DESCRIBE_INTERNET_GATEWAYS_RESPONSE = """ {% for tag in igw.get_tags() %} - {{ tag.resource_id }} - {{ tag.resource_type }} {{ tag.key }} {{ tag.value }} diff --git a/tests/terraform-tests.success.txt b/tests/terraform-tests.success.txt index c916cdc6f..c0d9f147d 100644 --- a/tests/terraform-tests.success.txt +++ b/tests/terraform-tests.success.txt @@ -98,3 +98,4 @@ TestAccAWSSsmDocumentDataSource TestAccAwsEc2ManagedPrefixList TestAccAWSEgressOnlyInternetGateway TestAccAWSSecurityGroup_ +TestAccAWSInternetGateway