route_servers
Creates, updates, deletes or gets a route_server resource or lists route_servers in a region
Overview
| Name | route_servers |
| Type | Resource |
| Description | VPC Route Server |
| Id | awscc.ec2.route_servers |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
amazon_side_asn | integer | The Amazon-side ASN of the Route Server. |
arn | string | The Amazon Resource Name (ARN) of the Route Server. |
id | string | The ID of the Route Server. |
persist_routes | string | Whether to enable persistent routes |
persist_routes_duration | integer | The duration of persistent routes in minutes |
sns_notifications_enabled | boolean | Whether to enable SNS notifications |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the Route Server. |
region | string | AWS region. |
For more information, see AWS::EC2::RouteServer.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | route_servers | INSERT | AmazonSideAsn, region |
delete_resource | route_servers | DELETE | Identifier, region |
update_resource | route_servers | UPDATE | Identifier, PatchDocument, region |
list_resources | route_servers_list_only | SELECT | region |
get_resource | route_servers | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual route_server.
SELECT
region,
amazon_side_asn,
arn,
id,
persist_routes,
persist_routes_duration,
sns_notifications_enabled,
tags
FROM awscc.ec2.route_servers
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';
Lists all route_servers in a region.
SELECT
region,
id
FROM awscc.ec2.route_servers_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new route_server resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ec2.route_servers (
AmazonSideAsn,
region
)
SELECT
'{{ amazon_side_asn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.ec2.route_servers (
AmazonSideAsn,
PersistRoutes,
PersistRoutesDuration,
SnsNotificationsEnabled,
Tags,
region
)
SELECT
'{{ amazon_side_asn }}',
'{{ persist_routes }}',
'{{ persist_routes_duration }}',
'{{ sns_notifications_enabled }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: route_server
props:
- name: amazon_side_asn
value: '{{ amazon_side_asn }}'
- name: persist_routes
value: '{{ persist_routes }}'
- name: persist_routes_duration
value: '{{ persist_routes_duration }}'
- name: sns_notifications_enabled
value: '{{ sns_notifications_enabled }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a route_server resource, using stack-deploy.
/*+ update */
UPDATE awscc.ec2.route_servers
SET PatchDocument = string('{{ {
"PersistRoutes": persist_routes,
"PersistRoutesDuration": persist_routes_duration,
"SnsNotificationsEnabled": sns_notifications_enabled,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.route_servers
WHERE
Identifier = '{{ id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the route_servers resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
ec2:CreateRouteServer,
ec2:CreateTags,
ec2:DescribeRouteServers,
sns:CreateTopic
ec2:DescribeRouteServers,
ec2:DescribeTags
ec2:CreateTags,
ec2:DeleteTags,
ec2:DescribeRouteServers,
ec2:DescribeTags,
ec2:ModifyRouteServer,
sns:CreateTopic,
sns:DeleteTopic
ec2:DescribeTags,
ec2:DescribeRouteServers,
ec2:DeleteRouteServer,
ec2:DeleteTags,
sns:DeleteTopic
ec2:DescribeTags,
ec2:DescribeRouteServers