Skip to content

Listener

This class encapsulates and extends the ROS resource type ALIYUN::ALB::Listener, which is used to create an HTTP, HTTPS, or Quick UDP Internet Connections (QUIC) listener.

Initializers

import com.aliyun.ros.cdk.alb.Listener;
Listener.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
    .defaultActions(IResolvable)
    .defaultActions(java.util.List<IResolvable)
    .defaultActions(DefaultActionsProperty>)
    .listenerPort(java.lang.Number)
    .listenerPort(IResolvable)
    .listenerProtocol(java.lang.String)
    .listenerProtocol(IResolvable)
    .loadBalancerId(java.lang.String)
    .loadBalancerId(IResolvable)
//  .caCertificates(IResolvable)
//  .caCertificates(java.util.List<IResolvable)
//  .caCertificates(CaCertificatesProperty>)
//  .caEnabled(java.lang.Boolean)
//  .caEnabled(IResolvable)
//  .certificates(IResolvable)
//  .certificates(java.util.List<IResolvable)
//  .certificates(CertificatesProperty>)
//  .gzipEnabled(java.lang.Boolean)
//  .gzipEnabled(IResolvable)
//  .http2Enabled(java.lang.Boolean)
//  .http2Enabled(IResolvable)
//  .idleTimeout(java.lang.Number)
//  .idleTimeout(IResolvable)
//  .listenerDescription(java.lang.String)
//  .listenerDescription(IResolvable)
//  .listenerStatus(java.lang.String)
//  .listenerStatus(IResolvable)
//  .quicConfig(IResolvable)
//  .quicConfig(QuicConfigProperty)
//  .requestTimeout(java.lang.Number)
//  .requestTimeout(IResolvable)
//  .securityPolicyId(java.lang.String)
//  .securityPolicyId(IResolvable)
//  .xForwardedForConfig(IResolvable)
//  .xForwardedForConfig(XForwardedForConfigProperty)
    .build();
Name Type Description
scope com.aliyun.ros.cdk.core.Construct No description.
id java.lang.String No description.
enableResourcePropertyConstraint java.lang.Boolean No description.
defaultActions com.aliyun.ros.cdk.core.IResolvable OR java.util.ListDefaultActionsProperty> Property defaultActions: The actions of the rule.
listenerPort java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property listenerPort: The frontend port that is used by the ALB instance.
listenerProtocol java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property listenerProtocol: The listener protocol.
loadBalancerId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property loadBalancerId: The ID of the ALB instance.
caCertificates com.aliyun.ros.cdk.core.IResolvable OR java.util.ListCaCertificatesProperty> Property caCertificates: List of configured CA certificates for listener.
caEnabled java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property caEnabled: Specifies whether to enable mutual authentication.
certificates com.aliyun.ros.cdk.core.IResolvable OR java.util.ListCertificatesProperty> Property certificates: The list of SSL certificates for listener.
gzipEnabled java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property gzipEnabled: Specifies whether to enable gzip compression to compress files of a specific type.
http2Enabled java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property http2Enabled: Specifies whether to enable HTTP\/2.
idleTimeout java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property idleTimeout: The timeout period of idle connections.
listenerDescription java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property listenerDescription: The description of the listener.
listenerStatus java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property listenerStatus: The status of the listener.
quicConfig com.aliyun.ros.cdk.core.IResolvable OR QuicConfigProperty Property quicConfig: Select a QUIC listener and associate it with the ALB instance.
requestTimeout java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property requestTimeout: The timeout period of the request.
securityPolicyId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property securityPolicyId: The ID of the security policy.
xForwardedForConfig com.aliyun.ros.cdk.core.IResolvable OR XForwardedForConfigProperty Property xForwardedForConfig: The configuration of the XForward field.

scopeRequired

  • Type: com.aliyun.ros.cdk.core.Construct

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

defaultActionsRequired

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListDefaultActionsProperty>

Property defaultActions: The actions of the rule.


listenerPortRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property listenerPort: The frontend port that is used by the ALB instance.

Valid values: 1 to 65535.


listenerProtocolRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property listenerProtocol: The listener protocol.

Valid values: HTTP, HTTPS, and QUIC.


loadBalancerIdRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property loadBalancerId: The ID of the ALB instance.


caCertificatesOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListCaCertificatesProperty>

Property caCertificates: List of configured CA certificates for listener.


caEnabledOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property caEnabled: Specifies whether to enable mutual authentication.

Default false.


certificatesOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListCertificatesProperty>

Property certificates: The list of SSL certificates for listener.


gzipEnabledOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property gzipEnabled: Specifies whether to enable gzip compression to compress files of a specific type.

Valid values: true and false. Default value: true.


http2EnabledOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property http2Enabled: Specifies whether to enable HTTP\/2.

Default value: on. Valid values: true and false. Default value: true. Note Only HTTPS listeners support this parameter.


idleTimeoutOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property idleTimeout: The timeout period of idle connections.

Valid values: 1 to 180. Unit: seconds. Default value: 15. If no request is received within the specified timeout period, ALB closes the connection. ALB recreates the connection when a new connection request is received.


listenerDescriptionOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property listenerDescription: The description of the listener.

The description must be 2 to 256 characters in length.


listenerStatusOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property listenerStatus: The status of the listener.


quicConfigOptional

Property quicConfig: Select a QUIC listener and associate it with the ALB instance.


requestTimeoutOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property requestTimeout: The timeout period of the request.

Valid values: 1 to 180. Unit: seconds. Default value: 60. If no response is received from the backend server during the request timeout period, ALB sends an HTTP 504 error code to the client.


securityPolicyIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property securityPolicyId: The ID of the security policy.

System security policies and custom security policies are supported. Default value: tls_cipher_policy_1_0. This value indicates a system security policy. Note Only HTTPS listeners support this parameter.


xForwardedForConfigOptional

Property xForwardedForConfig: The configuration of the XForward field.


Methods

Name Description
toString Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
addCondition No description.
addCount No description.
addDependency No description.
addResourceDesc No description.
applyRemovalPolicy No description.
getAtt No description.
setMetadata No description.

toString

public java.lang.String toString()

Returns a string representation of this construct.

synthesize

public void synthesize(ISynthesisSession session)

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: com.aliyun.ros.cdk.core.ISynthesisSession

The synthesis session.


addCondition

public void addCondition(RosCondition condition)

conditionRequired

  • Type: com.aliyun.ros.cdk.core.RosCondition

addCount

public void addCount(java.lang.Number OR IResolvable count)

countRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

addDependency

public void addDependency(Resource resource)

resourceRequired

  • Type: com.aliyun.ros.cdk.core.Resource

addResourceDesc

public void addResourceDesc(java.lang.String desc)

descRequired

  • Type: java.lang.String

applyRemovalPolicy

public void applyRemovalPolicy(RemovalPolicy policy)

policyRequired

  • Type: com.aliyun.ros.cdk.core.RemovalPolicy

getAtt

public IResolvable getAtt(java.lang.String name)

nameRequired

  • Type: java.lang.String

setMetadata

public void setMetadata(java.lang.String key, java.lang.Object value)

keyRequired

  • Type: java.lang.String

valueRequired

  • Type: java.lang.Object

Static Functions

Name Description
isConstruct Return whether the given object is a Construct.

isConstruct

import com.aliyun.ros.cdk.alb.Listener;
Listener.isConstruct(java.lang.Object x)

Return whether the given object is a Construct.

xRequired

  • Type: java.lang.Object

Properties

Name Type Description
node com.aliyun.ros.cdk.core.ConstructNode The construct tree node associated with this construct.
ref java.lang.String No description.
stack com.aliyun.ros.cdk.core.Stack The stack in which this resource is defined.
resource com.aliyun.ros.cdk.core.RosResource No description.
attrListenerId com.aliyun.ros.cdk.core.IResolvable Attribute ListenerId: The ID of the listener.

nodeRequired

public ConstructNode getNode();
  • Type: com.aliyun.ros.cdk.core.ConstructNode

The construct tree node associated with this construct.


refRequired

public java.lang.String getRef();
  • Type: java.lang.String

stackRequired

public Stack getStack();
  • Type: com.aliyun.ros.cdk.core.Stack

The stack in which this resource is defined.


resourceOptional

public RosResource getResource();
  • Type: com.aliyun.ros.cdk.core.RosResource

attrListenerIdRequired

public IResolvable getAttrListenerId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute ListenerId: The ID of the listener.