Skip to main content

listener_rules

Creates, updates, deletes or gets a listener_rule resource or lists listener_rules in a region

Overview

Namelistener_rules
TypeResource
Description
Specifies a listener rule. The listener must be associated with an Application Load Balancer. Each rule consists of a priority, one or more actions, and one or more conditions.For more information, see Quotas for your Application Load Balancers in the User Guide for Application Load Balancers.
Idawscc.elasticloadbalancingv2.listener_rules

Fields

NameDatatypeDescription
listener_arnstringThe Amazon Resource Name (ARN) of the listener.
is_defaultboolean
actionsarray
The actions.The rule must include exactly one of the following types of actions: forward, fixed-response, or redirect, and it must be the last action to be performed. If the rule is for an HTTPS listener, it can also optionally include an authentication action.
priorityinteger
The rule priority. A listener can't have multiple rules with the same priority.If you try to reorder rules by updating their priorities, do not specify a new priority if an existing rule already uses this priority, as this can cause an error. If you need to reuse a priority with a different rule, you must remove it as a priority first, and then specify it in a subsequent update.
rule_arnstring
conditionsarray
The conditions.The rule can optionally include up to one of each of the following conditions: http-request-method, host-header, path-pattern, and source-ip. A rule can also optionally include one or more of each of the following conditions: http-header and query-string.
regionstringAWS region.

For more information, see AWS::ElasticLoadBalancingV2::ListenerRule.

Methods

NameResourceAccessible byRequired Params
create_resourcelistener_rulesINSERTActions, Priority, Conditions, region
delete_resourcelistener_rulesDELETEIdentifier, region
update_resourcelistener_rulesUPDATEIdentifier, PatchDocument, region
list_resourceslistener_rules_list_onlySELECTregion
get_resourcelistener_rulesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual listener_rule.

SELECT
region,
listener_arn,
is_default,
actions,
priority,
rule_arn,
conditions
FROM awscc.elasticloadbalancingv2.listener_rules
WHERE
region = '{{ region }}' AND
Identifier = '{{ rule_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new listener_rule resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.elasticloadbalancingv2.listener_rules (
Actions,
Priority,
Conditions,
region
)
SELECT
'{{ actions }}',
'{{ priority }}',
'{{ conditions }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a listener_rule resource, using stack-deploy.

/*+ update */
UPDATE awscc.elasticloadbalancingv2.listener_rules
SET PatchDocument = string('{{ {
"Actions": actions,
"Priority": priority,
"Conditions": conditions
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ rule_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.elasticloadbalancingv2.listener_rules
WHERE
Identifier = '{{ rule_arn }}' 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:

ParameterDescription
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 listener_rules resource, the following permissions are required:

elasticloadbalancing:DescribeRules