Skip to main content

route_tables

Creates, updates, deletes or gets a route_table resource or lists route_tables in a region

Overview

Nameroute_tables
TypeResource
DescriptionSpecifies a route table for the specified VPC. After you create a route table, you can add routes and associate the table with a subnet.
For more information, see [Route tables](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html) in the *Amazon VPC User Guide*.
Idawscc.ec2.route_tables

Fields

NameDatatypeDescription
route_table_idstring
vpc_idstringThe ID of the VPC.
tagsarrayAny tags assigned to the route table.
regionstringAWS region.

For more information, see AWS::EC2::RouteTable.

Methods

NameResourceAccessible byRequired Params
create_resourceroute_tablesINSERTVpcId, region
delete_resourceroute_tablesDELETEIdentifier, region
update_resourceroute_tablesUPDATEIdentifier, PatchDocument, region
list_resourcesroute_tables_list_onlySELECTregion
get_resourceroute_tablesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual route_table.

SELECT
region,
route_table_id,
vpc_id,
tags
FROM awscc.ec2.route_tables
WHERE
region = 'us-east-1' AND
Identifier = '{{ route_table_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new route_table resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.ec2.route_tables (
VpcId,
region
)
SELECT
'{{ vpc_id }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a route_table resource, using stack-deploy.

/*+ update */
UPDATE awscc.ec2.route_tables
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ route_table_id }}';

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.route_tables
WHERE
Identifier = '{{ route_table_id }}' AND
region = 'us-east-1';

Permissions

To operate on the route_tables resource, the following permissions are required:

ec2:DescribeRouteTables