Subchapter 90.2
references/connecting-many-vpcs-through-a-direct-connect-gateway.mdMarkdown11 KBView on GitHub
Domain expertise for reaching many VPCs over a single Direct Connect connection through a Direct Connect gateway. Covers the virtual private gateway path versus the transit gateway path, the per-gateway association limits that customers hit with a cryptic error, the allowed prefixes list a transit gateway association needs, the unique Autonomous System Number requirement, and the cross-account proposal-and-acceptance handshake that trips up multi-account customers.
Does not cover creating the connection, the virtual interface and BGP details (a separate reference), encryption, or the virtual-private-gateway-to-transit-gateway migration (its own reference). Those are separate references.
Execute commands using the AWS MCP server when connected (sandboxed execution, audit logging,
observability). Fall back to the AWS CLI otherwise. The Direct Connect console is regional; pass the
customer’s working --region. A Direct Connect gateway is a global resource reached through a
regional view.
| Path | Virtual interface | Use when |
|---|---|---|
| Virtual private gateway | Private virtual interface | A single VPC, or a small fixed set, reached through the Direct Connect gateway |
| Transit gateway | Transit virtual interface | Many VPCs, hub-and-spoke, multiple accounts, or multiple Regions |
Constraints:
Customers hit these, get a cryptic error, and do not know they need an increase or a second gateway.
| Limit | Value | Increasable |
|---|---|---|
| Virtual private gateways per Direct Connect gateway | 20 | No |
| Transit gateways per Direct Connect gateway | 6 | No |
Constraints:
Constraints:
Associating a Direct Connect gateway to a transit gateway in another account is a two-account handshake, not a single call. This is one of the most common multi-account Direct Connect escalations.
Constraints:
Constraints:
The allowed prefixes list on the Direct Connect gateway is empty. Add the prefixes.
The transit gateway ASN and the Direct Connect gateway ASN are identical. Change one.
The per-gateway association limit (20 virtual private gateways or 6 transit gateways) is reached. Split across gateways.
It requires the proposal-and-acceptance handshake. The transit gateway owner proposes; the Direct Connect gateway owner accepts.
This procedure picks the association path, checks the gateway’s existing associations and the per-gateway limit, creates the association with allowed prefixes (running the cross-account handshake when accounts differ), and surfaces the console link.
vgw or tgw, with the gateway ID.Constraints for parameter acquisition:
Constraints:
You MUST confirm credentials with aws sts get-caller-identity.
You MUST use ephemeral IAM credentials (e.g., AWS SSO, an instance profile, or aws sts assume-role)
rather than long-lived IAM user access keys for Direct Connect management operations.
You MUST check the Direct Connect gateway’s existing associations and confirm the count is below the per-gateway limit:
aws directconnect describe-direct-connect-gateway-associations \
--direct-connect-gateway-id {direct_connect_gateway_id} --region {region}Constraints:
For a transit gateway in the same account, you MUST set distinct ASNs and provide the allowed prefixes:
aws directconnect create-direct-connect-gateway-association \
--direct-connect-gateway-id {direct_connect_gateway_id} --gateway-id {tgw_id} \
--add-allowed-prefixes-to-direct-connect-gateway cidr={prefix} --region {region}You SHOULD remind the customer that traffic over the Direct Connect gateway association is not encrypted in transit by default, and point them to the encrypting-traffic reference if the workload requires encryption.
Constraints:
The transit gateway owner MUST create the proposal:
aws directconnect create-direct-connect-gateway-association-proposal \
--direct-connect-gateway-id {direct_connect_gateway_id} \
--direct-connect-gateway-owner-account {dx_gw_owner} --gateway-id {tgw_id} \
--add-allowed-prefixes-to-direct-connect-gateway cidr={prefix} --region {region}The Direct Connect gateway owner MUST accept it (and may override prefixes):
aws directconnect accept-direct-connect-gateway-association-proposal \
--direct-connect-gateway-id {direct_connect_gateway_id} --proposal-id {proposal_id} \
--associated-gateway-owner-account {tgw_owner} --region {region}Constraints:
You MUST confirm the association reaches associated state by polling:
aws directconnect describe-direct-connect-gateway-associations \
--direct-connect-gateway-id {direct_connect_gateway_id} \
--query "directConnectGatewayAssociations[?associatedGateway.id=='{tgw_id}'].associationState" \
--output text --region {region}Poll until state reports associated.
You MUST present the Direct Connect gateway console link, filling {direct_connect_gateway_id} and {region}:
https://console.aws.amazon.com/directconnect/v2/home?region={region}#/dxgateways/{direct_connect_gateway_id}You SHOULD recommend CloudWatch alarms on the gateway association state, and confirm CloudTrail is
capturing directconnect API calls with log file validation enabled and the trail encrypted with a
KMS key, and any CloudWatch Logs log groups receiving these events or alarm state data encrypted with
a KMS key, so state changes trigger alerts and configuration changes are audited with assured log
integrity and confidentiality rather than relying on manual detection.
You SHOULD ensure any SNS topics receiving Direct Connect alarm notifications are encrypted with a KMS key and that subscriptions are restricted to authorized operations personnel, so sensitive gateway association state data does not reach unintended recipients.
aws sts assume-role) for Direct Connect management operations rather than long-lived
IAM user access keys.directconnect API actions to the
specific actions and resource ARNs each principal needs, and MUST NOT grant directconnect:* on
resource * or attach any *FullAccess managed policy.