AWS Elastic Load Balancing V2 Listener Rule
This page shows how to write Terraform and CloudFormation for Elastic Load Balancing V2 Listener Rule and write them securely.
aws_lb_listener_rule (Terraform)
The Listener Rule in Elastic Load Balancing V2 can be configured in Terraform with the resource name aws_lb_listener_rule. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_lb_listener_rule" "unauthenticated_paths" {
count = module.this.enabled && length(var.unauthenticated_paths) > 0 && length(var.unauthenticated_hosts) == 0 ? length(var.unauthenticated_listener_arns) : 0
listener_arn = var.unauthenticated_listener_arns[count.index]
priority = var.unauthenticated_priority > 0 ? var.unauthenticated_priority + count.index : null
Parameters
-
arnoptional computed - string -
idoptional computed - string -
listener_arnrequired - string -
priorityoptional computed - number -
actionlist block-
orderoptional computed - number -
target_group_arnoptional - string -
typerequired - string -
authenticate_cognitolist block-
authentication_request_extra_paramsoptional - map from string to string -
on_unauthenticated_requestoptional computed - string -
scopeoptional computed - string -
session_cookie_nameoptional computed - string -
session_timeoutoptional computed - number -
user_pool_arnrequired - string -
user_pool_client_idrequired - string -
user_pool_domainrequired - string
-
-
authenticate_oidclist block-
authentication_request_extra_paramsoptional - map from string to string -
authorization_endpointrequired - string -
client_idrequired - string -
client_secretrequired - string -
issuerrequired - string -
on_unauthenticated_requestoptional computed - string -
scopeoptional computed - string -
session_cookie_nameoptional computed - string -
session_timeoutoptional computed - number -
token_endpointrequired - string -
user_info_endpointrequired - string
-
-
fixed_responselist block-
content_typerequired - string -
message_bodyoptional - string -
status_codeoptional computed - string
-
-
forwardlist block-
stickinesslist block -
target_groupset block
-
-
redirectlist block
-
-
conditionset block-
host_headerlist block-
valuesrequired - set of string
-
-
http_headerlist block-
http_header_namerequired - string -
valuesrequired - set of string
-
-
http_request_methodlist block-
valuesrequired - set of string
-
-
path_patternlist block-
valuesrequired - set of string
-
-
query_stringset block -
source_iplist block-
valuesrequired - set of string
-
-
Explanation in Terraform Registry
Provides a Load Balancer Listener Rule resource.
Note:
aws_alb_listener_ruleis known asaws_lb_listener_rule. The functionality is identical.
AWS::ElasticLoadBalancingV2::ListenerRule (CloudFormation)
The ListenerRule in ElasticLoadBalancingV2 can be configured in CloudFormation with the resource name AWS::ElasticLoadBalancingV2::ListenerRule. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
ListenerArnrequired - String -
Actionsrequired - List of Action -
Priorityrequired - Integer -
Conditionsrequired - List of RuleCondition
Explanation in CloudFormation Registry
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.
Frequently asked questions
What is AWS Elastic Load Balancing V2 Listener Rule?
AWS Elastic Load Balancing V2 Listener Rule is a resource for Elastic Load Balancing V2 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Elastic Load Balancing V2 Listener Rule?
For Terraform, the matkovskiy/tf-modules source code example is useful. See the Terraform Example section for further details.