Internet gateways and NAT-GW

In most cases, your VPC needs to have a connection with the public internet. In this case, you need to create an Internet Gateway (IGW) to attach to your VPC.

In the following example, an IGW is created and attached to vpc-0ca37d4650963adbb:

//create IGW, it returns IGW id as igw-01769bff334dcc035$ aws ec2 create-internet-gateway{    "InternetGateway": {        "Attachments": [],        "InternetGatewayId": "igw-01769bff334dcc035",        "Tags": []    }}    
//attach igw-01769bff334dcc035 to vpc-0ca37d4650963adbb$ aws ec2 attach-internet-gateway --vpc-id vpc-0ca37d4650963adbb --internet-gateway-id igw-01769bff334dcc035

Once the IGW is attached, set a routing table (default gateway) for a subnet that points to the IGW. If a default gateway ...

Get DevOps with Kubernetes - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.