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*.
Idaws.ec2.route_tables

Fields

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

Methods

NameAccessible byRequired Params
create_resourceINSERTVpcId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all route_tables in a region.

SELECT
region,
route_table_id,
tags,
vpc_id
FROM aws.ec2.route_tables
WHERE region = 'us-east-1';

Gets all properties from an individual route_table.

SELECT
region,
route_table_id,
tags,
vpc_id
FROM aws.ec2.route_tables
WHERE region = 'us-east-1' AND data__Identifier = '<RouteTableId>';

INSERT example

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

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

DELETE example

/*+ delete */
DELETE FROM aws.ec2.route_tables
WHERE data__Identifier = '<RouteTableId>'
AND region = 'us-east-1';

Permissions

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

Create

ec2:CreateRouteTable,
ec2:CreateTags,
ec2:DescribeRouteTables

Read

ec2:DescribeRouteTables

Update

ec2:CreateTags,
ec2:DeleteTags,
ec2:DescribeRouteTables

Delete

ec2:DescribeRouteTables,
ec2:DeleteRouteTable

List

ec2:DescribeRouteTables