ApplicationListenerRuleProps

class aws_cdk.aws_elasticloadbalancingv2.ApplicationListenerRuleProps(*, priority, action=None, conditions=None, fixed_response=None, host_header=None, path_pattern=None, path_patterns=None, redirect_response=None, target_groups=None, listener)

Bases: aws_cdk.aws_elasticloadbalancingv2.BaseApplicationListenerRuleProps

__init__(*, priority, action=None, conditions=None, fixed_response=None, host_header=None, path_pattern=None, path_patterns=None, redirect_response=None, target_groups=None, listener)

Properties for defining a listener rule.

Parameters
  • priority (Union[int, float]) – Priority of the rule. The rule with the lowest priority will be used for every request. Priorities must be unique.

  • action (Optional[ListenerAction]) – Action to perform when requests are received. Only one of action, fixedResponse, redirectResponse or targetGroups can be specified. Default: - No action

  • conditions (Optional[List[ListenerCondition]]) – Rule applies if matches the conditions. Default: - No conditions.

  • fixed_response (Optional[FixedResponse]) – Fixed response to return. Only one of action, fixedResponse, redirectResponse or targetGroups can be specified. Default: - No fixed response.

  • host_header (Optional[str]) – Rule applies if the requested host matches the indicated host. May contain up to three ‘*’ wildcards. Default: - No host condition.

  • path_pattern (Optional[str]) – Rule applies if the requested path matches the given path pattern. Default: - No path condition.

  • path_patterns (Optional[List[str]]) – Rule applies if the requested path matches any of the given patterns. Paths may contain up to three ‘*’ wildcards. Default: - No path conditions.

  • redirect_response (Optional[RedirectResponse]) – Redirect response to return. Only one of action, fixedResponse, redirectResponse or targetGroups can be specified. Default: - No redirect response.

  • target_groups (Optional[List[IApplicationTargetGroup]]) – Target groups to forward requests to. Only one of action, fixedResponse, redirectResponse or targetGroups can be specified. Implies a forward action. Default: - No target groups.

  • listener (IApplicationListener) – The listener to attach the rule to.

Return type

None

Attributes

action

Action to perform when requests are received.

Only one of action, fixedResponse, redirectResponse or targetGroups can be specified.

default :default: - No action

Return type

Optional[ListenerAction]

conditions

Rule applies if matches the conditions.

default :default: - No conditions.

see :see: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html

Return type

Optional[List[ListenerCondition]]

fixed_response

Fixed response to return.

Only one of action, fixedResponse, redirectResponse or targetGroups can be specified.

default :default: - No fixed response.

deprecated :deprecated: Use action instead.

stability :stability: deprecated

Return type

Optional[FixedResponse]

host_header

Rule applies if the requested host matches the indicated host.

May contain up to three ‘*’ wildcards.

default :default: - No host condition.

deprecated :deprecated: Use conditions instead.

see :see: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#host-conditions stability :stability: deprecated

Return type

Optional[str]

listener

The listener to attach the rule to.

Return type

IApplicationListener

path_pattern

Rule applies if the requested path matches the given path pattern.

default :default: - No path condition.

deprecated :deprecated: Use conditions instead.

see :see: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#path-conditions stability :stability: deprecated

Return type

Optional[str]

path_patterns

Rule applies if the requested path matches any of the given patterns.

Paths may contain up to three ‘*’ wildcards.

default :default: - No path conditions.

deprecated :deprecated: Use conditions instead.

see :see: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#path-conditions stability :stability: deprecated

Return type

Optional[List[str]]

priority

Priority of the rule.

The rule with the lowest priority will be used for every request.

Priorities must be unique.

Return type

Union[int, float]

redirect_response

Redirect response to return.

Only one of action, fixedResponse, redirectResponse or targetGroups can be specified.

default :default: - No redirect response.

deprecated :deprecated: Use action instead.

stability :stability: deprecated

Return type

Optional[RedirectResponse]

target_groups

Target groups to forward requests to.

Only one of action, fixedResponse, redirectResponse or targetGroups can be specified.

Implies a forward action.

default :default: - No target groups.

Return type

Optional[List[IApplicationTargetGroup]]