direct_connect_gateway_associations
Creates, updates, deletes, gets or lists a direct_connect_gateway_associations resource.
Overview
| Name | direct_connect_gateway_associations |
| Type | Resource |
| Id | aws.directconnect.direct_connect_gateway_associations |
Fields
The following fields are returned by SELECT queries:
- describe_direct_connect_gateway_associations
| Name | Datatype | Description |
|---|---|---|
allowed_prefixes_to_direct_connect_gateway | array | The Amazon VPC prefixes to advertise to the Direct Connect gateway. |
associated_core_network | object | The ID of the Cloud WAN core network associated with the Direct Connect gateway attachment. |
associated_gateway | object | Information about the associated gateway. |
association_id | string | The ID of the Direct Connect gateway association. |
association_state | string | The 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_id | string | The ID of the Direct Connect gateway. |
direct_connect_gateway_owner_account | string | The ID of the Amazon Web Services account that owns the associated gateway. |
state_change_error | string | The error message if the state of an object failed to advance. |
virtual_gateway_id | string | The ID of the virtual private gateway. Applies only to private virtual interfaces. |
virtual_gateway_owner_account | string | The ID of the Amazon Web Services account that owns the virtual private gateway. |
virtual_gateway_region | string | The Amazon Web Services Region where the virtual private gateway is located. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_direct_connect_gateway_associations | select | region | 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. | |
create_direct_connect_gateway_association | insert | region, directConnectGatewayId | 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. | |
update_direct_connect_gateway_association | update | region | Updates the specified attributes of the Direct Connect gateway association. Add or remove prefixes from the association. | |
delete_direct_connect_gateway_association | delete | region | 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. | |
accept_direct_connect_gateway_association_proposal | exec | region, directConnectGatewayId, proposalId, associatedGatewayOwnerAccount | Accepts 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_direct_connect_gateway_associations
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
- create_direct_connect_gateway_association
- Manifest
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
;
# Description fields are for documentation purposes
- name: direct_connect_gateway_associations
props:
- name: region
value: "{{ region }}"
description: Required parameter for the direct_connect_gateway_associations resource.
- name: directConnectGatewayId
value: "{{ directConnectGatewayId }}"
description: |
The ID of the Direct Connect gateway.
- name: gatewayId
value: "{{ gatewayId }}"
description: |
The ID of the virtual private gateway or transit gateway.
- name: addAllowedPrefixesToDirectConnectGateway
description: |
The Amazon VPC prefixes to advertise to the Direct Connect gateway This parameter is required when you create an association to a transit gateway. For information about how to set the prefixes, see Allowed Prefixes in the Direct Connect User Guide.
value:
- cidr: "{{ cidr }}"
- name: virtualGatewayId
value: "{{ virtualGatewayId }}"
description: |
The ID of the virtual private gateway.
UPDATE examples
- update_direct_connect_gateway_association
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
- delete_direct_connect_gateway_association
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
- accept_direct_connect_gateway_association_proposal
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 }}"
}'
;