How to attach an Internet Gateway to a VPC?

0 votes
Can someone help me with the command for attaching an Internet Gateway to a VPC?
Feb 21 in AWS by Sukanya
30 views

1 answer to this question.

0 votes

To attach an Internet Gateway to a VPC using AWS CLI you must know your Internet Gateway ID and Your VPC Id. 

To attach you can use the following command:-

C:\Users\priyj_kumar>aws ec2 attach-internet-gateway --internet-gateway-id igw-0185c098195ba1d1a --vpc-id vpc-0aca683c37231c12f

This way you can attach your Internet Gateway to your VPC.

You can verify it using your AWS Console

Here you can see that your Internet Gateway is attached to your VPC.

Hope it helps

answered Feb 21 by Priyaj
• 56,160 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer

How do I configure and attach an internet gateway for use with Elastic Load Balancing?

Follow these steps: First, create an internet gateway and ...READ MORE

answered May 16 in AWS by Archu
28 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer