CfnListenerProps

class aws_cdk.aws_elasticloadbalancingv2.CfnListenerProps(*, default_actions, load_balancer_arn, alpn_policy=None, certificates=None, port=None, protocol=None, ssl_policy=None)

Bases: object

Properties for defining a CfnListener.

Parameters:
  • default_actions (Union[IResolvable, Sequence[Union[ActionProperty, Dict[str, Any], IResolvable]]]) – The actions for the default rule. You cannot define a condition for a default rule. To create additional rules for an Application Load Balancer, use AWS::ElasticLoadBalancingV2::ListenerRule .

  • load_balancer_arn (str) – The Amazon Resource Name (ARN) of the load balancer.

  • alpn_policy (Optional[Sequence[str]]) – [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.

  • certificates (Union[IResolvable, Sequence[Union[IResolvable, CertificateProperty, Dict[str, Any]]], None]) – The default SSL server certificate for a secure listener. You must provide exactly one certificate if the listener protocol is HTTPS or TLS. To create a certificate list for a secure listener, use AWS::ElasticLoadBalancingV2::ListenerCertificate .

  • port (Union[int, float, None]) – The port on which the load balancer is listening. You cannot specify a port for a Gateway Load Balancer.

  • protocol (Optional[str]) – The protocol for connections from clients to the load balancer. For Application Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, and TCP_UDP. You can’t specify the UDP or TCP_UDP protocol if dual-stack mode is enabled. You cannot specify a protocol for a Gateway Load Balancer.

  • ssl_policy (Optional[str]) –

    [HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported. For more information, see Security policies in the Application Load Balancers Guide and Security policies in the Network Load Balancers Guide .

Link:

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

ExampleMetadata:

fixture=_generated

Example:

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

cfn_listener_props = elbv2.CfnListenerProps(
    default_actions=[elbv2.CfnListener.ActionProperty(
        type="type",

        # the properties below are optional
        authenticate_cognito_config=elbv2.CfnListener.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="sessionTimeout"
        ),
        authenticate_oidc_config=elbv2.CfnListener.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="sessionTimeout",
            use_existing_client_secret=False
        ),
        fixed_response_config=elbv2.CfnListener.FixedResponseConfigProperty(
            status_code="statusCode",

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

            # the properties below are optional
            host="host",
            path="path",
            port="port",
            protocol="protocol",
            query="query"
        ),
        target_group_arn="targetGroupArn"
    )],
    load_balancer_arn="loadBalancerArn",

    # the properties below are optional
    alpn_policy=["alpnPolicy"],
    certificates=[elbv2.CfnListener.CertificateProperty(
        certificate_arn="certificateArn"
    )],
    port=123,
    protocol="protocol",
    ssl_policy="sslPolicy"
)

Attributes

alpn_policy

[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.

Link:

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

certificates

The default SSL server certificate for a secure listener.

You must provide exactly one certificate if the listener protocol is HTTPS or TLS.

To create a certificate list for a secure listener, use AWS::ElasticLoadBalancingV2::ListenerCertificate .

Link:

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

default_actions

The actions for the default rule. You cannot define a condition for a default rule.

To create additional rules for an Application Load Balancer, use AWS::ElasticLoadBalancingV2::ListenerRule .

Link:

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

load_balancer_arn

The Amazon Resource Name (ARN) of the load balancer.

Link:

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

port

The port on which the load balancer is listening.

You cannot specify a port for a Gateway Load Balancer.

Link:

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

protocol

The protocol for connections from clients to the load balancer.

For Application Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, and TCP_UDP. You can’t specify the UDP or TCP_UDP protocol if dual-stack mode is enabled. You cannot specify a protocol for a Gateway Load Balancer.

Link:

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

ssl_policy

[HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.

For more information, see Security policies in the Application Load Balancers Guide and Security policies in the Network Load Balancers Guide .

Link:

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