CfnListenerRuleProps

class aws_cdk.aws_elasticloadbalancingv2.CfnListenerRuleProps(*, actions, conditions, priority, listener_arn=None)

Bases: object

Properties for defining a CfnListenerRule.

Parameters:
  • actions (Union[IResolvable, Sequence[Union[IResolvable, ActionProperty, Dict[str, Any]]]]) – 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.

  • conditions (Union[IResolvable, Sequence[Union[IResolvable, RuleConditionProperty, Dict[str, Any]]]]) – 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 .

  • priority (Union[int, float]) – 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.

  • listener_arn (Optional[str]) – The Amazon Resource Name (ARN) of the listener.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenerrule.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_elasticloadbalancingv2 as elbv2

cfn_listener_rule_props = elbv2.CfnListenerRuleProps(
    actions=[elbv2.CfnListenerRule.ActionProperty(
        type="type",

        # the properties below are optional
        authenticate_cognito_config=elbv2.CfnListenerRule.AuthenticateCognitoConfigProperty(
            user_pool_arn="userPoolArn",
            user_pool_client_id="userPoolClientId",
            user_pool_domain="userPoolDomain",

            # the properties below are optional
            authentication_request_extra_params={
                "authentication_request_extra_params_key": "authenticationRequestExtraParams"
            },
            on_unauthenticated_request="onUnauthenticatedRequest",
            scope="scope",
            session_cookie_name="sessionCookieName",
            session_timeout=123
        ),
        authenticate_oidc_config=elbv2.CfnListenerRule.AuthenticateOidcConfigProperty(
            authorization_endpoint="authorizationEndpoint",
            client_id="clientId",
            issuer="issuer",
            token_endpoint="tokenEndpoint",
            user_info_endpoint="userInfoEndpoint",

            # the properties below are optional
            authentication_request_extra_params={
                "authentication_request_extra_params_key": "authenticationRequestExtraParams"
            },
            client_secret="clientSecret",
            on_unauthenticated_request="onUnauthenticatedRequest",
            scope="scope",
            session_cookie_name="sessionCookieName",
            session_timeout=123,
            use_existing_client_secret=False
        ),
        fixed_response_config=elbv2.CfnListenerRule.FixedResponseConfigProperty(
            status_code="statusCode",

            # the properties below are optional
            content_type="contentType",
            message_body="messageBody"
        ),
        forward_config=elbv2.CfnListenerRule.ForwardConfigProperty(
            target_groups=[elbv2.CfnListenerRule.TargetGroupTupleProperty(
                target_group_arn="targetGroupArn",
                weight=123
            )],
            target_group_stickiness_config=elbv2.CfnListenerRule.TargetGroupStickinessConfigProperty(
                duration_seconds=123,
                enabled=False
            )
        ),
        order=123,
        redirect_config=elbv2.CfnListenerRule.RedirectConfigProperty(
            status_code="statusCode",

            # the properties below are optional
            host="host",
            path="path",
            port="port",
            protocol="protocol",
            query="query"
        ),
        target_group_arn="targetGroupArn"
    )],
    conditions=[elbv2.CfnListenerRule.RuleConditionProperty(
        field="field",
        host_header_config=elbv2.CfnListenerRule.HostHeaderConfigProperty(
            values=["values"]
        ),
        http_header_config=elbv2.CfnListenerRule.HttpHeaderConfigProperty(
            http_header_name="httpHeaderName",
            values=["values"]
        ),
        http_request_method_config=elbv2.CfnListenerRule.HttpRequestMethodConfigProperty(
            values=["values"]
        ),
        path_pattern_config=elbv2.CfnListenerRule.PathPatternConfigProperty(
            values=["values"]
        ),
        query_string_config=elbv2.CfnListenerRule.QueryStringConfigProperty(
            values=[elbv2.CfnListenerRule.QueryStringKeyValueProperty(
                key="key",
                value="value"
            )]
        ),
        source_ip_config=elbv2.CfnListenerRule.SourceIpConfigProperty(
            values=["values"]
        ),
        values=["values"]
    )],
    priority=123,

    # the properties below are optional
    listener_arn="listenerArn"
)

Attributes

actions

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenerrule.html#cfn-elasticloadbalancingv2-listenerrule-actions

conditions

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenerrule.html#cfn-elasticloadbalancingv2-listenerrule-conditions

listener_arn

The Amazon Resource Name (ARN) of the listener.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenerrule.html#cfn-elasticloadbalancingv2-listenerrule-listenerarn

priority

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenerrule.html#cfn-elasticloadbalancingv2-listenerrule-priority