Skip to main content

direct_connect_gateway_associations

Creates, updates, deletes, gets or lists a direct_connect_gateway_associations resource.

Overview

Namedirect_connect_gateway_associations
TypeResource
Idaws.directconnect.direct_connect_gateway_associations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
allowed_prefixes_to_direct_connect_gatewayarrayThe Amazon VPC prefixes to advertise to the Direct Connect gateway.
associated_core_networkobjectThe ID of the Cloud WAN core network associated with the Direct Connect gateway attachment.
associated_gatewayobjectInformation about the associated gateway.
association_idstringThe ID of the Direct Connect gateway association.
association_statestringThe state of the association. The following are the possible values: associating: The initial state after calling CreateDirectConnectGatewayAssociation. associated: The Direct Connect gateway and virtual private gateway or transit gateway are successfully associated and ready to pass traffic. disassociating: The initial state after calling DeleteDirectConnectGatewayAssociation. disassociated: The virtual private gateway or transit gateway is disassociated from the Direct Connect gateway. Traffic flow between the Direct Connect gateway and virtual private gateway or transit gateway is stopped. updating: The CIDR blocks for the virtual private gateway or transit gateway are currently being updated. This could be new CIDR blocks added or current CIDR blocks removed. (associating, associated, disassociating, disassociated, updating)
direct_connect_gateway_idstringThe ID of the Direct Connect gateway.
direct_connect_gateway_owner_accountstringThe ID of the Amazon Web Services account that owns the associated gateway.
state_change_errorstringThe error message if the state of an object failed to advance.
virtual_gateway_idstringThe ID of the virtual private gateway. Applies only to private virtual interfaces.
virtual_gateway_owner_accountstringThe ID of the Amazon Web Services account that owns the virtual private gateway.
virtual_gateway_regionstringThe Amazon Web Services Region where the virtual private gateway is located.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_direct_connect_gateway_associationsselectregionLists the associations between your Direct Connect gateways and virtual private gateways and transit gateways. You must specify one of the following: A Direct Connect gateway The response contains all virtual private gateways and transit gateways associated with the Direct Connect gateway. A virtual private gateway The response contains the Direct Connect gateway. A transit gateway The response contains the Direct Connect gateway. A Direct Connect gateway and a virtual private gateway The response contains the association between the Direct Connect gateway and virtual private gateway. A Direct Connect gateway and a transit gateway The response contains the association between the Direct Connect gateway and transit gateway. A Direct Connect gateway and a virtual private gateway The response contains the association between the Direct Connect gateway and virtual private gateway. A Direct Connect gateway association to a Cloud WAN core network The response contains the Cloud WAN core network ID that the Direct Connect gateway is associated to.
create_direct_connect_gateway_associationinsertregion, directConnectGatewayIdCreates an association between a Direct Connect gateway and a virtual private gateway. The virtual private gateway must be attached to a VPC and must not be associated with another Direct Connect gateway.
update_direct_connect_gateway_associationupdateregionUpdates the specified attributes of the Direct Connect gateway association. Add or remove prefixes from the association.
delete_direct_connect_gateway_associationdeleteregionDeletes the association between the specified Direct Connect gateway and virtual private gateway. We recommend that you specify the associationID to delete the association. Alternatively, if you own virtual gateway and a Direct Connect gateway association, you can specify the virtualGatewayId and directConnectGatewayId to delete an association.
accept_direct_connect_gateway_association_proposalexecregion, directConnectGatewayId, proposalId, associatedGatewayOwnerAccountAccepts a proposal request to attach a virtual private gateway or transit gateway to a Direct Connect gateway.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Lists the associations between your Direct Connect gateways and virtual private gateways and transit gateways. You must specify one of the following: A Direct Connect gateway The response contains all virtual private gateways and transit gateways associated with the Direct Connect gateway. A virtual private gateway The response contains the Direct Connect gateway. A transit gateway The response contains the Direct Connect gateway. A Direct Connect gateway and a virtual private gateway The response contains the association between the Direct Connect gateway and virtual private gateway. A Direct Connect gateway and a transit gateway The response contains the association between the Direct Connect gateway and transit gateway. A Direct Connect gateway and a virtual private gateway The response contains the association between the Direct Connect gateway and virtual private gateway. A Direct Connect gateway association to a Cloud WAN core network The response contains the Cloud WAN core network ID that the Direct Connect gateway is associated to.

SELECT
allowed_prefixes_to_direct_connect_gateway,
associated_core_network,
associated_gateway,
association_id,
association_state,
direct_connect_gateway_id,
direct_connect_gateway_owner_account,
state_change_error,
virtual_gateway_id,
virtual_gateway_owner_account,
virtual_gateway_region
FROM aws.directconnect.direct_connect_gateway_associations
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates an association between a Direct Connect gateway and a virtual private gateway. The virtual private gateway must be attached to a VPC and must not be associated with another Direct Connect gateway.

INSERT INTO aws.directconnect.direct_connect_gateway_associations (
directConnectGatewayId,
gatewayId,
addAllowedPrefixesToDirectConnectGateway,
virtualGatewayId,
region
)
SELECT
'{{ directConnectGatewayId }}' /* required */,
'{{ gatewayId }}',
'{{ addAllowedPrefixesToDirectConnectGateway }}',
'{{ virtualGatewayId }}',
'{{ region }}'
RETURNING
direct_connect_gateway_association
;

UPDATE examples

Updates the specified attributes of the Direct Connect gateway association. Add or remove prefixes from the association.

UPDATE aws.directconnect.direct_connect_gateway_associations
SET
associationId = '{{ associationId }}',
addAllowedPrefixesToDirectConnectGateway = '{{ addAllowedPrefixesToDirectConnectGateway }}',
removeAllowedPrefixesToDirectConnectGateway = '{{ removeAllowedPrefixesToDirectConnectGateway }}'
WHERE
region = '{{ region }}' --required
RETURNING
direct_connect_gateway_association;

DELETE examples

Deletes the association between the specified Direct Connect gateway and virtual private gateway. We recommend that you specify the associationID to delete the association. Alternatively, if you own virtual gateway and a Direct Connect gateway association, you can specify the virtualGatewayId and directConnectGatewayId to delete an association.

DELETE FROM aws.directconnect.direct_connect_gateway_associations
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Accepts a proposal request to attach a virtual private gateway or transit gateway to a Direct Connect gateway.

EXEC aws.directconnect.direct_connect_gateway_associations.accept_direct_connect_gateway_association_proposal
@region='{{ region }}' --required
@@json=
'{
"directConnectGatewayId": "{{ directConnectGatewayId }}",
"proposalId": "{{ proposalId }}",
"associatedGatewayOwnerAccount": "{{ associatedGatewayOwnerAccount }}",
"overrideAllowedPrefixesToDirectConnectGateway": "{{ overrideAllowedPrefixesToDirectConnectGateway }}"
}'
;