aws ec2 attach-internet-gateway
Attaches an internet gateway or a virtual private gateway to a VPC, enabling connectivity between the internet and the VPC. AWS CLI reference
1 example 3 options Its page in the AWS CLI reference
Examples
To attach an internet gateway to your VPC
The following attach-internet-gateway example attaches the specified internet gateway to the specific VPC.
aws ec2 attach-internet-gateway --internet-gateway-id igw-0d0fb496b3EXAMPLE --vpc-id vpc-0a60eb65b4EXAMPLEIdentify--internet-gateway-idThe ID of the internet gateway.--vpc-idThe ID of the VPC.This command produces no output.
For more information, see Internet gateways in the Amazon VPC User Guide.
Options
--dry-runChecks whether you have the required permissions for the action, without actually making the request, and provides an error response.--internet-gateway-idThe ID of the internet gateway.--vpc-idThe ID of the VPC.