ApplicationListenerProps

class aws_cdk.aws_elasticloadbalancingv2.ApplicationListenerProps(*, certificates=None, default_action=None, default_target_groups=None, mutual_authentication=None, open=None, port=None, protocol=None, ssl_policy=None, load_balancer)

Bases: BaseApplicationListenerProps

Properties for defining a standalone ApplicationListener.

Parameters:
  • certificates (Optional[Sequence[IListenerCertificate]]) – Certificate list of ACM cert ARNs. You must provide exactly one certificate if the listener protocol is HTTPS or TLS. Default: - No certificates.

  • default_action (Optional[ListenerAction]) – Default action to take for requests to this listener. This allows full control of the default action of the load balancer, including Action chaining, fixed responses and redirect responses. See the ListenerAction class for all options. Cannot be specified together with defaultTargetGroups. Default: - None.

  • default_target_groups (Optional[Sequence[IApplicationTargetGroup]]) – Default target groups to load balance to. All target groups will be load balanced to with equal weight and without stickiness. For a more complex configuration than that, use either defaultAction or addAction(). Cannot be specified together with defaultAction. Default: - None.

  • mutual_authentication (Union[MutualAuthentication, Dict[str, Any], None]) – The mutual authentication configuration information. Default: - No mutual authentication configuration

  • open (Optional[bool]) – Allow anyone to connect to the load balancer on the listener port. If this is specified, the load balancer will be opened up to anyone who can reach it. For internal load balancers this is anyone in the same VPC. For public load balancers, this is anyone on the internet. If you want to be more selective about who can access this load balancer, set this to false and use the listener’s connections object to selectively grant access to the load balancer on the listener port. Default: true

  • port (Union[int, float, None]) – The port on which the listener listens for requests. Default: - Determined from protocol if known.

  • protocol (Optional[ApplicationProtocol]) – The protocol to use. Default: - Determined from port if known.

  • ssl_policy (Optional[SslPolicy]) – The security policy that defines which ciphers and protocols are supported. Default: - The current predefined security policy.

  • load_balancer (IApplicationLoadBalancer) – The load balancer to attach this listener to.

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

# application_load_balancer: elbv2.ApplicationLoadBalancer
# application_target_group: elbv2.ApplicationTargetGroup
# listener_action: elbv2.ListenerAction
# listener_certificate: elbv2.ListenerCertificate
# trust_store: elbv2.TrustStore

application_listener_props = elbv2.ApplicationListenerProps(
    load_balancer=application_load_balancer,

    # the properties below are optional
    certificates=[listener_certificate],
    default_action=listener_action,
    default_target_groups=[application_target_group],
    mutual_authentication=elbv2.MutualAuthentication(
        ignore_client_certificate_expiry=False,
        mutual_authentication_mode=elbv2.MutualAuthenticationMode.OFF,
        trust_store=trust_store
    ),
    open=False,
    port=123,
    protocol=elbv2.ApplicationProtocol.HTTP,
    ssl_policy=elbv2.SslPolicy.RECOMMENDED_TLS
)

Attributes

certificates

Certificate list of ACM cert ARNs.

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

Default:
  • No certificates.

default_action

Default action to take for requests to this listener.

This allows full control of the default action of the load balancer, including Action chaining, fixed responses and redirect responses.

See the ListenerAction class for all options.

Cannot be specified together with defaultTargetGroups.

Default:
  • None.

default_target_groups

Default target groups to load balance to.

All target groups will be load balanced to with equal weight and without stickiness. For a more complex configuration than that, use either defaultAction or addAction().

Cannot be specified together with defaultAction.

Default:
  • None.

load_balancer

The load balancer to attach this listener to.

mutual_authentication

The mutual authentication configuration information.

Default:
  • No mutual authentication configuration

See:

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/mutual-authentication.html

open

Allow anyone to connect to the load balancer on the listener port.

If this is specified, the load balancer will be opened up to anyone who can reach it. For internal load balancers this is anyone in the same VPC. For public load balancers, this is anyone on the internet.

If you want to be more selective about who can access this load balancer, set this to false and use the listener’s connections object to selectively grant access to the load balancer on the listener port.

Default:

true

port

The port on which the listener listens for requests.

Default:
  • Determined from protocol if known.

protocol

The protocol to use.

Default:
  • Determined from port if known.

ssl_policy

The security policy that defines which ciphers and protocols are supported.

Default:
  • The current predefined security policy.