alicloud.slb.Listener
Explore with Pulumi AI
Provides a Classic Load Balancer (SLB) Load Balancer Listener resource.
For information about Classic Load Balancer (SLB) and how to use it, see What is Classic Load Balancer.
For information about listener and how to use it, please see the following:
- Configure a HTTP Classic Load Balancer (SLB) Listener.
- Configure a HTTPS Classic Load Balancer (SLB) Listener.
- Configure a TCP Classic Load Balancer (SLB) Listener.
- Configure a UDP Classic Load Balancer (SLB) Listener.
NOTE: Available since v1.0.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const _default = new random.index.Integer("default", {
min: 10000,
max: 99999,
});
const listener = new alicloud.slb.ApplicationLoadBalancer("listener", {
loadBalancerName: `${name}-${_default.result}`,
internetChargeType: "PayByTraffic",
addressType: "internet",
instanceChargeType: "PayByCLCU",
});
const listenerAcl = new alicloud.slb.Acl("listener", {
name: `${name}-${_default.result}`,
ipVersion: "ipv4",
});
const listenerListener = new alicloud.slb.Listener("listener", {
loadBalancerId: listener.id,
backendPort: 80,
frontendPort: 80,
protocol: "http",
bandwidth: 10,
stickySession: "on",
stickySessionType: "insert",
cookieTimeout: 86400,
cookie: "tfslblistenercookie",
healthCheck: "on",
healthCheckDomain: "ali.com",
healthCheckUri: "/cons",
healthCheckConnectPort: 20,
healthyThreshold: 8,
unhealthyThreshold: 8,
healthCheckTimeout: 8,
healthCheckInterval: 5,
healthCheckHttpCode: "http_2xx,http_3xx",
xForwardedFor: {
retriveSlbIp: true,
retriveSlbId: true,
},
aclStatus: "on",
aclType: "white",
aclId: listenerAcl.id,
requestTimeout: 80,
idleTimeout: 30,
});
const first = new alicloud.slb.AclEntryAttachment("first", {
aclId: listenerAcl.id,
entry: "10.10.10.0/24",
comment: "first",
});
const second = new alicloud.slb.AclEntryAttachment("second", {
aclId: listenerAcl.id,
entry: "168.10.10.0/24",
comment: "second",
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
default = random.index.Integer("default",
min=10000,
max=99999)
listener = alicloud.slb.ApplicationLoadBalancer("listener",
load_balancer_name=f"{name}-{default['result']}",
internet_charge_type="PayByTraffic",
address_type="internet",
instance_charge_type="PayByCLCU")
listener_acl = alicloud.slb.Acl("listener",
name=f"{name}-{default['result']}",
ip_version="ipv4")
listener_listener = alicloud.slb.Listener("listener",
load_balancer_id=listener.id,
backend_port=80,
frontend_port=80,
protocol="http",
bandwidth=10,
sticky_session="on",
sticky_session_type="insert",
cookie_timeout=86400,
cookie="tfslblistenercookie",
health_check="on",
health_check_domain="ali.com",
health_check_uri="/cons",
health_check_connect_port=20,
healthy_threshold=8,
unhealthy_threshold=8,
health_check_timeout=8,
health_check_interval=5,
health_check_http_code="http_2xx,http_3xx",
x_forwarded_for={
"retrive_slb_ip": True,
"retrive_slb_id": True,
},
acl_status="on",
acl_type="white",
acl_id=listener_acl.id,
request_timeout=80,
idle_timeout=30)
first = alicloud.slb.AclEntryAttachment("first",
acl_id=listener_acl.id,
entry="10.10.10.0/24",
comment="first")
second = alicloud.slb.AclEntryAttachment("second",
acl_id=listener_acl.id,
entry="168.10.10.0/24",
comment="second")
package main
import (
"fmt"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/slb"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Min: 10000,
Max: 99999,
})
if err != nil {
return err
}
listener, err := slb.NewApplicationLoadBalancer(ctx, "listener", &slb.ApplicationLoadBalancerArgs{
LoadBalancerName: pulumi.Sprintf("%v-%v", name, _default.Result),
InternetChargeType: pulumi.String("PayByTraffic"),
AddressType: pulumi.String("internet"),
InstanceChargeType: pulumi.String("PayByCLCU"),
})
if err != nil {
return err
}
listenerAcl, err := slb.NewAcl(ctx, "listener", &slb.AclArgs{
Name: pulumi.Sprintf("%v-%v", name, _default.Result),
IpVersion: pulumi.String("ipv4"),
})
if err != nil {
return err
}
_, err = slb.NewListener(ctx, "listener", &slb.ListenerArgs{
LoadBalancerId: listener.ID(),
BackendPort: pulumi.Int(80),
FrontendPort: pulumi.Int(80),
Protocol: pulumi.String("http"),
Bandwidth: pulumi.Int(10),
StickySession: pulumi.String("on"),
StickySessionType: pulumi.String("insert"),
CookieTimeout: pulumi.Int(86400),
Cookie: pulumi.String("tfslblistenercookie"),
HealthCheck: pulumi.String("on"),
HealthCheckDomain: pulumi.String("ali.com"),
HealthCheckUri: pulumi.String("/cons"),
HealthCheckConnectPort: pulumi.Int(20),
HealthyThreshold: pulumi.Int(8),
UnhealthyThreshold: pulumi.Int(8),
HealthCheckTimeout: pulumi.Int(8),
HealthCheckInterval: pulumi.Int(5),
HealthCheckHttpCode: pulumi.String("http_2xx,http_3xx"),
XForwardedFor: &slb.ListenerXForwardedForArgs{
RetriveSlbIp: pulumi.Bool(true),
RetriveSlbId: pulumi.Bool(true),
},
AclStatus: pulumi.String("on"),
AclType: pulumi.String("white"),
AclId: listenerAcl.ID(),
RequestTimeout: pulumi.Int(80),
IdleTimeout: pulumi.Int(30),
})
if err != nil {
return err
}
_, err = slb.NewAclEntryAttachment(ctx, "first", &slb.AclEntryAttachmentArgs{
AclId: listenerAcl.ID(),
Entry: pulumi.String("10.10.10.0/24"),
Comment: pulumi.String("first"),
})
if err != nil {
return err
}
_, err = slb.NewAclEntryAttachment(ctx, "second", &slb.AclEntryAttachmentArgs{
AclId: listenerAcl.ID(),
Entry: pulumi.String("168.10.10.0/24"),
Comment: pulumi.String("second"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf-example";
var @default = new Random.Index.Integer("default", new()
{
Min = 10000,
Max = 99999,
});
var listener = new AliCloud.Slb.ApplicationLoadBalancer("listener", new()
{
LoadBalancerName = $"{name}-{@default.Result}",
InternetChargeType = "PayByTraffic",
AddressType = "internet",
InstanceChargeType = "PayByCLCU",
});
var listenerAcl = new AliCloud.Slb.Acl("listener", new()
{
Name = $"{name}-{@default.Result}",
IpVersion = "ipv4",
});
var listenerListener = new AliCloud.Slb.Listener("listener", new()
{
LoadBalancerId = listener.Id,
BackendPort = 80,
FrontendPort = 80,
Protocol = "http",
Bandwidth = 10,
StickySession = "on",
StickySessionType = "insert",
CookieTimeout = 86400,
Cookie = "tfslblistenercookie",
HealthCheck = "on",
HealthCheckDomain = "ali.com",
HealthCheckUri = "/cons",
HealthCheckConnectPort = 20,
HealthyThreshold = 8,
UnhealthyThreshold = 8,
HealthCheckTimeout = 8,
HealthCheckInterval = 5,
HealthCheckHttpCode = "http_2xx,http_3xx",
XForwardedFor = new AliCloud.Slb.Inputs.ListenerXForwardedForArgs
{
RetriveSlbIp = true,
RetriveSlbId = true,
},
AclStatus = "on",
AclType = "white",
AclId = listenerAcl.Id,
RequestTimeout = 80,
IdleTimeout = 30,
});
var first = new AliCloud.Slb.AclEntryAttachment("first", new()
{
AclId = listenerAcl.Id,
Entry = "10.10.10.0/24",
Comment = "first",
});
var second = new AliCloud.Slb.AclEntryAttachment("second", new()
{
AclId = listenerAcl.Id,
Entry = "168.10.10.0/24",
Comment = "second",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.integer;
import com.pulumi.random.IntegerArgs;
import com.pulumi.alicloud.slb.ApplicationLoadBalancer;
import com.pulumi.alicloud.slb.ApplicationLoadBalancerArgs;
import com.pulumi.alicloud.slb.Acl;
import com.pulumi.alicloud.slb.AclArgs;
import com.pulumi.alicloud.slb.Listener;
import com.pulumi.alicloud.slb.ListenerArgs;
import com.pulumi.alicloud.slb.inputs.ListenerXForwardedForArgs;
import com.pulumi.alicloud.slb.AclEntryAttachment;
import com.pulumi.alicloud.slb.AclEntryAttachmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var name = config.get("name").orElse("tf-example");
var default_ = new Integer("default", IntegerArgs.builder()
.min(10000)
.max(99999)
.build());
var listener = new ApplicationLoadBalancer("listener", ApplicationLoadBalancerArgs.builder()
.loadBalancerName(String.format("%s-%s", name,default_.result()))
.internetChargeType("PayByTraffic")
.addressType("internet")
.instanceChargeType("PayByCLCU")
.build());
var listenerAcl = new Acl("listenerAcl", AclArgs.builder()
.name(String.format("%s-%s", name,default_.result()))
.ipVersion("ipv4")
.build());
var listenerListener = new Listener("listenerListener", ListenerArgs.builder()
.loadBalancerId(listener.id())
.backendPort(80)
.frontendPort(80)
.protocol("http")
.bandwidth(10)
.stickySession("on")
.stickySessionType("insert")
.cookieTimeout(86400)
.cookie("tfslblistenercookie")
.healthCheck("on")
.healthCheckDomain("ali.com")
.healthCheckUri("/cons")
.healthCheckConnectPort(20)
.healthyThreshold(8)
.unhealthyThreshold(8)
.healthCheckTimeout(8)
.healthCheckInterval(5)
.healthCheckHttpCode("http_2xx,http_3xx")
.xForwardedFor(ListenerXForwardedForArgs.builder()
.retriveSlbIp(true)
.retriveSlbId(true)
.build())
.aclStatus("on")
.aclType("white")
.aclId(listenerAcl.id())
.requestTimeout(80)
.idleTimeout(30)
.build());
var first = new AclEntryAttachment("first", AclEntryAttachmentArgs.builder()
.aclId(listenerAcl.id())
.entry("10.10.10.0/24")
.comment("first")
.build());
var second = new AclEntryAttachment("second", AclEntryAttachmentArgs.builder()
.aclId(listenerAcl.id())
.entry("168.10.10.0/24")
.comment("second")
.build());
}
}
configuration:
name:
type: string
default: tf-example
resources:
default:
type: random:integer
properties:
min: 10000
max: 99999
listener:
type: alicloud:slb:ApplicationLoadBalancer
properties:
loadBalancerName: ${name}-${default.result}
internetChargeType: PayByTraffic
addressType: internet
instanceChargeType: PayByCLCU
listenerListener:
type: alicloud:slb:Listener
name: listener
properties:
loadBalancerId: ${listener.id}
backendPort: 80
frontendPort: 80
protocol: http
bandwidth: 10
stickySession: on
stickySessionType: insert
cookieTimeout: 86400
cookie: tfslblistenercookie
healthCheck: on
healthCheckDomain: ali.com
healthCheckUri: /cons
healthCheckConnectPort: 20
healthyThreshold: 8
unhealthyThreshold: 8
healthCheckTimeout: 8
healthCheckInterval: 5
healthCheckHttpCode: http_2xx,http_3xx
xForwardedFor:
retriveSlbIp: true
retriveSlbId: true
aclStatus: on
aclType: white
aclId: ${listenerAcl.id}
requestTimeout: 80
idleTimeout: 30
listenerAcl:
type: alicloud:slb:Acl
name: listener
properties:
name: ${name}-${default.result}
ipVersion: ipv4
first:
type: alicloud:slb:AclEntryAttachment
properties:
aclId: ${listenerAcl.id}
entry: 10.10.10.0/24
comment: first
second:
type: alicloud:slb:AclEntryAttachment
properties:
aclId: ${listenerAcl.id}
entry: 168.10.10.0/24
comment: second
Create Listener Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Listener(name: string, args: ListenerArgs, opts?: CustomResourceOptions);
@overload
def Listener(resource_name: str,
args: ListenerArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Listener(resource_name: str,
opts: Optional[ResourceOptions] = None,
frontend_port: Optional[int] = None,
protocol: Optional[str] = None,
load_balancer_id: Optional[str] = None,
health_check_type: Optional[str] = None,
enable_http2: Optional[str] = None,
ca_certificate_id: Optional[str] = None,
health_check_uri: Optional[str] = None,
cookie_timeout: Optional[int] = None,
idle_timeout: Optional[int] = None,
description: Optional[str] = None,
healthy_threshold: Optional[int] = None,
established_timeout: Optional[int] = None,
forward_port: Optional[int] = None,
backend_port: Optional[int] = None,
gzip: Optional[bool] = None,
health_check: Optional[str] = None,
health_check_connect_port: Optional[int] = None,
health_check_domain: Optional[str] = None,
health_check_http_code: Optional[str] = None,
health_check_interval: Optional[int] = None,
health_check_method: Optional[str] = None,
health_check_timeout: Optional[int] = None,
acl_id: Optional[str] = None,
cookie: Optional[str] = None,
bandwidth: Optional[int] = None,
delete_protection_validation: Optional[bool] = None,
lb_port: Optional[int] = None,
lb_protocol: Optional[str] = None,
listener_forward: Optional[str] = None,
acl_type: Optional[str] = None,
master_slave_server_group_id: Optional[str] = None,
persistence_timeout: Optional[int] = None,
acl_status: Optional[str] = None,
proxy_protocol_v2_enabled: Optional[bool] = None,
request_timeout: Optional[int] = None,
scheduler: Optional[str] = None,
server_certificate_id: Optional[str] = None,
server_group_id: Optional[str] = None,
ssl_certificate_id: Optional[str] = None,
sticky_session: Optional[str] = None,
sticky_session_type: Optional[str] = None,
tls_cipher_policy: Optional[str] = None,
unhealthy_threshold: Optional[int] = None,
x_forwarded_for: Optional[ListenerXForwardedForArgs] = None)
func NewListener(ctx *Context, name string, args ListenerArgs, opts ...ResourceOption) (*Listener, error)
public Listener(string name, ListenerArgs args, CustomResourceOptions? opts = null)
public Listener(String name, ListenerArgs args)
public Listener(String name, ListenerArgs args, CustomResourceOptions options)
type: alicloud:slb:Listener
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ListenerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ListenerArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ListenerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ListenerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ListenerArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var examplelistenerResourceResourceFromSlblistener = new AliCloud.Slb.Listener("examplelistenerResourceResourceFromSlblistener", new()
{
FrontendPort = 0,
Protocol = "string",
LoadBalancerId = "string",
HealthCheckType = "string",
EnableHttp2 = "string",
CaCertificateId = "string",
HealthCheckUri = "string",
CookieTimeout = 0,
IdleTimeout = 0,
Description = "string",
HealthyThreshold = 0,
EstablishedTimeout = 0,
ForwardPort = 0,
BackendPort = 0,
Gzip = false,
HealthCheck = "string",
HealthCheckConnectPort = 0,
HealthCheckDomain = "string",
HealthCheckHttpCode = "string",
HealthCheckInterval = 0,
HealthCheckMethod = "string",
HealthCheckTimeout = 0,
AclId = "string",
Cookie = "string",
Bandwidth = 0,
DeleteProtectionValidation = false,
ListenerForward = "string",
AclType = "string",
MasterSlaveServerGroupId = "string",
PersistenceTimeout = 0,
AclStatus = "string",
ProxyProtocolV2Enabled = false,
RequestTimeout = 0,
Scheduler = "string",
ServerCertificateId = "string",
ServerGroupId = "string",
StickySession = "string",
StickySessionType = "string",
TlsCipherPolicy = "string",
UnhealthyThreshold = 0,
XForwardedFor = new AliCloud.Slb.Inputs.ListenerXForwardedForArgs
{
RetriveClientIp = false,
RetriveSlbId = false,
RetriveSlbIp = false,
RetriveSlbProto = false,
},
});
example, err := slb.NewListener(ctx, "examplelistenerResourceResourceFromSlblistener", &slb.ListenerArgs{
FrontendPort: pulumi.Int(0),
Protocol: pulumi.String("string"),
LoadBalancerId: pulumi.String("string"),
HealthCheckType: pulumi.String("string"),
EnableHttp2: pulumi.String("string"),
CaCertificateId: pulumi.String("string"),
HealthCheckUri: pulumi.String("string"),
CookieTimeout: pulumi.Int(0),
IdleTimeout: pulumi.Int(0),
Description: pulumi.String("string"),
HealthyThreshold: pulumi.Int(0),
EstablishedTimeout: pulumi.Int(0),
ForwardPort: pulumi.Int(0),
BackendPort: pulumi.Int(0),
Gzip: pulumi.Bool(false),
HealthCheck: pulumi.String("string"),
HealthCheckConnectPort: pulumi.Int(0),
HealthCheckDomain: pulumi.String("string"),
HealthCheckHttpCode: pulumi.String("string"),
HealthCheckInterval: pulumi.Int(0),
HealthCheckMethod: pulumi.String("string"),
HealthCheckTimeout: pulumi.Int(0),
AclId: pulumi.String("string"),
Cookie: pulumi.String("string"),
Bandwidth: pulumi.Int(0),
DeleteProtectionValidation: pulumi.Bool(false),
ListenerForward: pulumi.String("string"),
AclType: pulumi.String("string"),
MasterSlaveServerGroupId: pulumi.String("string"),
PersistenceTimeout: pulumi.Int(0),
AclStatus: pulumi.String("string"),
ProxyProtocolV2Enabled: pulumi.Bool(false),
RequestTimeout: pulumi.Int(0),
Scheduler: pulumi.String("string"),
ServerCertificateId: pulumi.String("string"),
ServerGroupId: pulumi.String("string"),
StickySession: pulumi.String("string"),
StickySessionType: pulumi.String("string"),
TlsCipherPolicy: pulumi.String("string"),
UnhealthyThreshold: pulumi.Int(0),
XForwardedFor: &slb.ListenerXForwardedForArgs{
RetriveClientIp: pulumi.Bool(false),
RetriveSlbId: pulumi.Bool(false),
RetriveSlbIp: pulumi.Bool(false),
RetriveSlbProto: pulumi.Bool(false),
},
})
var examplelistenerResourceResourceFromSlblistener = new Listener("examplelistenerResourceResourceFromSlblistener", ListenerArgs.builder()
.frontendPort(0)
.protocol("string")
.loadBalancerId("string")
.healthCheckType("string")
.enableHttp2("string")
.caCertificateId("string")
.healthCheckUri("string")
.cookieTimeout(0)
.idleTimeout(0)
.description("string")
.healthyThreshold(0)
.establishedTimeout(0)
.forwardPort(0)
.backendPort(0)
.gzip(false)
.healthCheck("string")
.healthCheckConnectPort(0)
.healthCheckDomain("string")
.healthCheckHttpCode("string")
.healthCheckInterval(0)
.healthCheckMethod("string")
.healthCheckTimeout(0)
.aclId("string")
.cookie("string")
.bandwidth(0)
.deleteProtectionValidation(false)
.listenerForward("string")
.aclType("string")
.masterSlaveServerGroupId("string")
.persistenceTimeout(0)
.aclStatus("string")
.proxyProtocolV2Enabled(false)
.requestTimeout(0)
.scheduler("string")
.serverCertificateId("string")
.serverGroupId("string")
.stickySession("string")
.stickySessionType("string")
.tlsCipherPolicy("string")
.unhealthyThreshold(0)
.xForwardedFor(ListenerXForwardedForArgs.builder()
.retriveClientIp(false)
.retriveSlbId(false)
.retriveSlbIp(false)
.retriveSlbProto(false)
.build())
.build());
examplelistener_resource_resource_from_slblistener = alicloud.slb.Listener("examplelistenerResourceResourceFromSlblistener",
frontend_port=0,
protocol="string",
load_balancer_id="string",
health_check_type="string",
enable_http2="string",
ca_certificate_id="string",
health_check_uri="string",
cookie_timeout=0,
idle_timeout=0,
description="string",
healthy_threshold=0,
established_timeout=0,
forward_port=0,
backend_port=0,
gzip=False,
health_check="string",
health_check_connect_port=0,
health_check_domain="string",
health_check_http_code="string",
health_check_interval=0,
health_check_method="string",
health_check_timeout=0,
acl_id="string",
cookie="string",
bandwidth=0,
delete_protection_validation=False,
listener_forward="string",
acl_type="string",
master_slave_server_group_id="string",
persistence_timeout=0,
acl_status="string",
proxy_protocol_v2_enabled=False,
request_timeout=0,
scheduler="string",
server_certificate_id="string",
server_group_id="string",
sticky_session="string",
sticky_session_type="string",
tls_cipher_policy="string",
unhealthy_threshold=0,
x_forwarded_for={
"retrive_client_ip": False,
"retrive_slb_id": False,
"retrive_slb_ip": False,
"retrive_slb_proto": False,
})
const examplelistenerResourceResourceFromSlblistener = new alicloud.slb.Listener("examplelistenerResourceResourceFromSlblistener", {
frontendPort: 0,
protocol: "string",
loadBalancerId: "string",
healthCheckType: "string",
enableHttp2: "string",
caCertificateId: "string",
healthCheckUri: "string",
cookieTimeout: 0,
idleTimeout: 0,
description: "string",
healthyThreshold: 0,
establishedTimeout: 0,
forwardPort: 0,
backendPort: 0,
gzip: false,
healthCheck: "string",
healthCheckConnectPort: 0,
healthCheckDomain: "string",
healthCheckHttpCode: "string",
healthCheckInterval: 0,
healthCheckMethod: "string",
healthCheckTimeout: 0,
aclId: "string",
cookie: "string",
bandwidth: 0,
deleteProtectionValidation: false,
listenerForward: "string",
aclType: "string",
masterSlaveServerGroupId: "string",
persistenceTimeout: 0,
aclStatus: "string",
proxyProtocolV2Enabled: false,
requestTimeout: 0,
scheduler: "string",
serverCertificateId: "string",
serverGroupId: "string",
stickySession: "string",
stickySessionType: "string",
tlsCipherPolicy: "string",
unhealthyThreshold: 0,
xForwardedFor: {
retriveClientIp: false,
retriveSlbId: false,
retriveSlbIp: false,
retriveSlbProto: false,
},
});
type: alicloud:slb:Listener
properties:
aclId: string
aclStatus: string
aclType: string
backendPort: 0
bandwidth: 0
caCertificateId: string
cookie: string
cookieTimeout: 0
deleteProtectionValidation: false
description: string
enableHttp2: string
establishedTimeout: 0
forwardPort: 0
frontendPort: 0
gzip: false
healthCheck: string
healthCheckConnectPort: 0
healthCheckDomain: string
healthCheckHttpCode: string
healthCheckInterval: 0
healthCheckMethod: string
healthCheckTimeout: 0
healthCheckType: string
healthCheckUri: string
healthyThreshold: 0
idleTimeout: 0
listenerForward: string
loadBalancerId: string
masterSlaveServerGroupId: string
persistenceTimeout: 0
protocol: string
proxyProtocolV2Enabled: false
requestTimeout: 0
scheduler: string
serverCertificateId: string
serverGroupId: string
stickySession: string
stickySessionType: string
tlsCipherPolicy: string
unhealthyThreshold: 0
xForwardedFor:
retriveClientIp: false
retriveSlbId: false
retriveSlbIp: false
retriveSlbProto: false
Listener Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Listener resource accepts the following input properties:
- Frontend
Port int - Load
Balancer stringId - Protocol string
- Acl
Id string - Acl
Status string - Acl
Type string - Backend
Port int - Bandwidth int
- Ca
Certificate stringId - string
- int
- Delete
Protection boolValidation - Description string
- Enable
Http2 string - Established
Timeout int - Forward
Port int - Gzip bool
- Health
Check string - Health
Check intConnect Port - Health
Check stringDomain - Health
Check stringHttp Code - Health
Check intInterval - Health
Check stringMethod - Health
Check intTimeout - Health
Check stringType - Health
Check stringUri - Healthy
Threshold int - Idle
Timeout int - Lb
Port int - Lb
Protocol string - Listener
Forward string - Master
Slave stringServer Group Id - Persistence
Timeout int - Proxy
Protocol boolV2Enabled - Request
Timeout int - Scheduler string
- Server
Certificate stringId - Server
Group stringId - Ssl
Certificate stringId - Sticky
Session string - Sticky
Session stringType - Tls
Cipher stringPolicy - Unhealthy
Threshold int - XForwarded
For Pulumi.Ali Cloud. Slb. Inputs. Listener XForwarded For - Whether to set additional HTTP Header field "X-Forwarded-For".
- Frontend
Port int - Load
Balancer stringId - Protocol string
- Acl
Id string - Acl
Status string - Acl
Type string - Backend
Port int - Bandwidth int
- Ca
Certificate stringId - string
- int
- Delete
Protection boolValidation - Description string
- Enable
Http2 string - Established
Timeout int - Forward
Port int - Gzip bool
- Health
Check string - Health
Check intConnect Port - Health
Check stringDomain - Health
Check stringHttp Code - Health
Check intInterval - Health
Check stringMethod - Health
Check intTimeout - Health
Check stringType - Health
Check stringUri - Healthy
Threshold int - Idle
Timeout int - Lb
Port int - Lb
Protocol string - Listener
Forward string - Master
Slave stringServer Group Id - Persistence
Timeout int - Proxy
Protocol boolV2Enabled - Request
Timeout int - Scheduler string
- Server
Certificate stringId - Server
Group stringId - Ssl
Certificate stringId - Sticky
Session string - Sticky
Session stringType - Tls
Cipher stringPolicy - Unhealthy
Threshold int - XForwarded
For ListenerXForwarded For Args - Whether to set additional HTTP Header field "X-Forwarded-For".
- frontend
Port Integer - load
Balancer StringId - protocol String
- acl
Id String - acl
Status String - acl
Type String - backend
Port Integer - bandwidth Integer
- ca
Certificate StringId - String
- Integer
- delete
Protection BooleanValidation - description String
- enable
Http2 String - established
Timeout Integer - forward
Port Integer - gzip Boolean
- health
Check String - health
Check IntegerConnect Port - health
Check StringDomain - health
Check StringHttp Code - health
Check IntegerInterval - health
Check StringMethod - health
Check IntegerTimeout - health
Check StringType - health
Check StringUri - healthy
Threshold Integer - idle
Timeout Integer - lb
Port Integer - lb
Protocol String - listener
Forward String - master
Slave StringServer Group Id - persistence
Timeout Integer - proxy
Protocol BooleanV2Enabled - request
Timeout Integer - scheduler String
- server
Certificate StringId - server
Group StringId - ssl
Certificate StringId - sticky
Session String - sticky
Session StringType - tls
Cipher StringPolicy - unhealthy
Threshold Integer - x
Forwarded ListenerFor XForwarded For - Whether to set additional HTTP Header field "X-Forwarded-For".
- frontend
Port number - load
Balancer stringId - protocol string
- acl
Id string - acl
Status string - acl
Type string - backend
Port number - bandwidth number
- ca
Certificate stringId - string
- number
- delete
Protection booleanValidation - description string
- enable
Http2 string - established
Timeout number - forward
Port number - gzip boolean
- health
Check string - health
Check numberConnect Port - health
Check stringDomain - health
Check stringHttp Code - health
Check numberInterval - health
Check stringMethod - health
Check numberTimeout - health
Check stringType - health
Check stringUri - healthy
Threshold number - idle
Timeout number - lb
Port number - lb
Protocol string - listener
Forward string - master
Slave stringServer Group Id - persistence
Timeout number - proxy
Protocol booleanV2Enabled - request
Timeout number - scheduler string
- server
Certificate stringId - server
Group stringId - ssl
Certificate stringId - sticky
Session string - sticky
Session stringType - tls
Cipher stringPolicy - unhealthy
Threshold number - x
Forwarded ListenerFor XForwarded For - Whether to set additional HTTP Header field "X-Forwarded-For".
- frontend_
port int - load_
balancer_ strid - protocol str
- acl_
id str - acl_
status str - acl_
type str - backend_
port int - bandwidth int
- ca_
certificate_ strid - str
- int
- delete_
protection_ boolvalidation - description str
- enable_
http2 str - established_
timeout int - forward_
port int - gzip bool
- health_
check str - health_
check_ intconnect_ port - health_
check_ strdomain - health_
check_ strhttp_ code - health_
check_ intinterval - health_
check_ strmethod - health_
check_ inttimeout - health_
check_ strtype - health_
check_ struri - healthy_
threshold int - idle_
timeout int - lb_
port int - lb_
protocol str - listener_
forward str - master_
slave_ strserver_ group_ id - persistence_
timeout int - proxy_
protocol_ boolv2_ enabled - request_
timeout int - scheduler str
- server_
certificate_ strid - server_
group_ strid - ssl_
certificate_ strid - sticky_
session str - sticky_
session_ strtype - tls_
cipher_ strpolicy - unhealthy_
threshold int - x_
forwarded_ Listenerfor XForwarded For Args - Whether to set additional HTTP Header field "X-Forwarded-For".
- frontend
Port Number - load
Balancer StringId - protocol String
- acl
Id String - acl
Status String - acl
Type String - backend
Port Number - bandwidth Number
- ca
Certificate StringId - String
- Number
- delete
Protection BooleanValidation - description String
- enable
Http2 String - established
Timeout Number - forward
Port Number - gzip Boolean
- health
Check String - health
Check NumberConnect Port - health
Check StringDomain - health
Check StringHttp Code - health
Check NumberInterval - health
Check StringMethod - health
Check NumberTimeout - health
Check StringType - health
Check StringUri - healthy
Threshold Number - idle
Timeout Number - lb
Port Number - lb
Protocol String - listener
Forward String - master
Slave StringServer Group Id - persistence
Timeout Number - proxy
Protocol BooleanV2Enabled - request
Timeout Number - scheduler String
- server
Certificate StringId - server
Group StringId - ssl
Certificate StringId - sticky
Session String - sticky
Session StringType - tls
Cipher StringPolicy - unhealthy
Threshold Number - x
Forwarded Property MapFor - Whether to set additional HTTP Header field "X-Forwarded-For".
Outputs
All input properties are implicitly available as output properties. Additionally, the Listener resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Listener Resource
Get an existing Listener resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ListenerState, opts?: CustomResourceOptions): Listener
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
acl_id: Optional[str] = None,
acl_status: Optional[str] = None,
acl_type: Optional[str] = None,
backend_port: Optional[int] = None,
bandwidth: Optional[int] = None,
ca_certificate_id: Optional[str] = None,
cookie: Optional[str] = None,
cookie_timeout: Optional[int] = None,
delete_protection_validation: Optional[bool] = None,
description: Optional[str] = None,
enable_http2: Optional[str] = None,
established_timeout: Optional[int] = None,
forward_port: Optional[int] = None,
frontend_port: Optional[int] = None,
gzip: Optional[bool] = None,
health_check: Optional[str] = None,
health_check_connect_port: Optional[int] = None,
health_check_domain: Optional[str] = None,
health_check_http_code: Optional[str] = None,
health_check_interval: Optional[int] = None,
health_check_method: Optional[str] = None,
health_check_timeout: Optional[int] = None,
health_check_type: Optional[str] = None,
health_check_uri: Optional[str] = None,
healthy_threshold: Optional[int] = None,
idle_timeout: Optional[int] = None,
lb_port: Optional[int] = None,
lb_protocol: Optional[str] = None,
listener_forward: Optional[str] = None,
load_balancer_id: Optional[str] = None,
master_slave_server_group_id: Optional[str] = None,
persistence_timeout: Optional[int] = None,
protocol: Optional[str] = None,
proxy_protocol_v2_enabled: Optional[bool] = None,
request_timeout: Optional[int] = None,
scheduler: Optional[str] = None,
server_certificate_id: Optional[str] = None,
server_group_id: Optional[str] = None,
ssl_certificate_id: Optional[str] = None,
sticky_session: Optional[str] = None,
sticky_session_type: Optional[str] = None,
tls_cipher_policy: Optional[str] = None,
unhealthy_threshold: Optional[int] = None,
x_forwarded_for: Optional[ListenerXForwardedForArgs] = None) -> Listener
func GetListener(ctx *Context, name string, id IDInput, state *ListenerState, opts ...ResourceOption) (*Listener, error)
public static Listener Get(string name, Input<string> id, ListenerState? state, CustomResourceOptions? opts = null)
public static Listener get(String name, Output<String> id, ListenerState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Acl
Id string - Acl
Status string - Acl
Type string - Backend
Port int - Bandwidth int
- Ca
Certificate stringId - string
- int
- Delete
Protection boolValidation - Description string
- Enable
Http2 string - Established
Timeout int - Forward
Port int - Frontend
Port int - Gzip bool
- Health
Check string - Health
Check intConnect Port - Health
Check stringDomain - Health
Check stringHttp Code - Health
Check intInterval - Health
Check stringMethod - Health
Check intTimeout - Health
Check stringType - Health
Check stringUri - Healthy
Threshold int - Idle
Timeout int - Lb
Port int - Lb
Protocol string - Listener
Forward string - Load
Balancer stringId - Master
Slave stringServer Group Id - Persistence
Timeout int - Protocol string
- Proxy
Protocol boolV2Enabled - Request
Timeout int - Scheduler string
- Server
Certificate stringId - Server
Group stringId - Ssl
Certificate stringId - Sticky
Session string - Sticky
Session stringType - Tls
Cipher stringPolicy - Unhealthy
Threshold int - XForwarded
For Pulumi.Ali Cloud. Slb. Inputs. Listener XForwarded For - Whether to set additional HTTP Header field "X-Forwarded-For".
- Acl
Id string - Acl
Status string - Acl
Type string - Backend
Port int - Bandwidth int
- Ca
Certificate stringId - string
- int
- Delete
Protection boolValidation - Description string
- Enable
Http2 string - Established
Timeout int - Forward
Port int - Frontend
Port int - Gzip bool
- Health
Check string - Health
Check intConnect Port - Health
Check stringDomain - Health
Check stringHttp Code - Health
Check intInterval - Health
Check stringMethod - Health
Check intTimeout - Health
Check stringType - Health
Check stringUri - Healthy
Threshold int - Idle
Timeout int - Lb
Port int - Lb
Protocol string - Listener
Forward string - Load
Balancer stringId - Master
Slave stringServer Group Id - Persistence
Timeout int - Protocol string
- Proxy
Protocol boolV2Enabled - Request
Timeout int - Scheduler string
- Server
Certificate stringId - Server
Group stringId - Ssl
Certificate stringId - Sticky
Session string - Sticky
Session stringType - Tls
Cipher stringPolicy - Unhealthy
Threshold int - XForwarded
For ListenerXForwarded For Args - Whether to set additional HTTP Header field "X-Forwarded-For".
- acl
Id String - acl
Status String - acl
Type String - backend
Port Integer - bandwidth Integer
- ca
Certificate StringId - String
- Integer
- delete
Protection BooleanValidation - description String
- enable
Http2 String - established
Timeout Integer - forward
Port Integer - frontend
Port Integer - gzip Boolean
- health
Check String - health
Check IntegerConnect Port - health
Check StringDomain - health
Check StringHttp Code - health
Check IntegerInterval - health
Check StringMethod - health
Check IntegerTimeout - health
Check StringType - health
Check StringUri - healthy
Threshold Integer - idle
Timeout Integer - lb
Port Integer - lb
Protocol String - listener
Forward String - load
Balancer StringId - master
Slave StringServer Group Id - persistence
Timeout Integer - protocol String
- proxy
Protocol BooleanV2Enabled - request
Timeout Integer - scheduler String
- server
Certificate StringId - server
Group StringId - ssl
Certificate StringId - sticky
Session String - sticky
Session StringType - tls
Cipher StringPolicy - unhealthy
Threshold Integer - x
Forwarded ListenerFor XForwarded For - Whether to set additional HTTP Header field "X-Forwarded-For".
- acl
Id string - acl
Status string - acl
Type string - backend
Port number - bandwidth number
- ca
Certificate stringId - string
- number
- delete
Protection booleanValidation - description string
- enable
Http2 string - established
Timeout number - forward
Port number - frontend
Port number - gzip boolean
- health
Check string - health
Check numberConnect Port - health
Check stringDomain - health
Check stringHttp Code - health
Check numberInterval - health
Check stringMethod - health
Check numberTimeout - health
Check stringType - health
Check stringUri - healthy
Threshold number - idle
Timeout number - lb
Port number - lb
Protocol string - listener
Forward string - load
Balancer stringId - master
Slave stringServer Group Id - persistence
Timeout number - protocol string
- proxy
Protocol booleanV2Enabled - request
Timeout number - scheduler string
- server
Certificate stringId - server
Group stringId - ssl
Certificate stringId - sticky
Session string - sticky
Session stringType - tls
Cipher stringPolicy - unhealthy
Threshold number - x
Forwarded ListenerFor XForwarded For - Whether to set additional HTTP Header field "X-Forwarded-For".
- acl_
id str - acl_
status str - acl_
type str - backend_
port int - bandwidth int
- ca_
certificate_ strid - str
- int
- delete_
protection_ boolvalidation - description str
- enable_
http2 str - established_
timeout int - forward_
port int - frontend_
port int - gzip bool
- health_
check str - health_
check_ intconnect_ port - health_
check_ strdomain - health_
check_ strhttp_ code - health_
check_ intinterval - health_
check_ strmethod - health_
check_ inttimeout - health_
check_ strtype - health_
check_ struri - healthy_
threshold int - idle_
timeout int - lb_
port int - lb_
protocol str - listener_
forward str - load_
balancer_ strid - master_
slave_ strserver_ group_ id - persistence_
timeout int - protocol str
- proxy_
protocol_ boolv2_ enabled - request_
timeout int - scheduler str
- server_
certificate_ strid - server_
group_ strid - ssl_
certificate_ strid - sticky_
session str - sticky_
session_ strtype - tls_
cipher_ strpolicy - unhealthy_
threshold int - x_
forwarded_ Listenerfor XForwarded For Args - Whether to set additional HTTP Header field "X-Forwarded-For".
- acl
Id String - acl
Status String - acl
Type String - backend
Port Number - bandwidth Number
- ca
Certificate StringId - String
- Number
- delete
Protection BooleanValidation - description String
- enable
Http2 String - established
Timeout Number - forward
Port Number - frontend
Port Number - gzip Boolean
- health
Check String - health
Check NumberConnect Port - health
Check StringDomain - health
Check StringHttp Code - health
Check NumberInterval - health
Check StringMethod - health
Check NumberTimeout - health
Check StringType - health
Check StringUri - healthy
Threshold Number - idle
Timeout Number - lb
Port Number - lb
Protocol String - listener
Forward String - load
Balancer StringId - master
Slave StringServer Group Id - persistence
Timeout Number - protocol String
- proxy
Protocol BooleanV2Enabled - request
Timeout Number - scheduler String
- server
Certificate StringId - server
Group StringId - ssl
Certificate StringId - sticky
Session String - sticky
Session StringType - tls
Cipher StringPolicy - unhealthy
Threshold Number - x
Forwarded Property MapFor - Whether to set additional HTTP Header field "X-Forwarded-For".
Supporting Types
ListenerXForwardedFor, ListenerXForwardedForArgs
- Retrive
Client boolIp - Whether to retrieve the client ip.
- Retrive
Slb boolId - Indicates whether the SLB-ID header is used to retrieve the ID of the CLB instance. Default value:
false
. Valid values:true
,false
. - Retrive
Slb boolIp - Indicates whether the SLB-IP header is used to retrieve the virtual IP address (VIP) requested by the client. Default value:
false
. Valid values:true
,false
. - Retrive
Slb boolProto - Specifies whether to use the X-Forwarded-Proto header to retrieve the listener protocol. Default value:
false
. Valid values:true
,false
.
- Retrive
Client boolIp - Whether to retrieve the client ip.
- Retrive
Slb boolId - Indicates whether the SLB-ID header is used to retrieve the ID of the CLB instance. Default value:
false
. Valid values:true
,false
. - Retrive
Slb boolIp - Indicates whether the SLB-IP header is used to retrieve the virtual IP address (VIP) requested by the client. Default value:
false
. Valid values:true
,false
. - Retrive
Slb boolProto - Specifies whether to use the X-Forwarded-Proto header to retrieve the listener protocol. Default value:
false
. Valid values:true
,false
.
- retrive
Client BooleanIp - Whether to retrieve the client ip.
- retrive
Slb BooleanId - Indicates whether the SLB-ID header is used to retrieve the ID of the CLB instance. Default value:
false
. Valid values:true
,false
. - retrive
Slb BooleanIp - Indicates whether the SLB-IP header is used to retrieve the virtual IP address (VIP) requested by the client. Default value:
false
. Valid values:true
,false
. - retrive
Slb BooleanProto - Specifies whether to use the X-Forwarded-Proto header to retrieve the listener protocol. Default value:
false
. Valid values:true
,false
.
- retrive
Client booleanIp - Whether to retrieve the client ip.
- retrive
Slb booleanId - Indicates whether the SLB-ID header is used to retrieve the ID of the CLB instance. Default value:
false
. Valid values:true
,false
. - retrive
Slb booleanIp - Indicates whether the SLB-IP header is used to retrieve the virtual IP address (VIP) requested by the client. Default value:
false
. Valid values:true
,false
. - retrive
Slb booleanProto - Specifies whether to use the X-Forwarded-Proto header to retrieve the listener protocol. Default value:
false
. Valid values:true
,false
.
- retrive_
client_ boolip - Whether to retrieve the client ip.
- retrive_
slb_ boolid - Indicates whether the SLB-ID header is used to retrieve the ID of the CLB instance. Default value:
false
. Valid values:true
,false
. - retrive_
slb_ boolip - Indicates whether the SLB-IP header is used to retrieve the virtual IP address (VIP) requested by the client. Default value:
false
. Valid values:true
,false
. - retrive_
slb_ boolproto - Specifies whether to use the X-Forwarded-Proto header to retrieve the listener protocol. Default value:
false
. Valid values:true
,false
.
- retrive
Client BooleanIp - Whether to retrieve the client ip.
- retrive
Slb BooleanId - Indicates whether the SLB-ID header is used to retrieve the ID of the CLB instance. Default value:
false
. Valid values:true
,false
. - retrive
Slb BooleanIp - Indicates whether the SLB-IP header is used to retrieve the virtual IP address (VIP) requested by the client. Default value:
false
. Valid values:true
,false
. - retrive
Slb BooleanProto - Specifies whether to use the X-Forwarded-Proto header to retrieve the listener protocol. Default value:
false
. Valid values:true
,false
.
Import
Classic Load Balancer (SLB) Load Balancer Listener can be imported using the id, e.g.
$ pulumi import alicloud:slb/listener:Listener example <load_balancer_id>:<protocol>:<frontend_port>
$ pulumi import alicloud:slb/listener:Listener example <load_balancer_id>:<frontend_port>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.