Lookup IGW after specifying VPC parameter in CloudFormation template

0 votes

In the below snippet, can I do a lookup for the IGW using a function (or something) based on the VpcId parameter instead of needing it as a parameter?

Parameters:
  VpcId:
    Type: AWS::EC2::VPC::Id
    Description: Enter the Existing Landing Zone VPC ID. 
  InternetGateway:
    Type: String
    Description: Enter the Existing Landing Zone IGW.

Resources:
  DefaultRoute:
    Type: AWS::EC2::Route
    Properties: 
      DestinationCidrBlock: 0.0.0.0/0
      GatewayId: !Ref InternetGateway
      RouteTableId: !Ref RouteTable

Thanks.

I have not tried anything because I can't find anything that makes me thinks this would work, just not sure if I am missing something.

Jan 9, 2023 in AWS by Ashwini
• 5,430 points

edited 5 days ago 5 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP