routing_rules
Creates, updates, deletes or gets a routing_rule resource or lists routing_rules in a region
Overview
| Name | routing_rules |
| Type | Resource |
| Description | Schema for AWS::ApiGatewayV2::RoutingRule |
| Id | awscc.apigatewayv2.routing_rules |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
routing_rule_id | string | RoutingRule Id generated by service |
routing_rule_arn | string | Amazon Resource Name (ARN) of the resource. |
domain_name_arn | string | The amazon resource name (ARN) of the domain name resource. |
priority | integer | |
conditions | array | |
actions | array | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
routing_rule_arn | string | Amazon Resource Name (ARN) of the resource. |
region | string | AWS region. |
For more information, see AWS::ApiGatewayV2::RoutingRule.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | routing_rules | INSERT | DomainNameArn, Priority, Conditions, Actions, region |
delete_resource | routing_rules | DELETE | Identifier, region |
update_resource | routing_rules | UPDATE | Identifier, PatchDocument, region |
list_resources | routing_rules_list_only | SELECT | region |
get_resource | routing_rules | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual routing_rule.
SELECT
region,
routing_rule_id,
routing_rule_arn,
domain_name_arn,
priority,
conditions,
actions
FROM awscc.apigatewayv2.routing_rules
WHERE
region = 'us-east-1' AND
Identifier = '{{ routing_rule_arn }}';
Lists all routing_rules in a region.
SELECT
region,
routing_rule_arn
FROM awscc.apigatewayv2.routing_rules_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new routing_rule resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.apigatewayv2.routing_rules (
DomainNameArn,
Priority,
Conditions,
Actions,
region
)
SELECT
'{{ domain_name_arn }}',
'{{ priority }}',
'{{ conditions }}',
'{{ actions }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.apigatewayv2.routing_rules (
DomainNameArn,
Priority,
Conditions,
Actions,
region
)
SELECT
'{{ domain_name_arn }}',
'{{ priority }}',
'{{ conditions }}',
'{{ actions }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: routing_rule
props:
- name: domain_name_arn
value: '{{ domain_name_arn }}'
- name: priority
value: '{{ priority }}'
- name: conditions
value:
- match_headers:
any_of:
- header: '{{ header }}'
value_glob: '{{ value_glob }}'
match_base_paths:
any_of:
- '{{ any_of[0] }}'
- name: actions
value:
- invoke_api:
api_id: '{{ api_id }}'
stage: '{{ stage }}'
strip_base_path: '{{ strip_base_path }}'
UPDATE example
Use the following StackQL query and manifest file to update a routing_rule resource, using stack-deploy.
/*+ update */
UPDATE awscc.apigatewayv2.routing_rules
SET PatchDocument = string('{{ {
"Priority": priority,
"Conditions": conditions,
"Actions": actions
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ routing_rule_arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.apigatewayv2.routing_rules
WHERE
Identifier = '{{ routing_rule_arn }}' AND
region = 'us-east-1';
Permissions
To operate on the routing_rules resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
apigateway:CreateRoutingRule
apigateway:GetRoutingRule
apigateway:UpdateRoutingRule
apigateway:DeleteRoutingRule
apigateway:ListRoutingRules