AWS::EC2::VPCGatewayAttachment
Attaches a gateway to a VPC.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::EC2::VPCGatewayAttachment", "Properties" : { "InternetGatewayId" :String, "VpcId" :String, "VpnGatewayId" :String} }
YAML
Type: AWS::EC2::VPCGatewayAttachment Properties: InternetGatewayId:StringVpcId:StringVpnGatewayId:String
Properties
InternetGatewayId-
The ID of the Internet gateway.
Required: Conditional You must specify either
InternetGatewayIdorVpnGatewayId, but not both.Type: String
Update requires: No interruption
VpcId-
The ID of the VPC to associate with this gateway.
Required: Yes
Type: String
Update requires: No interruption
VpnGatewayId-
The ID of the virtual private network (VPN) gateway to attach to the VPC.
Required: Conditional You must specify either
InternetGatewayIdorVpnGatewayId, but not both.Type: String
Update requires: No interruption
Return Values
Ref
When the logical ID of this resource is provided to the Ref intrinsic
function, Ref returns the resource name.
For more information about using the Ref function, see Ref.
Examples
To attach both an Internet gateway and a VPN gateway to a VPC, you must specify two
separate AWS::EC2::VPCGatewayAttachment resources:
JSON
"AttachGateway" : { "Type" : "AWS::EC2::VPCGatewayAttachment", "Properties" : { "VpcId" : { "Ref" : "VPC" }, "InternetGatewayId" : { "Ref" : "myInternetGateway" } } }, "AttachVpnGateway" : { "Type" : "AWS::EC2::VPCGatewayAttachment", "Properties" : { "VpcId" : { "Ref" : "VPC" }, "VpnGatewayId" : { "Ref" : "myVPNGateway" } } }
YAML
AttachGateway: Type: AWS::EC2::VPCGatewayAttachment Properties: VpcId: Ref: VPC InternetGatewayId: Ref: myInternetGateway AttachVpnGateway: Type: AWS::EC2::VPCGatewayAttachment Properties: VpcId: Ref: VPC VpnGatewayId: Ref: myVPNGateway
See Also
-
AttachVpnGateway in the Amazon EC2 API Reference.
