Skip to main content

client_vpn_target_networks

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

Overview

Nameclient_vpn_target_networks
TypeResource
Idaws.ec2.client_vpn_target_networks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
association_idstringThe ID of the association.
availability_zone_idsstringThe Availability Zone IDs for the target network association, if the Client VPN endpoint uses a Transit Gateway.
availability_zonesstringThe Availability Zone names for the target network association, if the Client VPN endpoint uses a Transit Gateway.
client_vpn_endpoint_idstringThe ID of the Client VPN endpoint with which the target network is associated.
security_groupsstringThe IDs of the security groups applied to the target network association.
statusstringThe current state of the target network association.
target_network_idstringThe ID of the subnet specified as the target network.
vpc_idstringThe ID of the VPC in which the target network (subnet) is located.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_client_vpn_target_networksselectClientVpnEndpointId, regionAssociationIds, MaxResults, NextToken, Filter, DryRunDescribes the target networks associated with the specified Client VPN endpoint.
disassociate_client_vpn_target_networkupdateClientVpnEndpointId, AssociationId, regionDryRunDisassociates 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_networkupdateClientVpnEndpointId, regionSubnetId, ClientToken, DryRun, AvailabilityZone, AvailabilityZoneIdAssociates 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.

NameDatatypeDescription
AssociationIdstringThe ID of the target network association.
ClientVpnEndpointIdstringThe ID of the Client VPN endpoint.
regionstringAWS region (default: us-east-1)
AssociationIdsarrayThe IDs of the target network associations.
AvailabilityZonestringThe 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.
AvailabilityZoneIdstringThe 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.
ClientTokenstringUnique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.
DryRunbooleanChecks 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.
FilterarrayOne 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.
MaxResultsintegerThe 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.
NextTokenstringThe token to retrieve the next page of results.
SubnetIdstringThe 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

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

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;