diff --git a/moto/ec2/models/transit_gateway.py b/moto/ec2/models/transit_gateway.py index b6e6bfd2d..2805a0367 100644 --- a/moto/ec2/models/transit_gateway.py +++ b/moto/ec2/models/transit_gateway.py @@ -46,6 +46,10 @@ class TransitGateway(TaggedEC2Resource, CloudFormationModel): def owner_id(self) -> str: return self.ec2_backend.account_id + @property + def arn(self) -> str: + return f"arn:aws:ec2:{self.ec2_backend.region_name}:{self.ec2_backend.account_id}:transit-gateway/{self.id}" + @staticmethod def cloudformation_name_type() -> str: return "" @@ -62,7 +66,7 @@ class TransitGateway(TaggedEC2Resource, CloudFormationModel): cloudformation_json: Any, account_id: str, region_name: str, - **kwargs: Any + **kwargs: Any, ) -> "TransitGateway": from ..models import ec2_backends diff --git a/moto/ec2/responses/transit_gateways.py b/moto/ec2/responses/transit_gateways.py index f86afaab3..013ab2528 100644 --- a/moto/ec2/responses/transit_gateways.py +++ b/moto/ec2/responses/transit_gateways.py @@ -64,6 +64,7 @@ CREATE_TRANSIT_GATEWAY_RESPONSE = """