Listener
This class encapsulates and extends the ROS resource type ALIYUN::SLB::Listener
, which is used to create a Server Load Balancer (SLB) listener.
Initializers
import ros_cdk_slb
ros_cdk_slb.Listener(
scope: Construct,
id: str,
bandwidth: typing.Union[typing.Union[int, float], IResolvable],
listener_port: typing.Union[typing.Union[int, float], IResolvable],
load_balancer_id: typing.Union[str, IResolvable],
protocol: typing.Union[str, IResolvable],
acl_id: typing.Union[str, IResolvable] = None,
acl_ids: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
acl_status: typing.Union[str, IResolvable] = None,
acl_type: typing.Union[str, IResolvable] = None,
backend_server_port: typing.Union[typing.Union[int, float], IResolvable] = None,
ca_certificate_id: typing.Union[str, IResolvable] = None,
connection_drain: typing.Union[str, IResolvable] = None,
connection_drain_timeout: typing.Union[typing.Union[int, float], IResolvable] = None,
description: typing.Union[str, IResolvable] = None,
enable_http2: typing.Union[str, IResolvable] = None,
gzip: typing.Union[str, IResolvable] = None,
health_check: typing.Union[IResolvable, HealthCheckProperty] = None,
http_config: typing.Union[IResolvable, HttpConfigProperty] = None,
idle_timeout: typing.Union[typing.Union[int, float], IResolvable] = None,
master_slave_server_group_id: typing.Union[str, IResolvable] = None,
persistence: typing.Union[IResolvable, PersistenceProperty] = None,
port_range: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, PortRangeProperty]]] = None,
proxy_protocol_v2_enabled: typing.Union[bool, IResolvable] = None,
request_timeout: typing.Union[typing.Union[int, float], IResolvable] = None,
scheduler: typing.Union[str, IResolvable] = None,
server_certificate_id: typing.Union[str, IResolvable] = None,
start_listener: typing.Union[bool, IResolvable] = None,
tags: typing.List[TagsProperty] = None,
tls_cipher_policy: typing.Union[str, IResolvable] = None,
v_server_group_id: typing.Union[str, IResolvable] = None,
enable_resource_property_constraint: bool = None
)
Name | Type | Description |
---|---|---|
scope |
ros_cdk_core.Construct |
No description. |
id |
str |
No description. |
bandwidth |
typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] |
Property bandwidth: The bandwidth of network, unit in Mbps(Million bits per second). |
listener_port |
typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] |
Property listenerPort: Port for front listener. |
load_balancer_id |
typing.Union[str, ros_cdk_core.IResolvable] |
Property loadBalancerId: The id of load balancer to create listener. |
protocol |
typing.Union[str, ros_cdk_core.IResolvable] |
Property protocol: The load balancer transport protocol to use for routing: http, https, tcp, or udp. |
acl_id |
typing.Union[str, ros_cdk_core.IResolvable] |
Property aclId: The ID of the access control associated with the listener to be created. |
acl_ids |
typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] |
Property aclIds: The ID list of the access controls associated with the listener to be created. |
acl_status |
typing.Union[str, ros_cdk_core.IResolvable] |
Property aclStatus: Indicates whether to enable access control. |
acl_type |
typing.Union[str, ros_cdk_core.IResolvable] |
Property aclType: The access control type: * white: Indicates a whitelist. |
backend_server_port |
typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] |
Property backendServerPort: Backend server can listen on ports from 1 to 65535. |
ca_certificate_id |
typing.Union[str, ros_cdk_core.IResolvable] |
Property caCertificateId: CA server certificate id, for https listener only. |
connection_drain |
typing.Union[str, ros_cdk_core.IResolvable] |
Property connectionDrain: Whether to enable graceful connection interruption. |
connection_drain_timeout |
typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] |
Property connectionDrainTimeout: Set the connection graceful interruption timeout. |
description |
typing.Union[str, ros_cdk_core.IResolvable] |
Property description: The description of the listener.It must be 1 to 80 characters in length and can contain letters, digits, hyphens (-), forward slashes (\/), periods (.), and underscores (_). Chinese characters are supported. |
enable_http2 |
typing.Union[str, ros_cdk_core.IResolvable] |
Property enableHttp2: Specifies whether to use HTTP\/2. |
gzip |
typing.Union[str, ros_cdk_core.IResolvable] |
Property gzip: Specifies whether to enable Gzip compression to compress specific types of files. |
health_check |
typing.Union[ros_cdk_core.IResolvable, HealthCheckProperty] |
Property healthCheck: The properties of health checking setting. |
http_config |
typing.Union[ros_cdk_core.IResolvable, HttpConfigProperty] |
Property httpConfig: Config for http protocol. |
idle_timeout |
typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] |
Property idleTimeout: Specify the idle connection timeout in seconds. |
master_slave_server_group_id |
typing.Union[str, ros_cdk_core.IResolvable] |
Property masterSlaveServerGroupId: The id of the MasterSlaveServerGroup which use in listener. |
persistence |
typing.Union[ros_cdk_core.IResolvable, PersistenceProperty] |
Property persistence: The properties of persistence. |
port_range |
typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, PortRangeProperty]]] |
Property portRange: Port range, only supports TCP or UDP listener. |
proxy_protocol_v2_enabled |
typing.Union[bool, ros_cdk_core.IResolvable] |
Property proxyProtocolV2Enabled: Whether to support carrying the client source address to the backend server through the Proxy Protocol. |
request_timeout |
typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] |
Property requestTimeout: Specify the request timeout in seconds. |
scheduler |
typing.Union[str, ros_cdk_core.IResolvable] |
Property scheduler: The scheduling algorithm. |
server_certificate_id |
typing.Union[str, ros_cdk_core.IResolvable] |
Property serverCertificateId: Server certificate id, for https listener only, this properties is required. |
start_listener |
typing.Union[bool, ros_cdk_core.IResolvable] |
Property startListener: Whether start listener after listener created. |
tags |
typing.List[TagsProperty] |
Property tags: Tags to attach to instance. |
tls_cipher_policy |
typing.Union[str, ros_cdk_core.IResolvable] |
Property tlsCipherPolicy: The Transport Layer Security (TLS) security policy. |
v_server_group_id |
typing.Union[str, ros_cdk_core.IResolvable] |
Property vServerGroupId: The id of the VServerGroup which use in listener. |
enable_resource_property_constraint |
bool |
No description. |
scope
Required
- Type: ros_cdk_core.Construct
id
Required
- Type: str
bandwidth
Required
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property bandwidth: The bandwidth of network, unit in Mbps(Million bits per second).
If the specified load balancer with "LOAD_BALANCE_ID" is charged by "paybybandwidth" and is created in classic network, each Listener's bandwidth must be greater than 0 and the sum of all of its Listeners' bandwidth can't be greater than the bandwidth of the load balancer.
listener_port
Required
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property listenerPort: Port for front listener.
Range from 0 to 65535.
load_balancer_id
Required
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property loadBalancerId: The id of load balancer to create listener.
protocol
Required
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property protocol: The load balancer transport protocol to use for routing: http, https, tcp, or udp.
acl_id
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property aclId: The ID of the access control associated with the listener to be created.
If the value of the AclStatus parameter is on, this parameter is required.
acl_ids
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]
Property aclIds: The ID list of the access controls associated with the listener to be created.
If the value of the AclStatus parameter is on, this parameter is required.AclIds have higher priority than AclId.
acl_status
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property aclStatus: Indicates whether to enable access control.
Valid values: on | off. Default value: off
acl_type
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property aclType: The access control type: * white: Indicates a whitelist.
Only requests from IP addresses or CIDR blocks in the selected access control lists are forwarded. This applies to scenarios in which an application only allows access from specific IP addresses. Enabling a whitelist poses some risks to your services. After a whitelist is enabled, only the IP addresses in the list can access the listener. If you enable a whitelist without adding any IP addresses in the list, no requests are forwarded.
- black: Indicates a blacklist. Requests from IP addresses or CIDR blocks in the selected access control lists are not forwarded (that is, they are blocked). This applies to scenarios in which an application only denies access from specific IP addresses. If you enable a blacklist without adding any IP addresses in the list, all requests are forwarded.
If the value of the AclStatus parameter is on, this parameter is required.
backend_server_port
Optional
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property backendServerPort: Backend server can listen on ports from 1 to 65535.
ca_certificate_id
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property caCertificateId: CA server certificate id, for https listener only.
connection_drain
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property connectionDrain: Whether to enable graceful connection interruption.
Value:on: turn on off: Not turned on Note: Only effective TCP listener.
connection_drain_timeout
Optional
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property connectionDrainTimeout: Set the connection graceful interruption timeout.
Unit: seconds. Value range: 10-900. Note: Only effective for TCP listener. When ConnectionDrain is on, this option is required.
description
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property description: The description of the listener.It must be 1 to 80 characters in length and can contain letters, digits, hyphens (-), forward slashes (\/), periods (.), and underscores (_). Chinese characters are supported.
enable_http2
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property enableHttp2: Specifies whether to use HTTP\/2.
It takes effect when Protocol=https. Valid values: on: yes off: no
gzip
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property gzip: Specifies whether to enable Gzip compression to compress specific types of files.
Valid values: on (default): yes off: no
health_check
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, HealthCheckProperty]
Property healthCheck: The properties of health checking setting.
http_config
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, HttpConfigProperty]
Property httpConfig: Config for http protocol.
idle_timeout
Optional
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property idleTimeout: Specify the idle connection timeout in seconds.
Valid value: 1-60 If no request is received during the specified timeout period, Server Load Balancer will temporarily terminate the connection and restart the connection when the next request comes.
master_slave_server_group_id
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property masterSlaveServerGroupId: The id of the MasterSlaveServerGroup which use in listener.
persistence
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, PersistenceProperty]
Property persistence: The properties of persistence.
port_range
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, PortRangeProperty]]]
Property portRange: Port range, only supports TCP or UDP listener.
ListenerPort should be 0 when PortRange is specified.
proxy_protocol_v2_enabled
Optional
- Type: typing.Union[bool, ros_cdk_core.IResolvable]
Property proxyProtocolV2Enabled: Whether to support carrying the client source address to the backend server through the Proxy Protocol.
Value: true: Yes false (default): No Note: Only effective TCP or UDP listener.
request_timeout
Optional
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property requestTimeout: Specify the request timeout in seconds.
Valid value: 1-180 If no response is received from the backend server during the specified timeout period, Server Load Balancer will stop waiting and send an HTTP 504 error to the client.
scheduler
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property scheduler: The scheduling algorithm.
Valid values: wrr: Backend servers that have higher weights receive more requests than those that have lower weights. wlc: Requests are distributed based on the combination of the weights and connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections receives more requests. rr: Requests are distributed to backend servers in sequence. sch: specifies consistent hashing that is based on source IP addresses. Requests from the same source IP address are distributed to the same backend server. tch: specifies consistent hashing that is based on four factors: source IP address, destination IP address, source port number, and destination port number. Requests that contain the same preceding information are distributed to the same backend server. Default: wrr
server_certificate_id
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property serverCertificateId: Server certificate id, for https listener only, this properties is required.
start_listener
Optional
- Type: typing.Union[bool, ros_cdk_core.IResolvable]
Property startListener: Whether start listener after listener created.
Default True.
tags
Optional
- Type: typing.List[TagsProperty]
Property tags: Tags to attach to instance.
Max support 20 tags to add during create instance. Each tag with two properties Key and Value, and Key is required.
tls_cipher_policy
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property tlsCipherPolicy: The Transport Layer Security (TLS) security policy.
Each security policy contains TLS protocol versions and cipher suites available for HTTPS. It takes effect when Protocol=https.
v_server_group_id
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property vServerGroupId: The id of the VServerGroup which use in listener.
enable_resource_property_constraint
Optional
- Type: bool
Methods
Name | Description |
---|---|
to_string |
Returns a string representation of this construct. |
synthesize |
Allows this construct to emit artifacts into the cloud assembly during synthesis. |
add_condition |
No description. |
add_count |
No description. |
add_dependency |
No description. |
add_resource_desc |
No description. |
apply_removal_policy |
No description. |
get_att |
No description. |
set_metadata |
No description. |
to_string
def to_string() -> str
Returns a string representation of this construct.
synthesize
def synthesize(
session: ISynthesisSession
) -> None
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.
- Type: ros_cdk_core.ISynthesisSession
The synthesis session.
add_condition
def add_condition(
condition: RosCondition
) -> None
- Type: ros_cdk_core.RosCondition
add_count
def add_count(
count: typing.Union[typing.Union[int, float], IResolvable]
) -> None
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
add_dependency
def add_dependency(
resource: Resource
) -> None
- Type: ros_cdk_core.Resource
add_resource_desc
def add_resource_desc(
desc: str
) -> None
- Type: str
apply_removal_policy
def apply_removal_policy(
policy: RemovalPolicy
) -> None
- Type: ros_cdk_core.RemovalPolicy
get_att
def get_att(
name: str
) -> IResolvable
- Type: str
set_metadata
def set_metadata(
key: str,
value: typing.Any
) -> None
- Type: str
- Type: typing.Any
Static Functions
Name | Description |
---|---|
is_construct |
Return whether the given object is a Construct. |
is_construct
import ros_cdk_slb
ros_cdk_slb.Listener.is_construct(
x: typing.Any
)
Return whether the given object is a Construct.
- Type: typing.Any
Properties
Name | Type | Description |
---|---|---|
node |
ros_cdk_core.ConstructNode |
The construct tree node associated with this construct. |
ref |
str |
No description. |
stack |
ros_cdk_core.Stack |
The stack in which this resource is defined. |
resource |
ros_cdk_core.RosResource |
No description. |
attr_listener_ports_and_protocol |
ros_cdk_core.IResolvable |
Attribute ListenerPortsAndProtocol: The collection of listener. |
attr_load_balancer_id |
ros_cdk_core.IResolvable |
Attribute LoadBalancerId: The id of load balancer. |
node
Required
node: ConstructNode
- Type: ros_cdk_core.ConstructNode
The construct tree node associated with this construct.
ref
Required
ref: str
- Type: str
stack
Required
stack: Stack
- Type: ros_cdk_core.Stack
The stack in which this resource is defined.
resource
Optional
resource: RosResource
- Type: ros_cdk_core.RosResource
attr_listener_ports_and_protocol
Required
attr_listener_ports_and_protocol: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute ListenerPortsAndProtocol: The collection of listener.
attr_load_balancer_id
Required
attr_load_balancer_id: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute LoadBalancerId: The id of load balancer.