Skip to main content

local_gateway_routes

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

Overview

Namelocal_gateway_routes
TypeResource
Idaws.ec2.local_gateway_routes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
coip_pool_idstringThe ID of the customer-owned address pool.
destination_cidr_blockstringThe CIDR block used for destination matches.
destination_prefix_list_idstringThe ID of the prefix list.
local_gateway_route_table_arnstringThe Amazon Resource Name (ARN) of the local gateway route table.
local_gateway_route_table_idstringThe ID of the local gateway route table.
local_gateway_virtual_interface_group_idstringThe ID of the virtual interface group.
network_interface_idstringThe ID of the network interface.
owner_idstringThe ID of the Amazon Web Services account that owns the local gateway route.
statestringThe state of the route.
subnet_idstringThe ID of the subnet.
typestringThe route type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
search_local_gateway_routesselectLocalGatewayRouteTableId, regionFilter, MaxResults, NextToken, DryRunSearches for routes in the specified local gateway route table.
create_local_gateway_routeinsertLocalGatewayRouteTableId, regionDestinationCidrBlock, LocalGatewayVirtualInterfaceGroupId, DryRun, NetworkInterfaceId, DestinationPrefixListIdCreates a static route for the specified local gateway route table. You must specify one of the following targets: LocalGatewayVirtualInterfaceGroupId NetworkInterfaceId
modify_local_gateway_routeupdateLocalGatewayRouteTableId, regionDestinationCidrBlock, LocalGatewayVirtualInterfaceGroupId, NetworkInterfaceId, DryRun, DestinationPrefixListIdModifies the specified local gateway route.
delete_local_gateway_routedeleteLocalGatewayRouteTableId, regionDestinationCidrBlock, DryRun, DestinationPrefixListIdDeletes the specified route from the specified local gateway route table.

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
LocalGatewayRouteTableIdstringThe ID of the local gateway route table.
regionstringAWS region (default: us-east-1)
DestinationCidrBlockstringThe CIDR range for the route. This must match the CIDR for the route exactly.
DestinationPrefixListIdstringUse a prefix list in place of DestinationCidrBlock. You cannot use DestinationPrefixListId and DestinationCidrBlock in the same request.
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. prefix-list-id - The ID of the prefix list. route-search.exact-match - The exact match of the specified filter. route-search.longest-prefix-match - The longest prefix that matches the route. route-search.subnet-of-match - The routes with a subnet that match the specified CIDR filter. route-search.supernet-of-match - The routes with a CIDR that encompass the CIDR filter. For example, if you have 10.0.1.0/29 and 10.0.1.0/31 routes in your route table and you specify supernet-of-match as 10.0.1.0/30, then the result returns 10.0.1.0/29. state - The state of the route. type - The route type.
LocalGatewayVirtualInterfaceGroupIdstringThe ID of the virtual interface group.
MaxResultsintegerThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
NetworkInterfaceIdstringThe ID of the network interface.
NextTokenstringThe token for the next page of results.

SELECT examples

Searches for routes in the specified local gateway route table.

SELECT
coip_pool_id,
destination_cidr_block,
destination_prefix_list_id,
local_gateway_route_table_arn,
local_gateway_route_table_id,
local_gateway_virtual_interface_group_id,
network_interface_id,
owner_id,
state,
subnet_id,
type
FROM aws.ec2.local_gateway_routes
WHERE LocalGatewayRouteTableId = '{{ LocalGatewayRouteTableId }}' -- required
AND region = '{{ region }}' -- required
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND DryRun = '{{ DryRun }}'
;

INSERT examples

Creates a static route for the specified local gateway route table. You must specify one of the following targets: LocalGatewayVirtualInterfaceGroupId NetworkInterfaceId

INSERT INTO aws.ec2.local_gateway_routes (
LocalGatewayRouteTableId,
region,
DestinationCidrBlock,
LocalGatewayVirtualInterfaceGroupId,
DryRun,
NetworkInterfaceId,
DestinationPrefixListId
)
SELECT
'{{ LocalGatewayRouteTableId }}',
'{{ region }}',
'{{ DestinationCidrBlock }}',
'{{ LocalGatewayVirtualInterfaceGroupId }}',
'{{ DryRun }}',
'{{ NetworkInterfaceId }}',
'{{ DestinationPrefixListId }}'
RETURNING
coip_pool_id,
destination_cidr_block,
destination_prefix_list_id,
local_gateway_route_table_arn,
local_gateway_route_table_id,
local_gateway_virtual_interface_group_id,
network_interface_id,
owner_id,
state,
subnet_id,
type
;

UPDATE examples

Modifies the specified local gateway route.

UPDATE aws.ec2.local_gateway_routes
SET
-- No updatable properties
WHERE
LocalGatewayRouteTableId = '{{ LocalGatewayRouteTableId }}' --required
AND region = '{{ region }}' --required
AND DestinationCidrBlock = '{{ DestinationCidrBlock}}'
AND LocalGatewayVirtualInterfaceGroupId = '{{ LocalGatewayVirtualInterfaceGroupId}}'
AND NetworkInterfaceId = '{{ NetworkInterfaceId}}'
AND DryRun = {{ DryRun}}
AND DestinationPrefixListId = '{{ DestinationPrefixListId}}'
RETURNING
coip_pool_id,
destination_cidr_block,
destination_prefix_list_id,
local_gateway_route_table_arn,
local_gateway_route_table_id,
local_gateway_virtual_interface_group_id,
network_interface_id,
owner_id,
state,
subnet_id,
type;

DELETE examples

Deletes the specified route from the specified local gateway route table.

DELETE FROM aws.ec2.local_gateway_routes
WHERE LocalGatewayRouteTableId = '{{ LocalGatewayRouteTableId }}' --required
AND region = '{{ region }}' --required
AND DestinationCidrBlock = '{{ DestinationCidrBlock }}'
AND DryRun = '{{ DryRun }}'
AND DestinationPrefixListId = '{{ DestinationPrefixListId }}'
;