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
DescriptionSpecifies 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](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html) 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
actionsarrayThe actions.<br />The rule must include exactly one of the following types of actions: &#96;&#96;forward&#96;&#96;, &#96;&#96;fixed-response&#96;&#96;, or &#96;&#96;redirect&#96;&#96;, 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.
priorityintegerThe rule priority. A listener can't have multiple rules with the same priority.<br />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
conditionsarrayThe conditions.<br />The rule can optionally include up to one of each of the following conditions: &#96;&#96;http-request-method&#96;&#96;, &#96;&#96;host-header&#96;&#96;, &#96;&#96;path-pattern&#96;&#96;, and &#96;&#96;source-ip&#96;&#96;. A rule can also optionally include one or more of each of the following conditions: &#96;&#96;http-header&#96;&#96; and &#96;&#96;query-string&#96;&#96;.
regionstringAWS region.

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

Methods

NameAccessible byRequired Params
create_resourceINSERTActions, Priority, Conditions, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, 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 = 'us-east-1' AND data__Identifier = '<RuleArn>';

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

DELETE example

/*+ delete */
DELETE FROM awscc.elasticloadbalancingv2.listener_rules
WHERE data__Identifier = '<RuleArn>'
AND region = 'us-east-1';

Permissions

To operate on the listener_rules resource, the following permissions are required:

Read

elasticloadbalancing:DescribeRules

Create

elasticloadbalancing:CreateRule,
elasticloadbalancing:DescribeRules,
cognito-idp:DescribeUserPoolClient

Update

elasticloadbalancing:ModifyRule,
elasticloadbalancing:SetRulePriorities,
elasticloadbalancing:DescribeRules

List

elasticloadbalancing:DescribeRules

Delete

elasticloadbalancing:DeleteRule,
elasticloadbalancing:DescribeRules