routing_rules
Creates, updates, deletes, gets or lists a routing_rules resource.
Overview
| Name | routing_rules |
| Type | Resource |
| Id | aws.apigatewayv2.routing_rules |
Fields
The following fields are returned by SELECT queries:
- get_routing_rule
- list_routing_rules
| Name | Datatype | Description |
|---|---|---|
actions | array | The resulting action based on matching a routing rules condition. Only InvokeApi is supported. |
conditions | array | The conditions of the routing rule. |
priority | integer | The routing rule priority. |
routing_rule_arn | string | Represents an Amazon Resource Name (ARN). |
routing_rule_id | string | The identifier. |
| Name | Datatype | Description |
|---|---|---|
actions | array | The routing rule action. |
conditions | array | The routing rule condition. |
priority | integer | The routing rule priority. |
routing_rule_arn | string | Represents an Amazon Resource Name (ARN). |
routing_rule_id | string | The identifier. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_routing_rule | select | domain_name, routing_rule_id, region | domainNameId | Gets a routing rule. |
list_routing_rules | select | domain_name, region | domainNameId, maxResults, nextToken | Lists routing rules. |
create_routing_rule | insert | domain_name, region | domainNameId | Creates a RoutingRule. |
put_routing_rule | replace | domain_name, routing_rule_id, region | domainNameId | Updates a routing rule. |
delete_routing_rule | delete | domain_name, routing_rule_id, region | domainNameId | Deletes a routing rule. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
domain_name | string | The domain name. |
region | string | AWS region (default: us-east-1) |
routing_rule_id | string | The routing rule ID. |
domainNameId | string | The domain name ID. |
maxResults | integer | The maximum number of elements to be returned for this resource. |
nextToken | string | The next page of elements from this collection. Not valid for the last element of the collection. |
SELECT examples
- get_routing_rule
- list_routing_rules
Gets a routing rule.
SELECT
actions,
conditions,
priority,
routing_rule_arn,
routing_rule_id
FROM aws.apigatewayv2.routing_rules
WHERE domain_name = '{{ domain_name }}' -- required
AND routing_rule_id = '{{ routing_rule_id }}' -- required
AND region = '{{ region }}' -- required
AND domainNameId = '{{ domainNameId }}'
;
Lists routing rules.
SELECT
actions,
conditions,
priority,
routing_rule_arn,
routing_rule_id
FROM aws.apigatewayv2.routing_rules
WHERE domain_name = '{{ domain_name }}' -- required
AND region = '{{ region }}' -- required
AND domainNameId = '{{ domainNameId }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_routing_rule
- Manifest
Creates a RoutingRule.
INSERT INTO aws.apigatewayv2.routing_rules (
Actions,
Conditions,
Priority,
domain_name,
region,
domainNameId
)
SELECT
'{{ Actions }}',
'{{ Conditions }}',
{{ Priority }},
'{{ domain_name }}',
'{{ region }}',
'{{ domainNameId }}'
RETURNING
actions,
conditions,
priority,
routing_rule_arn,
routing_rule_id
;
# Description fields are for documentation purposes
- name: routing_rules
props:
- name: domain_name
value: "{{ domain_name }}"
description: Required parameter for the routing_rules resource.
- name: region
value: "{{ region }}"
description: Required parameter for the routing_rules resource.
- name: Actions
value:
- InvokeApi:
ApiId: "{{ ApiId }}"
Stage: "{{ Stage }}"
StripBasePath: {{ StripBasePath }}
- name: Conditions
value:
- MatchBasePaths:
AnyOf:
- "{{ AnyOf }}"
MatchHeaders:
AnyOf:
- Header: "{{ Header }}"
ValueGlob: "{{ ValueGlob }}"
- name: Priority
value: {{ Priority }}
description: |
The routing rule priority.
- name: domainNameId
value: "{{ domainNameId }}"
description: The domain name ID.
description: The domain name ID.
REPLACE examples
- put_routing_rule
Updates a routing rule.
REPLACE aws.apigatewayv2.routing_rules
SET
Actions = '{{ Actions }}',
Conditions = '{{ Conditions }}',
Priority = {{ Priority }}
WHERE
domain_name = '{{ domain_name }}' --required
AND routing_rule_id = '{{ routing_rule_id }}' --required
AND region = '{{ region }}' --required
AND domainNameId = '{{ domainNameId}}'
RETURNING
actions,
conditions,
priority,
routing_rule_arn,
routing_rule_id;
DELETE examples
- delete_routing_rule
Deletes a routing rule.
DELETE FROM aws.apigatewayv2.routing_rules
WHERE domain_name = '{{ domain_name }}' --required
AND routing_rule_id = '{{ routing_rule_id }}' --required
AND region = '{{ region }}' --required
AND domainNameId = '{{ domainNameId }}'
;