Skip to main content

routing_rules

Creates, updates, deletes, gets or lists a routing_rules resource.

Overview

Namerouting_rules
TypeResource
Idaws.apigatewayv2.routing_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
actionsarrayThe resulting action based on matching a routing rules condition. Only InvokeApi is supported.
conditionsarrayThe conditions of the routing rule.
priorityintegerThe routing rule priority.
routing_rule_arnstringRepresents an Amazon Resource Name (ARN).
routing_rule_idstringThe identifier.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_routing_ruleselectdomain_name, routing_rule_id, regiondomainNameIdGets a routing rule.
list_routing_rulesselectdomain_name, regiondomainNameId, maxResults, nextTokenLists routing rules.
create_routing_ruleinsertdomain_name, regiondomainNameIdCreates a RoutingRule.
put_routing_rulereplacedomain_name, routing_rule_id, regiondomainNameIdUpdates a routing rule.
delete_routing_ruledeletedomain_name, routing_rule_id, regiondomainNameIdDeletes 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.

NameDatatypeDescription
domain_namestringThe domain name.
regionstringAWS region (default: us-east-1)
routing_rule_idstringThe routing rule ID.
domainNameIdstringThe domain name ID.
maxResultsintegerThe maximum number of elements to be returned for this resource.
nextTokenstringThe next page of elements from this collection. Not valid for the last element of the collection.

SELECT examples

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 }}'
;

INSERT examples

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
;

REPLACE examples

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

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 }}'
;