I am trying to build a VPC resource with Terraform to provide for an MWAA build. In the AWS documentation, I see the below resources (in addition to subnets, etc.) are defined to create a whole VPC environment. I have defined aws_vpc
& aws_internet_gateway
with Terraform, but cannot find a Terraform template for InternetGatewayAttachment
- only for aws_vpn_gateway_attachment
.
- How do I go about attaching the VPC resource to the IGW w/Terraform?
- Do I need an resource, or is that implied w/the vpc_id in the TF aws_internet_gateway resource definition?
P. S. - I am coming from GCP & not super familiar w/AWS Networking concepts.
Resources:
VPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: !Ref VpcCIDR
EnableDnsSupport: true
EnableDnsHostnames: true
Tags:
- Key: Name
Value: !Ref EnvironmentName
InternetGateway:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Key: Name
Value: !Ref EnvironmentName
InternetGatewayAttachment:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
InternetGatewayId: !Ref InternetGateway
VpcId: !Ref VPC
....