| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Attaches a gateway to a VPC.
{
"Type" : "AWS::EC2::VPCGatewayAttachment",
"Properties" : {
"InternetGatewayId" : String,
"VpcId" : String,
"VpnGatewayId" : String
}
} The ID of the Internet gateway.
Required: Conditional. You must specify either InternetGatewayId or VpnGatewayId, but not both.
Type: String.
The ID of the VPC to associate with this gateway.
Required: Yes.
Type: String.
The ID of the virtual private network (VPN) gateway to attach to the VPC.
Required: Conditional. You must specify either InternetGatewayId or VpnGatewayId, but not both.
Type: String.
When the logical ID of this resource is provided to the Ref intrinsic
function, it returns the resource name.
For more information about using the Ref function, see Ref.
Example Attaching both an Internet gateway and a VPN gateway to a VPC
To attach both an Internet gateway and a VPN gateway to a VPC, you must specify two separate AWS::EC2::VPCGatewayAttachment resources:
"AttachGateway" : {
"Type" : "AWS::EC2::VPCGatewayAttachment",
"Properties" : {
"VpcId" : { "Ref" : "VPC" },
"InternetGatewayId" : { "Ref" : "myInternetGateway" }
}
},
"AttachVpnGateway" : {
"Type" : "AWS::EC2::VPCGatewayAttachment",
"Properties" : {
"VpcId" : { "Ref" : "VPC" },
"VpnGatewayId" : { "Ref" : "myVPNGateway" }
}
}, AttachVpnGateway in the Amazon Elastic Compute Cloud API Reference.