AWS IGW Using AWS Terraform
What is the role of IGW ?
IGW helps to connect the instances inside a VPC from the internet . And it also allows the instance to access internet to download necessary packages .
What is the difference between an IGW and NAT gateway ?
IGW is used in public subnet for both inbound and outbound internet access but NAT gateway is used for private subnets to access internet (only outbound ) . Creating IGW does not incur any cost on the other hand creating NAT gateways incur costs .
How to get internet access in an EC2 instance inside a VPC ?
To get internet access in an EC2 instance , you have to place the EC2 instance inside a subnet which has a route to Internet gateway in the route table .
Which resource is used to create Internet Gateway using Terraform ?
‘aws_internet_gateway’ resource is used to create Internet gateway using Terraform .
How many Internet Gateways can be attached to a VPC ?
Only one Internet Gateway can be attached to a VPC .
AWS IGW Using AWS Terraform
Terraform is an Infrastructure As Code tool that is used to programmatically provision infrastructure on a cloud platform. Here in this guide, i will first discuss what is AWS Internet Gateway and its important features. Then I will discuss Terraform. After this i will walk you through the different steps to create an AWS Internet Gateway using Terraform and how it helps to connect an EC2 Instance inside the VPC.