client_vpn_target_networks
Creates, updates, deletes, gets or lists a client_vpn_target_networks resource.
Overview
| Name | client_vpn_target_networks |
| Type | Resource |
| Id | aws.ec2.client_vpn_target_networks |
Fields
The following fields are returned by SELECT queries:
- describe_client_vpn_target_networks
| Name | Datatype | Description |
|---|---|---|
association_id | string | The ID of the association. |
availability_zone_ids | string | The Availability Zone IDs for the target network association, if the Client VPN endpoint uses a Transit Gateway. |
availability_zones | string | The Availability Zone names for the target network association, if the Client VPN endpoint uses a Transit Gateway. |
client_vpn_endpoint_id | string | The ID of the Client VPN endpoint with which the target network is associated. |
security_groups | string | The IDs of the security groups applied to the target network association. |
status | string | The current state of the target network association. |
target_network_id | string | The ID of the subnet specified as the target network. |
vpc_id | string | The ID of the VPC in which the target network (subnet) is located. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_client_vpn_target_networks | select | ClientVpnEndpointId, region | AssociationIds, MaxResults, NextToken, Filter, DryRun | Describes the target networks associated with the specified Client VPN endpoint. |
disassociate_client_vpn_target_network | update | ClientVpnEndpointId, AssociationId, region | DryRun | Disassociates a target network from the specified Client VPN endpoint. When you disassociate the last target network from a Client VPN, the following happens: The route that was automatically added for the VPC is deleted All active client connections are terminated New client connections are disallowed The Client VPN endpoint's status changes to pending-associate |
associate_client_vpn_target_network | update | ClientVpnEndpointId, region | SubnetId, ClientToken, DryRun, AvailabilityZone, AvailabilityZoneId | Associates a target network with a Client VPN endpoint. A target network is a subnet in a VPC. You can associate multiple subnets from the same VPC with a Client VPN endpoint. You can associate only one subnet in each Availability Zone. We recommend that you associate at least two subnets to provide Availability Zone redundancy. If you specified a VPC when you created the Client VPN endpoint or if you have previous subnet associations, the specified subnet must be in the same VPC. To specify a subnet that's in a different VPC, you must first modify the Client VPN endpoint (ModifyClientVpnEndpoint) and change the VPC that's associated with it. |
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 |
|---|---|---|
AssociationId | string | The ID of the target network association. |
ClientVpnEndpointId | string | The ID of the Client VPN endpoint. |
region | string | AWS region (default: us-east-1) |
AssociationIds | array | The IDs of the target network associations. |
AvailabilityZone | string | The Availability Zone name for the Transit Gateway association. Required if when associating an Availability Zone with a Client VPN endpoint that uses a Transit Gateway. You cannot specify both SubnetId and AvailabilityZone. |
AvailabilityZoneId | string | The Availability Zone ID for the Transit Gateway association. Required if when associating an Availability Zone with a Client VPN endpoint that uses a Transit Gateway. You cannot specify both AvailabilityZone and AvailabilityZoneId. |
ClientToken | string | Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency. |
DryRun | boolean | Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. |
Filter | array | One or more filters. Filter names and values are case-sensitive. association-id - The ID of the association. target-network-id - The ID of the subnet specified as the target network. vpc-id - The ID of the VPC in which the target network is located. |
MaxResults | integer | The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the nextToken value. |
NextToken | string | The token to retrieve the next page of results. |
SubnetId | string | The ID of the subnet to associate with the Client VPN endpoint. Required for VPC-based endpoints. For Transit Gateway-based endpoints, use AvailabilityZone or AvailabilityZoneId instead. |
SELECT examples
- describe_client_vpn_target_networks
Describes the target networks associated with the specified Client VPN endpoint.
SELECT
association_id,
availability_zone_ids,
availability_zones,
client_vpn_endpoint_id,
security_groups,
status,
target_network_id,
vpc_id
FROM aws.ec2.client_vpn_target_networks
WHERE ClientVpnEndpointId = '{{ ClientVpnEndpointId }}' -- required
AND region = '{{ region }}' -- required
AND AssociationIds = '{{ AssociationIds }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND Filter = '{{ Filter }}'
AND DryRun = '{{ DryRun }}'
;
UPDATE examples
- disassociate_client_vpn_target_network
- associate_client_vpn_target_network
Disassociates a target network from the specified Client VPN endpoint. When you disassociate the last target network from a Client VPN, the following happens: The route that was automatically added for the VPC is deleted All active client connections are terminated New client connections are disallowed The Client VPN endpoint's status changes to pending-associate
UPDATE aws.ec2.client_vpn_target_networks
SET
-- No updatable properties
WHERE
ClientVpnEndpointId = '{{ ClientVpnEndpointId }}' --required
AND AssociationId = '{{ AssociationId }}' --required
AND region = '{{ region }}' --required
AND DryRun = {{ DryRun}}
RETURNING
association_id,
status;
Associates a target network with a Client VPN endpoint. A target network is a subnet in a VPC. You can associate multiple subnets from the same VPC with a Client VPN endpoint. You can associate only one subnet in each Availability Zone. We recommend that you associate at least two subnets to provide Availability Zone redundancy. If you specified a VPC when you created the Client VPN endpoint or if you have previous subnet associations, the specified subnet must be in the same VPC. To specify a subnet that's in a different VPC, you must first modify the Client VPN endpoint (ModifyClientVpnEndpoint) and change the VPC that's associated with it.
UPDATE aws.ec2.client_vpn_target_networks
SET
-- No updatable properties
WHERE
ClientVpnEndpointId = '{{ ClientVpnEndpointId }}' --required
AND region = '{{ region }}' --required
AND SubnetId = '{{ SubnetId}}'
AND ClientToken = '{{ ClientToken}}'
AND DryRun = {{ DryRun}}
AND AvailabilityZone = '{{ AvailabilityZone}}'
AND AvailabilityZoneId = '{{ AvailabilityZoneId}}'
RETURNING
association_id,
status;