aws ec2 attach-vpn-gateway
Attaches an available virtual private gateway to a VPC. AWS CLI reference
1 example 3 options Its page in the AWS CLI reference
Examples
To attach a virtual private gateway to your VPC
The following attach-vpn-gateway example attaches the specified virtual private gateway to the specified VPC.
aws ec2 attach-vpn-gateway --vpn-gateway-id vgw-9a4cacf3 --vpc-id vpc-a01106c2Identify--vpn-gateway-idThe ID of the virtual private gateway.--vpc-idThe ID of the VPC.Its output
{
"VpcAttachment": {
"State": "attaching",
"VpcId": "vpc-a01106c2"
}
}For more information, see Get started with AWS Site-to-Site VPN in the AWS Site-to-Site VPN User Guide.
Options
--dry-runChecks whether you have the required permissions for the action, without actually making the request, and provides an error response.--vpc-idThe ID of the VPC.--vpn-gateway-idThe ID of the virtual private gateway.