client_vpn_routes
Creates, updates, deletes, gets or lists a client_vpn_routes resource.
Overview
| Name | client_vpn_routes |
| Type | Resource |
| Id | aws.ec2.client_vpn_routes |
Fields
The following fields are returned by SELECT queries:
- describe_client_vpn_routes
| Name | Datatype | Description |
|---|---|---|
client_vpn_endpoint_id | string | The ID of the Client VPN endpoint with which the route is associated. |
description | string | A brief description of the route. |
destination_cidr | string | The IPv4 address range, in CIDR notation, of the route destination. |
origin | string | Indicates 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. |
status | string | The current state of the route. |
target_subnet | string | The ID of the subnet through which traffic is routed. |
transit_gateway_attachment_id | string | The ID of the Transit Gateway attachment, if the route targets a Transit Gateway. |
type | string | The route type. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_client_vpn_routes | select | ClientVpnEndpointId, region | Filter, MaxResults, NextToken, DryRun | Describes the routes for the specified Client VPN endpoint. |
create_client_vpn_route | insert | ClientVpnEndpointId, DestinationCidrBlock, region | TargetVpcSubnetId, Description, ClientToken, DryRun | 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. |
delete_client_vpn_route | delete | ClientVpnEndpointId, DestinationCidrBlock, region | TargetVpcSubnetId, DryRun | 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. |
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 |
|---|---|---|
ClientVpnEndpointId | string | The ID of the Client VPN endpoint from which the route is to be deleted. |
DestinationCidrBlock | string | The IPv4 address range, in CIDR notation, of the route to be deleted. |
region | string | AWS region (default: us-east-1) |
ClientToken | string | Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency. |
Description | string | A brief description of the route. |
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. 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. |
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. |
TargetVpcSubnetId | string | The ID of the target subnet used by the route. |
SELECT examples
- describe_client_vpn_routes
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
- create_client_vpn_route
- Manifest
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
;
# Description fields are for documentation purposes
- name: client_vpn_routes
props:
- name: ClientVpnEndpointId
value: "{{ ClientVpnEndpointId }}"
description: Required parameter for the client_vpn_routes resource.
- name: DestinationCidrBlock
value: "{{ DestinationCidrBlock }}"
description: Required parameter for the client_vpn_routes resource.
- name: region
value: "{{ region }}"
description: Required parameter for the client_vpn_routes resource.
- name: TargetVpcSubnetId
value: "{{ TargetVpcSubnetId }}"
description: The ID of the subnet through which you want to route traffic. The specified subnet must be an existing target network of the Client VPN endpoint. Alternatively, if you're adding a route for the local network, specify local. This parameter is required for VPC-based Client VPN endpoints. For Transit Gateway-based endpoints, this parameter is not required.
description: The ID of the subnet through which you want to route traffic. The specified subnet must be an existing target network of the Client VPN endpoint. Alternatively, if you're adding a route for the local network, specify local. This parameter is required for VPC-based Client VPN endpoints. For Transit Gateway-based endpoints, this parameter is not required.
- name: Description
value: "{{ Description }}"
description: A brief description of the route.
description: A brief description of the route.
- name: ClientToken
value: "{{ ClientToken }}"
description: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.
description: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.
- name: DryRun
value: {{ DryRun }}
description: 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.
description: 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.
DELETE examples
- delete_client_vpn_route
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 }}'
;