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 | awscc.ec2.route_tables |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
route_table_id | string | |
vpc_id | string | The ID of the VPC. |
tags | array | Any tags assigned to the route table. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
route_table_id | string | |
region | string | AWS region. |
For more information, see AWS::EC2::RouteTable.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | route_tables | INSERT | VpcId, region |
delete_resource | route_tables | DELETE | Identifier, region |
update_resource | route_tables | UPDATE | Identifier, PatchDocument, region |
list_resources | route_tables_list_only | SELECT | region |
get_resource | route_tables | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all route_tables in a region.
SELECT
region,
route_table_id
FROM awscc.ec2.route_tables_list_only
WHERE
region = 'us-east-1';
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 awscc.ec2.route_tables (
VpcId,
region
)
SELECT
'{{ vpc_id }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.ec2.route_tables (
VpcId,
Tags,
region
)
SELECT
'{{ vpc_id }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: route_table
props:
- name: vpc_id
value: '{{ vpc_id }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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:
- Read
- Create
- Update
- List
- Delete
ec2:DescribeRouteTables
ec2:CreateRouteTable,
ec2:CreateTags,
ec2:DescribeRouteTables
ec2:CreateTags,
ec2:DeleteTags,
ec2:DescribeRouteTables
ec2:DescribeRouteTables
ec2:DescribeRouteTables,
ec2:DeleteRouteTable