Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::EC2::TransitGateway - new return value #61

Open
mugurelmargaritkurtgeiger opened this issue Jul 31, 2019 · 3 comments
Open

AWS::EC2::TransitGateway - new return value #61

mugurelmargaritkurtgeiger opened this issue Jul 31, 2019 · 3 comments
Labels
networking & content deliv VPC, CloudFront, Route 53, API Gateway, Direct Connect, AWS App Mesh, etc.
Milestone

Comments

@mugurelmargaritkurtgeiger

1. Title

AWS::EC2::TransitGateway-NewReturnValue

2. Scope of request

We should be able to use the Fn::GetAtt intrinsic function to return the ARN of the transit gateway.

3. Expected behavior

I should be able to use the below and an ARN to be returned:

{ "Fn::GetAtt" : [ "TransitGateway", "Arn" ] }

4. Suggest specific test cases

It would be helpful to use this ARN for resource sharing, ARN being a required property (ResourceArns) for the AWS::RAM::ResourceShare resource.

5. Helpful Links to speed up research and evaluation

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgateway.html (only Ref seems to be supported)
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ram-resourceshare.html

6. Category (required) - Will help with tagging and be easier to find by other users to +1

  1. Security (IAM, KMS...)
@TheDanBlanco TheDanBlanco added the networking & content deliv VPC, CloudFront, Route 53, API Gateway, Direct Connect, AWS App Mesh, etc. label Jul 31, 2019
@benbridts
Copy link

see also #68

@craigataws craigataws added this to the cov milestone Jul 21, 2020
@yannickvr
Copy link

yannickvr commented Aug 11, 2020

Unneccesary, just use

!Sub "arn:aws:ec2:${AWS::Region}:${AWS::AccountId}:transit-gateway/${TransitGateway}"

Where TransitGateway is the logical name of the Cloudformation resource that created your transit gateway. For reference

  TransitGateway:
    Type: "AWS::EC2::TransitGateway"
    Properties:
      AmazonSideAsn: !Ref AmazonSideAsn
      Description: !Ref GatewayName
      AutoAcceptSharedAttachments: !Ref AutoAcceptSharedAttachments
      DefaultRouteTableAssociation: !Ref DefaultRouteTableAssociation
      DnsSupport: !Ref DnsSupport
      VpnEcmpSupport: !Ref VpnEcmpSupport

  TransitGatewayResourceShare:
    Type: "AWS::RAM::ResourceShare"
    Properties:
      Name: !Sub "${GatewayName}-${AWS::Region}-transitgateway"
      ResourceArns:
        - !Sub "arn:aws:ec2:${AWS::Region}:${AWS::AccountId}:transit-gateway/${TransitGateway}" 
      Principals: !Ref OrganizationAccounts 

@thu001
Copy link

thu001 commented Jan 17, 2025

This issue has been addressed. We added TransitGatewayArn to the resource properties.
Here is the test I ran with the template below:

Resources:
  TransitGateway:
    Type: AWS::EC2::TransitGateway 
    Properties:
      DefaultRouteTableAssociation: enable
      DefaultRouteTablePropagation: enable

Outputs:
  TestTgwArn:
    Value:
      Fn::GetAtt: TransitGateway.TransitGatewayArn

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
networking & content deliv VPC, CloudFront, Route 53, API Gateway, Direct Connect, AWS App Mesh, etc.
Projects
Status: Coming Soon
Development

No branches or pull requests

6 participants