ApplicationListenerProps

class aws_cdk.aws_ecs_patterns.ApplicationListenerProps(*, name, certificate=None, port=None, protocol=None, ssl_policy=None)

Bases: object

Properties to define an application listener.

Parameters
  • name (str) – Name of the listener.

  • certificate (Optional[ICertificate]) – Certificate Manager certificate to associate with the load balancer. Setting this option will set the load balancer protocol to HTTPS. Default: - No certificate associated with the load balancer, if using the HTTP protocol. For HTTPS, a DNS-validated certificate will be created for the load balancer’s specified domain name.

  • 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 for connections from clients to the load balancer. The load balancer port is determined from the protocol (port 80 for HTTP, port 443 for HTTPS). A domain name and zone must be also be specified if using HTTPS. Default: ApplicationProtocol.HTTP. If a certificate is specified, the protocol will be set by default to ApplicationProtocol.HTTPS.

  • ssl_policy (Optional[SslPolicy]) – The security policy that defines which ciphers and protocols are supported by the ALB Listener. Default: - The recommended elastic load balancing security policy

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_certificatemanager as certificatemanager
import aws_cdk.aws_ecs_patterns as ecs_patterns
import aws_cdk.aws_elasticloadbalancingv2 as elbv2

# certificate: certificatemanager.Certificate

application_listener_props = ecs_patterns.ApplicationListenerProps(
    name="name",

    # the properties below are optional
    certificate=certificate,
    port=123,
    protocol=elbv2.ApplicationProtocol.HTTP,
    ssl_policy=elbv2.SslPolicy.RECOMMENDED
)

Attributes

certificate

Certificate Manager certificate to associate with the load balancer.

Setting this option will set the load balancer protocol to HTTPS.

Default

  • No certificate associated with the load balancer, if using

the HTTP protocol. For HTTPS, a DNS-validated certificate will be created for the load balancer’s specified domain name.

Return type

Optional[ICertificate]

name

Name of the listener.

Return type

str

port

The port on which the listener listens for requests.

Default
  • Determined from protocol if known.

Return type

Union[int, float, None]

protocol

The protocol for connections from clients to the load balancer.

The load balancer port is determined from the protocol (port 80 for HTTP, port 443 for HTTPS). A domain name and zone must be also be specified if using HTTPS.

Default

ApplicationProtocol.HTTP. If a certificate is specified, the protocol will be set by default to ApplicationProtocol.HTTPS.

Return type

Optional[ApplicationProtocol]

ssl_policy

The security policy that defines which ciphers and protocols are supported by the ALB Listener.

Default
  • The recommended elastic load balancing security policy

Return type

Optional[SslPolicy]