route_tables
Creates, updates, deletes or gets a route_table
resource or lists route_tables
in a region
Overview
Name | route_tables |
Type | Resource |
Description | Specifies 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*. |
Id | aws.ec2.route_tables |
Fields
Name | Datatype | Description |
---|---|---|
route_table_id | string | |
tags | array | Any tags assigned to the route table. |
vpc_id | string | The ID of the VPC. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | VpcId, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ec2.route_tables (
VpcId,
region
)
SELECT
'{{ VpcId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.route_tables (
Tags,
VpcId,
region
)
SELECT
'{{ Tags }}',
'{{ VpcId }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: route_table
props:
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: VpcId
value: '{{ VpcId }}'
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