CmdID / aws / aws directconnect
aws directconnect create-direct-connect-gateway-association
Creates an association between a Direct Connect gateway and a virtual private gateway. AWS CLI reference
1 example 4 options Its page in the AWS CLI reference
Examples
To associate a virtual private gateway with a Direct Connect gateway
The following create-direct-connect-gateway-association example associates virtual private gateway vgw-6efe725e with Direct Connect gateway 5f294f92-bafb-4011-916d-9b0bexample. You must run the command in the region in which the virtual private gateway is located.
aws directconnect create-direct-connect-gateway-association --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample --virtual-gateway-id vgw-6efe725eIdentify--direct-connect-gateway-idThe ID of the Direct Connect gateway.--virtual-gateway-idThe ID of the virtual private gateway.Its output
{
"directConnectGatewayAssociation": {
"associationState": "associating",
"virtualGatewayOwnerAccount": "123456789012",
"directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample",
"virtualGatewayId": "vgw-6efe725e",
"virtualGatewayRegion": "us-west-2"
}
}For more information, see Associate or disassociate Direct Connect virtual private gateways in the AWS Direct Connect User Guide.
Options
--add-allowed-prefixes-to-direct-connect-gatewayThe Amazon VPC prefixes to advertise to the Direct Connect gateway This parameter is required when you create an association to a transit gateway.--direct-connect-gateway-idThe ID of the Direct Connect gateway.--gateway-idThe ID of the virtual private gateway or transit gateway.--virtual-gateway-idThe ID of the virtual private gateway.