AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::EC2::VPCGatewayAttachment

CfnVPCGatewayAttachment

Attaches an internet gateway, or a virtual private gateway to a VPC, enabling connectivity between the internet and the VPC.

Import

import { CfnVPCGatewayAttachment } from 'aws-cdk-lib/aws-ec2';

Or use the module namespace:

import * as ec2 from 'aws-cdk-lib/aws-ec2';
// ec2.CfnVPCGatewayAttachment

Properties

Configuration passed to the constructor as CfnVPCGatewayAttachmentProps.

vpcIdRequired
string | IVPCRef

The ID of the VPC.

internetGatewayIdOptional
string | IInternetGatewayRef

The ID of the internet gateway. You must specify either `InternetGatewayId` or `VpnGatewayId` , but not both.

vpnGatewayIdOptional
string | IVPNGatewayRef

The ID of the virtual private gateway. You must specify either `InternetGatewayId` or `VpnGatewayId` , but not both.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the Amazon EC2 Cheat Sheet

Everything you need to know about Amazon EC2 on one page. HD quality, print-friendly.

Download Free Infographic