Skip to main content

client_vpn_routes

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

Overview

Nameclient_vpn_routes
TypeResource
Idaws.ec2.client_vpn_routes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
client_vpn_endpoint_idstringThe ID of the Client VPN endpoint with which the route is associated.
descriptionstringA brief description of the route.
destination_cidrstringThe IPv4 address range, in CIDR notation, of the route destination.
originstringIndicates how the route was associated with the Client VPN endpoint. associate indicates that the route was automatically added when the target network was associated with the Client VPN endpoint. add-route indicates that the route was manually added using the CreateClientVpnRoute action.
statusstringThe current state of the route.
target_subnetstringThe ID of the subnet through which traffic is routed.
transit_gateway_attachment_idstringThe ID of the Transit Gateway attachment, if the route targets a Transit Gateway.
typestringThe route type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_client_vpn_routesselectClientVpnEndpointId, regionFilter, MaxResults, NextToken, DryRunDescribes the routes for the specified Client VPN endpoint.
create_client_vpn_routeinsertClientVpnEndpointId, DestinationCidrBlock, regionTargetVpcSubnetId, Description, ClientToken, DryRunAdds a route to a network to a Client VPN endpoint. Each Client VPN endpoint has a route table that describes the available destination network routes. Each route in the route table specifies the path for traffic to specific resources or networks.
delete_client_vpn_routedeleteClientVpnEndpointId, DestinationCidrBlock, regionTargetVpcSubnetId, DryRunDeletes a route from a Client VPN endpoint. You can only delete routes that you manually added using the CreateClientVpnRoute action. You cannot delete routes that were automatically added when associating a subnet. To remove routes that have been automatically added, disassociate the target subnet from the Client VPN endpoint.

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
ClientVpnEndpointIdstringThe ID of the Client VPN endpoint from which the route is to be deleted.
DestinationCidrBlockstringThe IPv4 address range, in CIDR notation, of the route to be deleted.
regionstringAWS region (default: us-east-1)
ClientTokenstringUnique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.
DescriptionstringA brief description of the route.
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. destination-cidr - The CIDR of the route destination. origin - How the route was associated with the Client VPN endpoint (associate | add-route). target-subnet - The ID of the subnet through which traffic is routed.
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.
TargetVpcSubnetIdstringThe ID of the target subnet used by the route.

SELECT examples

Describes the routes for the specified Client VPN endpoint.

SELECT
client_vpn_endpoint_id,
description,
destination_cidr,
origin,
status,
target_subnet,
transit_gateway_attachment_id,
type
FROM aws.ec2.client_vpn_routes
WHERE ClientVpnEndpointId = '{{ ClientVpnEndpointId }}' -- required
AND region = '{{ region }}' -- required
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND DryRun = '{{ DryRun }}'
;

INSERT examples

Adds a route to a network to a Client VPN endpoint. Each Client VPN endpoint has a route table that describes the available destination network routes. Each route in the route table specifies the path for traffic to specific resources or networks.

INSERT INTO aws.ec2.client_vpn_routes (
ClientVpnEndpointId,
DestinationCidrBlock,
region,
TargetVpcSubnetId,
Description,
ClientToken,
DryRun
)
SELECT
'{{ ClientVpnEndpointId }}',
'{{ DestinationCidrBlock }}',
'{{ region }}',
'{{ TargetVpcSubnetId }}',
'{{ Description }}',
'{{ ClientToken }}',
'{{ DryRun }}'
RETURNING
code,
message
;

DELETE examples

Deletes a route from a Client VPN endpoint. You can only delete routes that you manually added using the CreateClientVpnRoute action. You cannot delete routes that were automatically added when associating a subnet. To remove routes that have been automatically added, disassociate the target subnet from the Client VPN endpoint.

DELETE FROM aws.ec2.client_vpn_routes
WHERE ClientVpnEndpointId = '{{ ClientVpnEndpointId }}' --required
AND DestinationCidrBlock = '{{ DestinationCidrBlock }}' --required
AND region = '{{ region }}' --required
AND TargetVpcSubnetId = '{{ TargetVpcSubnetId }}'
AND DryRun = '{{ DryRun }}'
;