This page documents the language specification for the alicloud package. If you're looking for help working with the inputs, outputs, or functions of alicloud resources in a Pulumi program, please see the resource documentation for examples and API reference.

slb

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-alicloud repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-alicloud repo.

class pulumi_alicloud.slb.Acl(resource_name, opts=None, entry_lists=None, ip_version=None, name=None, resource_group_id=None, tags=None, __props__=None, __name__=None, __opts__=None)

Create a Acl resource with the given unique name, props, and options. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[list] entry_lists: A list of entry (IP addresses or CIDR blocks) to be added. At most 50 etnry can be supported in one resource. It contains two sub-fields as Entry Block follows. :param pulumi.Input[str] ip_version: The IP Version of access control list is the type of its entry (IP addresses or CIDR blocks). It values ipv4/ipv6. Our plugin provides a default ip_version: “ipv4”. :param pulumi.Input[str] name: Name of the access control list. :param pulumi.Input[str] resource_group_id: Resource group ID. :param pulumi.Input[dict] tags: A mapping of tags to assign to the resource.

The entry_lists object supports the following:

  • comment (pulumi.Input[str])

  • entry (pulumi.Input[str])

entry_lists: pulumi.Output[list] = None

A list of entry (IP addresses or CIDR blocks) to be added. At most 50 etnry can be supported in one resource. It contains two sub-fields as Entry Block follows.

  • comment (str)

  • entry (str)

ip_version: pulumi.Output[str] = None

The IP Version of access control list is the type of its entry (IP addresses or CIDR blocks). It values ipv4/ipv6. Our plugin provides a default ip_version: “ipv4”.

name: pulumi.Output[str] = None

Name of the access control list.

resource_group_id: pulumi.Output[str] = None

Resource group ID.

tags: pulumi.Output[dict] = None

A mapping of tags to assign to the resource.

static get(resource_name, id, opts=None, entry_lists=None, ip_version=None, name=None, resource_group_id=None, tags=None)

Get an existing Acl resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • entry_lists (pulumi.Input[list]) – A list of entry (IP addresses or CIDR blocks) to be added. At most 50 etnry can be supported in one resource. It contains two sub-fields as Entry Block follows.

  • ip_version (pulumi.Input[str]) – The IP Version of access control list is the type of its entry (IP addresses or CIDR blocks). It values ipv4/ipv6. Our plugin provides a default ip_version: “ipv4”.

  • name (pulumi.Input[str]) – Name of the access control list.

  • resource_group_id (pulumi.Input[str]) – Resource group ID.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

The entry_lists object supports the following:

  • comment (pulumi.Input[str])

  • entry (pulumi.Input[str])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.slb.Attachment(resource_name, opts=None, backend_servers=None, delete_protection_validation=None, instance_ids=None, load_balancer_id=None, server_type=None, weight=None, __props__=None, __name__=None, __opts__=None)

Create a Attachment resource with the given unique name, props, and options. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] backend_servers: The backend servers of the load balancer. :param pulumi.Input[bool] delete_protection_validation: Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false. :param pulumi.Input[list] instance_ids: A list of instance ids to added backend server in the SLB. :param pulumi.Input[str] load_balancer_id: ID of the load balancer. :param pulumi.Input[str] server_type: Type of the instances. Valid value ecs, eni. Default to ecs. :param pulumi.Input[float] weight: Weight of the instances. Valid value range: [0-100]. Default to 100.

backend_servers: pulumi.Output[str] = None

The backend servers of the load balancer.

delete_protection_validation: pulumi.Output[bool] = None

Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

instance_ids: pulumi.Output[list] = None

A list of instance ids to added backend server in the SLB.

load_balancer_id: pulumi.Output[str] = None

ID of the load balancer.

server_type: pulumi.Output[str] = None

Type of the instances. Valid value ecs, eni. Default to ecs.

weight: pulumi.Output[float] = None

Weight of the instances. Valid value range: [0-100]. Default to 100.

static get(resource_name, id, opts=None, backend_servers=None, delete_protection_validation=None, instance_ids=None, load_balancer_id=None, server_type=None, weight=None)

Get an existing Attachment resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • backend_servers (pulumi.Input[str]) – The backend servers of the load balancer.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • instance_ids (pulumi.Input[list]) – A list of instance ids to added backend server in the SLB.

  • load_balancer_id (pulumi.Input[str]) – ID of the load balancer.

  • server_type (pulumi.Input[str]) – Type of the instances. Valid value ecs, eni. Default to ecs.

  • weight (pulumi.Input[float]) – Weight of the instances. Valid value range: [0-100]. Default to 100.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.slb.AwaitableGetAclsResult(acls=None, id=None, ids=None, name_regex=None, names=None, output_file=None, resource_group_id=None, tags=None)
class pulumi_alicloud.slb.AwaitableGetAttachmentsResult(id=None, instance_ids=None, load_balancer_id=None, output_file=None, slb_attachments=None)
class pulumi_alicloud.slb.AwaitableGetBackendServersResult(backend_servers=None, id=None, ids=None, load_balancer_id=None, output_file=None)
class pulumi_alicloud.slb.AwaitableGetCaCertificatesResult(certificates=None, id=None, ids=None, name_regex=None, names=None, output_file=None, resource_group_id=None, tags=None)
class pulumi_alicloud.slb.AwaitableGetDomainExtensionsResult(extensions=None, frontend_port=None, id=None, ids=None, load_balancer_id=None, output_file=None)
class pulumi_alicloud.slb.AwaitableGetListenersResult(description_regex=None, frontend_port=None, id=None, load_balancer_id=None, output_file=None, protocol=None, slb_listeners=None)
class pulumi_alicloud.slb.AwaitableGetLoadBalancersResult(address=None, id=None, ids=None, master_availability_zone=None, name_regex=None, names=None, network_type=None, output_file=None, resource_group_id=None, slave_availability_zone=None, slbs=None, tags=None, vpc_id=None, vswitch_id=None)
class pulumi_alicloud.slb.AwaitableGetMasterSlaveServerGroupsResult(groups=None, id=None, ids=None, load_balancer_id=None, name_regex=None, names=None, output_file=None)
class pulumi_alicloud.slb.AwaitableGetRulesResult(frontend_port=None, id=None, ids=None, load_balancer_id=None, name_regex=None, names=None, output_file=None, slb_rules=None)
class pulumi_alicloud.slb.AwaitableGetServerCertificatesResult(certificates=None, id=None, ids=None, name_regex=None, names=None, output_file=None, resource_group_id=None, tags=None)
class pulumi_alicloud.slb.AwaitableGetServerGroupsResult(id=None, ids=None, load_balancer_id=None, name_regex=None, names=None, output_file=None, slb_server_groups=None)
class pulumi_alicloud.slb.AwaitableGetZonesResult(available_slb_address_ip_version=None, available_slb_address_type=None, enable_details=None, id=None, ids=None, output_file=None, zones=None)
class pulumi_alicloud.slb.BackendServer(resource_name, opts=None, backend_servers=None, delete_protection_validation=None, load_balancer_id=None, __props__=None, __name__=None, __opts__=None)

Add a group of backend servers (ECS or ENI instance) to the Server Load Balancer or remove them from it.

NOTE: Available in 1.53.0+

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "slbbackendservertest"
default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
    available_resource_creation="VSwitch")
default_instance_types = alicloud.ecs.get_instance_types(availability_zone=default_zones.zones[0]["id"],
    cpu_core_count=1,
    memory_size=2)
default_images = alicloud.ecs.get_images(most_recent=True,
    name_regex="^ubuntu_18.*64",
    owners="system")
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/16",
    vpc_id=default_network.id)
default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup", vpc_id=default_network.id)
default_instance = []
for range in [{"value": i} for i in range(0, 2)]:
    default_instance.append(alicloud.ecs.Instance(f"defaultInstance-{range['value']}",
        availability_zone=default_zones.zones[0]["id"],
        image_id=default_images.images[0]["id"],
        instance_charge_type="PostPaid",
        instance_name=name,
        instance_type=default_instance_types.instance_types[0]["id"],
        internet_charge_type="PayByTraffic",
        internet_max_bandwidth_out="10",
        security_groups=[__item.id for __item in [default_security_group]],
        system_disk_category="cloud_efficiency",
        vswitch_id=default_switch.id))
default_load_balancer = alicloud.slb.LoadBalancer("defaultLoadBalancer", vswitch_id=default_switch.id)
default_backend_server = alicloud.slb.BackendServer("defaultBackendServer",
    backend_servers=[
        {
            "serverId": default_instance[0].id,
            "weight": 100,
        },
        {
            "serverId": default_instance[1].id,
            "weight": 100,
        },
    ],
    load_balancer_id=default_load_balancer.id)

The servers mapping supports the following:

  • server_id - (Required) A list backend server ID (ECS instance ID).

  • weight - (Optional) Weight of the backend server. Valid value range: [0-100].

  • type - (Optional) Type of the backend server. Valid value ecs, eni. Default to eni.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • backend_servers (pulumi.Input[list]) – A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • load_balancer_id (pulumi.Input[str]) – ID of the load balancer.

The backend_servers object supports the following:

  • serverId (pulumi.Input[str])

  • type (pulumi.Input[str])

  • weight (pulumi.Input[float])

backend_servers: pulumi.Output[list] = None

A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.

  • serverId (str)

  • type (str)

  • weight (float)

delete_protection_validation: pulumi.Output[bool] = None

Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

load_balancer_id: pulumi.Output[str] = None

ID of the load balancer.

static get(resource_name, id, opts=None, backend_servers=None, delete_protection_validation=None, load_balancer_id=None)

Get an existing BackendServer resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • backend_servers (pulumi.Input[list]) – A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • load_balancer_id (pulumi.Input[str]) – ID of the load balancer.

The backend_servers object supports the following:

  • serverId (pulumi.Input[str])

  • type (pulumi.Input[str])

  • weight (pulumi.Input[float])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.slb.CaCertificate(resource_name, opts=None, ca_certificate=None, name=None, resource_group_id=None, tags=None, __props__=None, __name__=None, __opts__=None)

A Load Balancer CA Certificate is used by the listener of the protocol https.

For information about slb and how to use it, see What is Server Load Balancer.

For information about CA Certificate and how to use it, see Configure CA Certificate.

import pulumi
import pulumi_alicloud as alicloud

# create a CA certificate
foo = alicloud.slb.CaCertificate("foo", ca_certificate="""-----BEGIN CERTIFICATE-----
MIIDRjCCAq+gAwIBAgIJAJnI******90EAxEG/bJJyOm5LqoiA=
-----END CERTIFICATE-----
""")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • ca_certificate (pulumi.Input[str]) – the content of the CA certificate.

  • name (pulumi.Input[str]) – Name of the CA Certificate.

  • resource_group_id (pulumi.Input[str]) – The Id of resource group which the slb_ca certificate belongs.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

ca_certificate: pulumi.Output[str] = None

the content of the CA certificate.

name: pulumi.Output[str] = None

Name of the CA Certificate.

resource_group_id: pulumi.Output[str] = None

The Id of resource group which the slb_ca certificate belongs.

tags: pulumi.Output[dict] = None

A mapping of tags to assign to the resource.

static get(resource_name, id, opts=None, ca_certificate=None, name=None, resource_group_id=None, tags=None)

Get an existing CaCertificate resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • ca_certificate (pulumi.Input[str]) – the content of the CA certificate.

  • name (pulumi.Input[str]) – Name of the CA Certificate.

  • resource_group_id (pulumi.Input[str]) – The Id of resource group which the slb_ca certificate belongs.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.slb.DomainExtension(resource_name, opts=None, delete_protection_validation=None, domain=None, frontend_port=None, load_balancer_id=None, server_certificate_id=None, __props__=None, __name__=None, __opts__=None)

HTTPS listeners of guaranteed-performance SLB support configuring multiple certificates, allowing you to forward requests with different domain names to different backend servers. Please refer to the documentation for details.

NOTE: Available in 1.60.0+

NOTE: The instance with shared loadBalancerSpec doesn’t support domainExtension.

import pulumi
import pulumi_alicloud as alicloud

instance = alicloud.slb.LoadBalancer("instance",
    internet="true",
    internet_charge_type="PayByTraffic")
foo = alicloud.slb.ServerCertificate("foo",
    private_key="""-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAyjCheapjf7qDI3R9w/Gj0XFDgNLPK2aWIRvM25BdY/IB2KAf
xQ7zOxu3X1bMo2zMCzsSrwIVrxx0qRM/7e4AfkHcKwDIjCcBprQp164dhFol4GpT
HtcuGv0+Ue6vpuE9cxQE3/pG5x1n5EhheFu2+lAaGh/vUrUPeQp6szX/9qfzn+/k
tF8wsRV8PBiFc2ZNMRXupRyc2qtOn95r86w/uK6TuerU1L64E2P5+tYLBWT+39Ai
diUIenjURThFEn8Srvw8v/iLEMaKwiWNkOfWQH96166gzddOI8PT5cJy5an2c90T
DgzegVo8RPK70bU9KjH7gH79YIwXVmTdIVGAUQIDAQABAoIBAE1J4a/8biR5S3/W
G+03BYQeY8tuyjqw8FqfoeOcf9agwAvqybouSNQjeCk9qOQfxq/UWQQFK/zQR9gJ
v7pX7GBXFK5rkj3g+0SaQhRsPmRFgY0Tl8qGPt2aSKRRNVv5ZeADmwlzRn86QmiF
Mp0rkfqFfDTYWEepZszCML0ouzuxsW/9tq7rvtSjsgATNt31B3vFa3D3JBi31jUh
5nfR9A3bATze7mQw3byEDiVl5ASRDgYyur403P1fDnMy9DBHZ8NaPOsFF6OBpJal
BJsG5z00hll5PFN2jfmBQKlvAeU7wfwqdaSnGHOfqf2DeTTaFjIQ4gUhRn/m6pLo
6kXttLECgYEA9sng0Qz/TcPFfM4tQ1gyvB1cKnnGIwg1FP8sfUjbbEgjaHhA224S
k3BxtX2Kq6fhTXuwusAFc6OVMAZ76FgrQ5K4Ci7+DTsrF28z4b8td+p+lO/DxgP9
lTgN+ddsiTOV4fUef9Z3yY0Zr0CnBUMbQYRaV2UIbCdiB0G4V/bt9TsCgYEA0bya
Oo9wGI0RJV0bYP7qwO74Ra1/i1viWbRlS7jU37Q+AZstrlKcQ5CTPzOjKFKMiUzl
4miWacZ0/q2n+Mvd7NbXGXTLijahnyOYKaHJYyh4oBymfkgAifRstE0Ki9gdvArb
/I+emC0GvLSyfGN8UUeDJs4NmqdEXGqjo2JOV+MCgYALFv1MR5o9Y1u/hQBRs2fs
PiGDIx+9OUQxYloccyaxEfjNXAIGGkcpavchIbgWiJ++PJ2vdquIC8TLeK8evL+M
9M3iX0Q5UfxYvD2HmnCvn9D6Xl/cyRcfGnq+TGjrLW9BzSMGuZt+aiHKV0xqFx7l
bc4leTvMqGRmURS4lzcQOwKBgQCDzA/i4sYfN25h21tcHXSpnsG3D2rJyQi5NCo/
ZjunA92/JqOTGuiFcLGHEszhhtY3ZXJET1LNz18vtzKJnpqrvOnYXlOVW/U+SqDQ
8JDb1c/PVZGuY1KrXkR9HLiW3kz5IJ3S3PFdUVYdeTN8BQxXCyg4V12nJJtJs912
y0zN3wKBgGDS6YttCN6aI4EOABYE8fI1EYQ7vhfiYsaWGWSR1l6bQey7KR6M1ACz
ZzMASNyytVt12yXE4/Emv6/pYqigbDLfL1zQJSLJ3EHJYTh2RxjR+AaGDudYFG/T
liQ9YXhV5Iu2x1pNwrtFnssDdaaGpfA7l3xC00BL7Z+SAJyI4QKA
-----END RSA PRIVATE KEY-----
""",
    server_certificate="""-----BEGIN CERTIFICATE-----
MIIDdjCCAl4CCQCcm+erkcKN7DANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJj
bjELMAkGA1UECAwCYmoxEDAOBgNVBAcMB2JlaWppbmcxDzANBgNVBAoMBmFsaXl1
bjELMAkGA1UECwwCc2MxFTATBgNVBAMMDHd3dy50ZXN0LmNvbTEaMBgGCSqGSIb3
DQEJARYLMTIzQDEyMy5jb20wHhcNMTkwNDI2MDM0ODAxWhcNMjQwNDI1MDM0ODAx
WjB9MQswCQYDVQQGEwJjbjELMAkGA1UECAwCYmoxEDAOBgNVBAcMB2JlaWppbmcx
DzANBgNVBAoMBmFsaXl1bjELMAkGA1UECwwCc2MxFTATBgNVBAMMDHd3dy50ZXN0
LmNvbTEaMBgGCSqGSIb3DQEJARYLMTIzQDEyMy5jb20wggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDKMKF5qmN/uoMjdH3D8aPRcUOA0s8rZpYhG8zbkF1j
8gHYoB/FDvM7G7dfVsyjbMwLOxKvAhWvHHSpEz/t7gB+QdwrAMiMJwGmtCnXrh2E
WiXgalMe1y4a/T5R7q+m4T1zFATf+kbnHWfkSGF4W7b6UBoaH+9StQ95CnqzNf/2
p/Of7+S0XzCxFXw8GIVzZk0xFe6lHJzaq06f3mvzrD+4rpO56tTUvrgTY/n61gsF
ZP7f0CJ2JQh6eNRFOEUSfxKu/Dy/+IsQxorCJY2Q59ZAf3rXrqDN104jw9PlwnLl
qfZz3RMODN6BWjxE8rvRtT0qMfuAfv1gjBdWZN0hUYBRAgMBAAEwDQYJKoZIhvcN
AQELBQADggEBAABzo82TxGp5poVkd5pLWj5ACgcBv8Cs6oH9D+4Jz9BmyuBUsQXh
2aG0hQAe1mU61C9konsl/GTW8umJQ4M4lYEztXXwMf5PlBMGwebM0ZbSGg6jKtZg
WCgJ3eP/FMmyXGL5Jji5+e09eObhUDVle4tdi0On97zBoz85W02rgWFAqZJwiEAP
t+c7jX7uOSBq2/38iGStlrX5yB1at/gJXXiA5CL5OtlR3Okvb0/QH37efO1Nu39m
lFi0ODPAVyXjVypAiLguDxPn6AtDTdk9Iw9B19OD4NrzNRWgSSX5vuxo/VcRcgWk
3gEe9Ca0ZKN20q9XgthAiFFjl1S9ZgdA6Zc=
-----END CERTIFICATE-----
""")
https = alicloud.slb.Listener("https",
    backend_port=80,
    bandwidth=10,
    cookie="testslblistenercookie",
    cookie_timeout=86400,
    frontend_port=443,
    health_check="on",
    health_check_connect_port=20,
    health_check_http_code="http_2xx,http_3xx",
    health_check_interval=5,
    health_check_timeout=8,
    health_check_uri="/cons",
    healthy_threshold=8,
    load_balancer_id=instance.id,
    protocol="https",
    ssl_certificate_id=foo.id,
    sticky_session="on",
    sticky_session_type="insert",
    unhealthy_threshold=8)
example1 = alicloud.slb.DomainExtension("example1",
    domain="www.test.com",
    frontend_port=https.frontend_port,
    load_balancer_id=instance.id,
    server_certificate_id=foo.id)
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • domain (pulumi.Input[str]) – The domain name,

  • frontend_port (pulumi.Input[float]) – The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.

  • load_balancer_id (pulumi.Input[str]) – The ID of the SLB instance.

  • server_certificate_id (pulumi.Input[str]) – The ID of the certificate used by the domain name.

delete_protection_validation: pulumi.Output[bool] = None

Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

domain: pulumi.Output[str] = None

The domain name,

frontend_port: pulumi.Output[float] = None

The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.

load_balancer_id: pulumi.Output[str] = None

The ID of the SLB instance.

server_certificate_id: pulumi.Output[str] = None

The ID of the certificate used by the domain name.

static get(resource_name, id, opts=None, delete_protection_validation=None, domain=None, frontend_port=None, load_balancer_id=None, server_certificate_id=None)

Get an existing DomainExtension resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • domain (pulumi.Input[str]) – The domain name,

  • frontend_port (pulumi.Input[float]) – The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.

  • load_balancer_id (pulumi.Input[str]) – The ID of the SLB instance.

  • server_certificate_id (pulumi.Input[str]) – The ID of the certificate used by the domain name.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.slb.GetAclsResult(acls=None, id=None, ids=None, name_regex=None, names=None, output_file=None, resource_group_id=None, tags=None)

A collection of values returned by getAcls.

acls = None

A list of SLB acls. Each element contains the following attributes:

id = None

The provider-assigned unique ID for this managed resource.

ids = None

A list of SLB acls IDs.

names = None

A list of SLB acls names.

resource_group_id = None

Resource group ID.

tags = None

A mapping of tags to assign to the resource.

class pulumi_alicloud.slb.GetAttachmentsResult(id=None, instance_ids=None, load_balancer_id=None, output_file=None, slb_attachments=None)

A collection of values returned by getAttachments.

id = None

The provider-assigned unique ID for this managed resource.

slb_attachments = None

A list of SLB attachments. Each element contains the following attributes:

class pulumi_alicloud.slb.GetBackendServersResult(backend_servers=None, id=None, ids=None, load_balancer_id=None, output_file=None)

A collection of values returned by getBackendServers.

id = None

The provider-assigned unique ID for this managed resource.

class pulumi_alicloud.slb.GetCaCertificatesResult(certificates=None, id=None, ids=None, name_regex=None, names=None, output_file=None, resource_group_id=None, tags=None)

A collection of values returned by getCaCertificates.

certificates = None

A list of SLB ca certificates. Each element contains the following attributes:

id = None

The provider-assigned unique ID for this managed resource.

ids = None

A list of SLB ca certificates IDs.

names = None

A list of SLB ca certificates names.

resource_group_id = None

The resource group Id of CA certificate.

tags = None

(Available in v1.66.0+) A mapping of tags to assign to the resource.

class pulumi_alicloud.slb.GetDomainExtensionsResult(extensions=None, frontend_port=None, id=None, ids=None, load_balancer_id=None, output_file=None)

A collection of values returned by getDomainExtensions.

extensions = None

A list of SLB domain extension. Each element contains the following attributes:

id = None

The provider-assigned unique ID for this managed resource.

class pulumi_alicloud.slb.GetListenersResult(description_regex=None, frontend_port=None, id=None, load_balancer_id=None, output_file=None, protocol=None, slb_listeners=None)

A collection of values returned by getListeners.

frontend_port = None

Frontend port used to receive incoming traffic and distribute it to the backend servers.

id = None

The provider-assigned unique ID for this managed resource.

protocol = None

Listener protocol. Possible values: http, https, tcp and udp.

slb_listeners = None

A list of SLB listeners. Each element contains the following attributes:

class pulumi_alicloud.slb.GetLoadBalancersResult(address=None, id=None, ids=None, master_availability_zone=None, name_regex=None, names=None, network_type=None, output_file=None, resource_group_id=None, slave_availability_zone=None, slbs=None, tags=None, vpc_id=None, vswitch_id=None)

A collection of values returned by getLoadBalancers.

address = None

Service address of the SLB.

id = None

The provider-assigned unique ID for this managed resource.

ids = None

A list of slb IDs.

master_availability_zone = None

Master availability zone of the SLBs.

names = None

A list of slb names.

network_type = None

Network type of the SLB. Possible values: vpc and classic.

slave_availability_zone = None

Slave availability zone of the SLBs.

slbs = None

A list of SLBs. Each element contains the following attributes:

tags = None

A map of tags assigned to the SLB instance.

vpc_id = None

ID of the VPC the SLB belongs to.

vswitch_id = None

ID of the VSwitch the SLB belongs to.

class pulumi_alicloud.slb.GetMasterSlaveServerGroupsResult(groups=None, id=None, ids=None, load_balancer_id=None, name_regex=None, names=None, output_file=None)

A collection of values returned by getMasterSlaveServerGroups.

groups = None

A list of SLB master slave server groups. Each element contains the following attributes:

id = None

The provider-assigned unique ID for this managed resource.

ids = None

A list of SLB master slave server groups IDs.

names = None

A list of SLB master slave server groups names.

class pulumi_alicloud.slb.GetRulesResult(frontend_port=None, id=None, ids=None, load_balancer_id=None, name_regex=None, names=None, output_file=None, slb_rules=None)

A collection of values returned by getRules.

id = None

The provider-assigned unique ID for this managed resource.

ids = None

A list of SLB listener rules IDs.

names = None

A list of SLB listener rules names.

slb_rules = None

A list of SLB listener rules. Each element contains the following attributes:

class pulumi_alicloud.slb.GetServerCertificatesResult(certificates=None, id=None, ids=None, name_regex=None, names=None, output_file=None, resource_group_id=None, tags=None)

A collection of values returned by getServerCertificates.

certificates = None

A list of SLB server certificates. Each element contains the following attributes:

id = None

The provider-assigned unique ID for this managed resource.

ids = None

A list of SLB server certificates IDs.

names = None

A list of SLB server certificates names.

resource_group_id = None

The Id of resource group which the slb server certificates belongs.

tags = None

(Available in v1.66.0+) A mapping of tags to assign to the resource.

class pulumi_alicloud.slb.GetServerGroupsResult(id=None, ids=None, load_balancer_id=None, name_regex=None, names=None, output_file=None, slb_server_groups=None)

A collection of values returned by getServerGroups.

id = None

The provider-assigned unique ID for this managed resource.

ids = None

A list of SLB VServer groups IDs.

names = None

A list of SLB VServer groups names.

slb_server_groups = None

A list of SLB VServer groups. Each element contains the following attributes:

class pulumi_alicloud.slb.GetZonesResult(available_slb_address_ip_version=None, available_slb_address_type=None, enable_details=None, id=None, ids=None, output_file=None, zones=None)

A collection of values returned by getZones.

id = None

The provider-assigned unique ID for this managed resource.

ids = None

A list of zone IDs.

zones = None

A list of availability zones. Each element contains the following attributes:

class pulumi_alicloud.slb.Listener(resource_name, opts=None, acl_id=None, acl_status=None, acl_type=None, backend_port=None, bandwidth=None, cookie=None, cookie_timeout=None, delete_protection_validation=None, description=None, enable_http2=None, established_timeout=None, forward_port=None, frontend_port=None, gzip=None, health_check=None, health_check_connect_port=None, health_check_domain=None, health_check_http_code=None, health_check_interval=None, health_check_method=None, health_check_timeout=None, health_check_type=None, health_check_uri=None, healthy_threshold=None, idle_timeout=None, instance_port=None, lb_port=None, lb_protocol=None, listener_forward=None, load_balancer_id=None, master_slave_server_group_id=None, persistence_timeout=None, protocol=None, request_timeout=None, scheduler=None, server_certificate_id=None, server_group_id=None, ssl_certificate_id=None, sticky_session=None, sticky_session_type=None, tls_cipher_policy=None, unhealthy_threshold=None, x_forwarded_for=None, __props__=None, __name__=None, __opts__=None)

Provides an Application Load Balancer Listener resource.

For information about slb and how to use it, see What is Server Load Balancer.

For information about listener and how to use it, to see the following:

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "testcreatehttplistener"
ip_version = config.get("ipVersion")
if ip_version is None:
    ip_version = "ipv4"
default_load_balancer = alicloud.slb.LoadBalancer("defaultLoadBalancer",
    internet=True,
    internet_charge_type="PayByTraffic")
default_acl = alicloud.slb.Acl("defaultAcl",
    entry_lists=[
        {
            "comment": "first",
            "entry": "10.10.10.0/24",
        },
        {
            "comment": "second",
            "entry": "168.10.10.0/24",
        },
    ],
    ip_version=ip_version)
default_listener = alicloud.slb.Listener("defaultListener",
    acl_id=default_acl.id,
    acl_status="on",
    acl_type="white",
    backend_port=80,
    bandwidth=10,
    cookie="testslblistenercookie",
    cookie_timeout=86400,
    frontend_port=80,
    health_check="on",
    health_check_connect_port=20,
    health_check_domain="ali.com",
    health_check_http_code="http_2xx,http_3xx",
    health_check_interval=5,
    health_check_timeout=8,
    health_check_uri="/cons",
    healthy_threshold=8,
    idle_timeout=30,
    load_balancer_id=default_load_balancer.id,
    protocol="http",
    request_timeout=80,
    sticky_session="on",
    sticky_session_type="insert",
    unhealthy_threshold=8,
    x_forwarded_for={
        "retriveSlbId": True,
        "retriveSlbIp": True,
    })

load balance support 4 protocal to listen on, they are http,https,tcp,udp, the every listener support which portocal following:

The listener mapping supports the following:

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • acl_id (pulumi.Input[str]) – the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If acl_status is “on”, it is mandatory. Otherwise, it will be ignored.

  • acl_status (pulumi.Input[str]) – Whether to enable “acl(access control list)”, the acl is specified by acl_id. Valid values are on and off. Default to off.

  • acl_type (pulumi.Input[str]) – Mode for handling the acl specified by acl_id. If acl_status is “on”, it is mandatory. Otherwise, it will be ignored. Valid values are white and black. white means the Listener can only be accessed by client ip belongs to the acl; black means the Listener can not be accessed by client ip belongs to the acl.

  • backend_port (pulumi.Input[float]) – Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].

  • bandwidth (pulumi.Input[float]) – Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.

  • cookie (pulumi.Input[str]) – The cookie configured on the server. It is mandatory when sticky_session is “on” and sticky_session_type is “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.

  • cookie_timeout (pulumi.Input[float]) – Cookie timeout. It is mandatory when sticky_session is “on” and sticky_session_type is “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • description (pulumi.Input[str]) – The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.

  • enable_http2 (pulumi.Input[str]) – Whether to enable https listener support http2 or not. Valid values are on and off. Default to on.

  • established_timeout (pulumi.Input[float]) – Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.

  • forward_port (pulumi.Input[float]) – The port that http redirect to https.

  • frontend_port (pulumi.Input[float]) – Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].

  • gzip (pulumi.Input[bool]) – Whether to enable “Gzip Compression”. If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.

  • health_check (pulumi.Input[str]) – Whether to enable health check. Valid values areon and off. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.

  • health_check_connect_port (pulumi.Input[float]) – Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.

  • health_check_domain (pulumi.Input[str]) – Domain name used for health check. When it used to launch TCP listener, health_check_type must be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.

  • health_check_http_code (pulumi.Input[str]) – Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when health_check is on. Default to http_2xx. Valid values are: http_2xx, http_3xx, http_4xx and http_5xx.

  • health_check_interval (pulumi.Input[float]) – Time interval of health checks. It is required when health_check is on. Valid value range: [1-50] in seconds. Default to 2.

  • health_check_method (pulumi.Input[str]) – The method of health check. Valid values: [“head”, “get”].

  • health_check_timeout (pulumi.Input[float]) – Maximum timeout of each health check response. It is required when health_check is on. Valid value range: [1-300] in seconds. Default to 5. Note: If health_check_timeout < health_check_interval, its will be replaced by health_check_interval.

  • health_check_type (pulumi.Input[str]) – Type of health check. Valid values are: tcp and http. Default to tcp . TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.

  • health_check_uri (pulumi.Input[str]) – URI used for health check. When it used to launch TCP listener, health_check_type must be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.

  • healthy_threshold (pulumi.Input[float]) – Threshold determining the result of the health check is success. It is required when health_check is on. Valid value range: [1-10] in seconds. Default to 3.

  • idle_timeout (pulumi.Input[float]) – Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.

  • listener_forward (pulumi.Input[str]) – Whether to enable http redirect to https, Valid values are on and off. Default to off.

  • load_balancer_id (pulumi.Input[str]) – The Load Balancer ID which is used to launch a new listener.

  • persistence_timeout (pulumi.Input[float]) – Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.

  • protocol (pulumi.Input[str]) – The protocol to listen on. Valid values are [http, https, tcp, udp].

  • request_timeout (pulumi.Input[float]) – Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.

  • scheduler (pulumi.Input[str]) – Scheduling algorithm, Valid values are wrr, rr and wlc. Default to “wrr”.

  • server_certificate_id (pulumi.Input[str]) – SLB Server certificate ID. It is required when protocol is https.

  • server_group_id (pulumi.Input[str]) – the id of server group to be apply on the listener, is the id of resource slb.ServerGroup.

  • ssl_certificate_id (pulumi.Input[str]) – It has been deprecated from 1.59.0 and using server_certificate_id instead.

  • sticky_session (pulumi.Input[str]) – Whether to enable session persistence, Valid values are on and off. Default to off.

  • sticky_session_type (pulumi.Input[str]) – Mode for handling the cookie. If sticky_session is “on”, it is mandatory. Otherwise, it will be ignored. Valid values are insert and server. insert means it is inserted from Server Load Balancer; server means the Server Load Balancer learns from the backend server.

  • tls_cipher_policy (pulumi.Input[str]) – Https listener TLS cipher policy. Valid values are tls_cipher_policy_1_0, tls_cipher_policy_1_1, tls_cipher_policy_1_2, tls_cipher_policy_1_2_strict. Default to tls_cipher_policy_1_0. Currently the tls_cipher_policy can not be updated when load balancer instance is “Shared-Performance”.

  • unhealthy_threshold (pulumi.Input[float]) – Threshold determining the result of the health check is fail. It is required when health_check is on. Valid value range: [1-10] in seconds. Default to 3.

  • x_forwarded_for (pulumi.Input[dict]) – Whether to set additional HTTP Header field “X-Forwarded-For” (documented below). Available in v1.13.0+.

The x_forwarded_for object supports the following:

  • retriveClientIp (pulumi.Input[bool])

  • retriveSlbId (pulumi.Input[bool]) - Whether to use the XForwardedFor header to obtain the ID of the SLB instance. Default to false.

  • retriveSlbIp (pulumi.Input[bool]) - Whether to use the XForwardedFor_SLBIP header to obtain the public IP address of the SLB instance. Default to false.

  • retriveSlbProto (pulumi.Input[bool]) - Whether to use the XForwardedFor_proto header to obtain the protocol used by the listener. Default to false.

acl_id: pulumi.Output[str] = None

the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If acl_status is “on”, it is mandatory. Otherwise, it will be ignored.

acl_status: pulumi.Output[str] = None

Whether to enable “acl(access control list)”, the acl is specified by acl_id. Valid values are on and off. Default to off.

acl_type: pulumi.Output[str] = None

Mode for handling the acl specified by acl_id. If acl_status is “on”, it is mandatory. Otherwise, it will be ignored. Valid values are white and black. white means the Listener can only be accessed by client ip belongs to the acl; black means the Listener can not be accessed by client ip belongs to the acl.

backend_port: pulumi.Output[float] = None

Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].

bandwidth: pulumi.Output[float] = None

Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.

cookie: pulumi.Output[str] = None

The cookie configured on the server. It is mandatory when sticky_session is “on” and sticky_session_type is “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.

cookie_timeout: pulumi.Output[float] = None

Cookie timeout. It is mandatory when sticky_session is “on” and sticky_session_type is “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.

delete_protection_validation: pulumi.Output[bool] = None

Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

description: pulumi.Output[str] = None

The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.

enable_http2: pulumi.Output[str] = None

Whether to enable https listener support http2 or not. Valid values are on and off. Default to on.

established_timeout: pulumi.Output[float] = None

Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.

forward_port: pulumi.Output[float] = None

The port that http redirect to https.

frontend_port: pulumi.Output[float] = None

Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].

gzip: pulumi.Output[bool] = None

Whether to enable “Gzip Compression”. If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.

health_check: pulumi.Output[str] = None

Whether to enable health check. Valid values areon and off. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.

health_check_connect_port: pulumi.Output[float] = None

Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.

health_check_domain: pulumi.Output[str] = None

Domain name used for health check. When it used to launch TCP listener, health_check_type must be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.

health_check_http_code: pulumi.Output[str] = None

Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when health_check is on. Default to http_2xx. Valid values are: http_2xx, http_3xx, http_4xx and http_5xx.

health_check_interval: pulumi.Output[float] = None

Time interval of health checks. It is required when health_check is on. Valid value range: [1-50] in seconds. Default to 2.

health_check_method: pulumi.Output[str] = None

The method of health check. Valid values: [“head”, “get”].

health_check_timeout: pulumi.Output[float] = None

Maximum timeout of each health check response. It is required when health_check is on. Valid value range: [1-300] in seconds. Default to 5. Note: If health_check_timeout < health_check_interval, its will be replaced by health_check_interval.

health_check_type: pulumi.Output[str] = None

Type of health check. Valid values are: tcp and http. Default to tcp . TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.

health_check_uri: pulumi.Output[str] = None

URI used for health check. When it used to launch TCP listener, health_check_type must be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.

healthy_threshold: pulumi.Output[float] = None

Threshold determining the result of the health check is success. It is required when health_check is on. Valid value range: [1-10] in seconds. Default to 3.

idle_timeout: pulumi.Output[float] = None

Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.

listener_forward: pulumi.Output[str] = None

Whether to enable http redirect to https, Valid values are on and off. Default to off.

load_balancer_id: pulumi.Output[str] = None

The Load Balancer ID which is used to launch a new listener.

persistence_timeout: pulumi.Output[float] = None

Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.

protocol: pulumi.Output[str] = None

The protocol to listen on. Valid values are [http, https, tcp, udp].

request_timeout: pulumi.Output[float] = None

Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.

scheduler: pulumi.Output[str] = None

Scheduling algorithm, Valid values are wrr, rr and wlc. Default to “wrr”.

server_certificate_id: pulumi.Output[str] = None

SLB Server certificate ID. It is required when protocol is https.

server_group_id: pulumi.Output[str] = None

the id of server group to be apply on the listener, is the id of resource slb.ServerGroup.

ssl_certificate_id: pulumi.Output[str] = None

It has been deprecated from 1.59.0 and using server_certificate_id instead.

sticky_session: pulumi.Output[str] = None

Whether to enable session persistence, Valid values are on and off. Default to off.

sticky_session_type: pulumi.Output[str] = None

Mode for handling the cookie. If sticky_session is “on”, it is mandatory. Otherwise, it will be ignored. Valid values are insert and server. insert means it is inserted from Server Load Balancer; server means the Server Load Balancer learns from the backend server.

tls_cipher_policy: pulumi.Output[str] = None

Https listener TLS cipher policy. Valid values are tls_cipher_policy_1_0, tls_cipher_policy_1_1, tls_cipher_policy_1_2, tls_cipher_policy_1_2_strict. Default to tls_cipher_policy_1_0. Currently the tls_cipher_policy can not be updated when load balancer instance is “Shared-Performance”.

unhealthy_threshold: pulumi.Output[float] = None

Threshold determining the result of the health check is fail. It is required when health_check is on. Valid value range: [1-10] in seconds. Default to 3.

x_forwarded_for: pulumi.Output[dict] = None

Whether to set additional HTTP Header field “X-Forwarded-For” (documented below). Available in v1.13.0+.

  • retriveClientIp (bool)

  • retriveSlbId (bool) - Whether to use the XForwardedFor header to obtain the ID of the SLB instance. Default to false.

  • retriveSlbIp (bool) - Whether to use the XForwardedFor_SLBIP header to obtain the public IP address of the SLB instance. Default to false.

  • retriveSlbProto (bool) - Whether to use the XForwardedFor_proto header to obtain the protocol used by the listener. Default to false.

static get(resource_name, id, opts=None, acl_id=None, acl_status=None, acl_type=None, backend_port=None, bandwidth=None, cookie=None, cookie_timeout=None, delete_protection_validation=None, description=None, enable_http2=None, established_timeout=None, forward_port=None, frontend_port=None, gzip=None, health_check=None, health_check_connect_port=None, health_check_domain=None, health_check_http_code=None, health_check_interval=None, health_check_method=None, health_check_timeout=None, health_check_type=None, health_check_uri=None, healthy_threshold=None, idle_timeout=None, instance_port=None, lb_port=None, lb_protocol=None, listener_forward=None, load_balancer_id=None, master_slave_server_group_id=None, persistence_timeout=None, protocol=None, request_timeout=None, scheduler=None, server_certificate_id=None, server_group_id=None, ssl_certificate_id=None, sticky_session=None, sticky_session_type=None, tls_cipher_policy=None, unhealthy_threshold=None, x_forwarded_for=None)

Get an existing Listener resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • acl_id (pulumi.Input[str]) – the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If acl_status is “on”, it is mandatory. Otherwise, it will be ignored.

  • acl_status (pulumi.Input[str]) – Whether to enable “acl(access control list)”, the acl is specified by acl_id. Valid values are on and off. Default to off.

  • acl_type (pulumi.Input[str]) – Mode for handling the acl specified by acl_id. If acl_status is “on”, it is mandatory. Otherwise, it will be ignored. Valid values are white and black. white means the Listener can only be accessed by client ip belongs to the acl; black means the Listener can not be accessed by client ip belongs to the acl.

  • backend_port (pulumi.Input[float]) – Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].

  • bandwidth (pulumi.Input[float]) – Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.

  • cookie (pulumi.Input[str]) – The cookie configured on the server. It is mandatory when sticky_session is “on” and sticky_session_type is “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.

  • cookie_timeout (pulumi.Input[float]) – Cookie timeout. It is mandatory when sticky_session is “on” and sticky_session_type is “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • description (pulumi.Input[str]) – The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.

  • enable_http2 (pulumi.Input[str]) – Whether to enable https listener support http2 or not. Valid values are on and off. Default to on.

  • established_timeout (pulumi.Input[float]) – Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.

  • forward_port (pulumi.Input[float]) – The port that http redirect to https.

  • frontend_port (pulumi.Input[float]) – Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].

  • gzip (pulumi.Input[bool]) – Whether to enable “Gzip Compression”. If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.

  • health_check (pulumi.Input[str]) – Whether to enable health check. Valid values areon and off. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.

  • health_check_connect_port (pulumi.Input[float]) – Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.

  • health_check_domain (pulumi.Input[str]) – Domain name used for health check. When it used to launch TCP listener, health_check_type must be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.

  • health_check_http_code (pulumi.Input[str]) – Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when health_check is on. Default to http_2xx. Valid values are: http_2xx, http_3xx, http_4xx and http_5xx.

  • health_check_interval (pulumi.Input[float]) – Time interval of health checks. It is required when health_check is on. Valid value range: [1-50] in seconds. Default to 2.

  • health_check_method (pulumi.Input[str]) – The method of health check. Valid values: [“head”, “get”].

  • health_check_timeout (pulumi.Input[float]) – Maximum timeout of each health check response. It is required when health_check is on. Valid value range: [1-300] in seconds. Default to 5. Note: If health_check_timeout < health_check_interval, its will be replaced by health_check_interval.

  • health_check_type (pulumi.Input[str]) – Type of health check. Valid values are: tcp and http. Default to tcp . TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.

  • health_check_uri (pulumi.Input[str]) – URI used for health check. When it used to launch TCP listener, health_check_type must be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.

  • healthy_threshold (pulumi.Input[float]) – Threshold determining the result of the health check is success. It is required when health_check is on. Valid value range: [1-10] in seconds. Default to 3.

  • idle_timeout (pulumi.Input[float]) – Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.

  • listener_forward (pulumi.Input[str]) – Whether to enable http redirect to https, Valid values are on and off. Default to off.

  • load_balancer_id (pulumi.Input[str]) – The Load Balancer ID which is used to launch a new listener.

  • persistence_timeout (pulumi.Input[float]) – Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.

  • protocol (pulumi.Input[str]) – The protocol to listen on. Valid values are [http, https, tcp, udp].

  • request_timeout (pulumi.Input[float]) – Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.

  • scheduler (pulumi.Input[str]) – Scheduling algorithm, Valid values are wrr, rr and wlc. Default to “wrr”.

  • server_certificate_id (pulumi.Input[str]) – SLB Server certificate ID. It is required when protocol is https.

  • server_group_id (pulumi.Input[str]) – the id of server group to be apply on the listener, is the id of resource slb.ServerGroup.

  • ssl_certificate_id (pulumi.Input[str]) – It has been deprecated from 1.59.0 and using server_certificate_id instead.

  • sticky_session (pulumi.Input[str]) – Whether to enable session persistence, Valid values are on and off. Default to off.

  • sticky_session_type (pulumi.Input[str]) – Mode for handling the cookie. If sticky_session is “on”, it is mandatory. Otherwise, it will be ignored. Valid values are insert and server. insert means it is inserted from Server Load Balancer; server means the Server Load Balancer learns from the backend server.

  • tls_cipher_policy (pulumi.Input[str]) – Https listener TLS cipher policy. Valid values are tls_cipher_policy_1_0, tls_cipher_policy_1_1, tls_cipher_policy_1_2, tls_cipher_policy_1_2_strict. Default to tls_cipher_policy_1_0. Currently the tls_cipher_policy can not be updated when load balancer instance is “Shared-Performance”.

  • unhealthy_threshold (pulumi.Input[float]) – Threshold determining the result of the health check is fail. It is required when health_check is on. Valid value range: [1-10] in seconds. Default to 3.

  • x_forwarded_for (pulumi.Input[dict]) – Whether to set additional HTTP Header field “X-Forwarded-For” (documented below). Available in v1.13.0+.

The x_forwarded_for object supports the following:

  • retriveClientIp (pulumi.Input[bool])

  • retriveSlbId (pulumi.Input[bool]) - Whether to use the XForwardedFor header to obtain the ID of the SLB instance. Default to false.

  • retriveSlbIp (pulumi.Input[bool]) - Whether to use the XForwardedFor_SLBIP header to obtain the public IP address of the SLB instance. Default to false.

  • retriveSlbProto (pulumi.Input[bool]) - Whether to use the XForwardedFor_proto header to obtain the protocol used by the listener. Default to false.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.slb.LoadBalancer(resource_name, opts=None, address=None, address_ip_version=None, address_type=None, bandwidth=None, delete_protection=None, instance_charge_type=None, internet=None, internet_charge_type=None, master_zone_id=None, name=None, period=None, resource_group_id=None, slave_zone_id=None, specification=None, tags=None, vswitch_id=None, __props__=None, __name__=None, __opts__=None)

Create a LoadBalancer resource with the given unique name, props, and options. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] address: Specify the IP address of the private network for the SLB instance, which must be in the destination CIDR block of the correspond ing switch. :param pulumi.Input[str] address_ip_version: The IP version of the SLB instance to be created, which can be set to ipv4 or ipv6 . Default to “ipv4”. Now, only internet instance support ipv6 address. :param pulumi.Input[str] address_type: The network type of the SLB instance. Valid values: [“internet”, “intranet”]. If load balancer launched in VPC, this value must be “intranet”.

- internet: After an Internet SLB instance is created, the system allocates a public IP address so that the instance can forward requests from the Internet.
- intranet: After an intranet SLB instance is created, the system allocates an intranet IP address so that the instance can only forward intranet requests.
Parameters
  • bandwidth (pulumi.Input[float]) – Valid value is between 1 and 1000, If argument “internet_charge_type” is “paybytraffic”, then this value will be ignore.

  • delete_protection (pulumi.Input[str]) – Whether enable the deletion protection or not. on: Enable deletion protection. off: Disable deletion protection. Default to off. Only postpaid instance support this function.

  • instance_charge_type (pulumi.Input[str]) – The billing method of the load balancer. Valid values are “PrePaid” and “PostPaid”. Default to “PostPaid”.

  • internet (pulumi.Input[bool]) – Field ‘internet’ has been deprecated from provider version 1.55.3. Use ‘address_type’ replaces it.

  • internet_charge_type (pulumi.Input[str]) – Valid values are PayByBandwidth, PayByTraffic. If this value is “PayByBandwidth”, then argument “internet” must be “true”. Default is “PayByTraffic”. If load balancer launched in VPC, this value must be “PayByTraffic”. Before version 1.10.1, the valid values are “paybybandwidth” and “paybytraffic”.

  • master_zone_id (pulumi.Input[str]) – The primary zone ID of the SLB instance. If not specified, the system will be randomly assigned. You can query the primary and standby zones in a region by calling the DescribeZone API.

  • period (pulumi.Input[float]) – The duration that you will buy the resource, in month. It is valid when instance_charge_type is PrePaid. Default to 1. Valid values: [1-9, 12, 24, 36].

  • resource_group_id (pulumi.Input[str]) – The Id of resource group which the SLB belongs.

  • slave_zone_id (pulumi.Input[str]) – The standby zone ID of the SLB instance. If not specified, the system will be randomly assigned. You can query the primary and standby zones in a region by calling the DescribeZone API.

  • specification (pulumi.Input[str]) – The specification of the Server Load Balancer instance. Default to empty string indicating it is “Shared-Performance” instance. Launching “Performance-guaranteed” instance, it is must be specified and it valid values are: “slb.s1.small”, “slb.s2.small”, “slb.s2.medium”, “slb.s3.small”, “slb.s3.medium”, “slb.s3.large” and “slb.s4.large”.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource. The tags can have a maximum of 10 tag for every load balancer instance.

  • vswitch_id (pulumi.Input[str]) – The VSwitch ID to launch in. If address_type is internet, it will be ignore.

address: pulumi.Output[str] = None

Specify the IP address of the private network for the SLB instance, which must be in the destination CIDR block of the correspond ing switch.

address_ip_version: pulumi.Output[str] = None

The IP version of the SLB instance to be created, which can be set to ipv4 or ipv6 . Default to “ipv4”. Now, only internet instance support ipv6 address.

address_type: pulumi.Output[str] = None

The network type of the SLB instance. Valid values: [“internet”, “intranet”]. If load balancer launched in VPC, this value must be “intranet”.

  • internet: After an Internet SLB instance is created, the system allocates a public IP address so that the instance can forward requests from the Internet.

  • intranet: After an intranet SLB instance is created, the system allocates an intranet IP address so that the instance can only forward intranet requests.

bandwidth: pulumi.Output[float] = None

Valid value is between 1 and 1000, If argument “internet_charge_type” is “paybytraffic”, then this value will be ignore.

delete_protection: pulumi.Output[str] = None

Whether enable the deletion protection or not. on: Enable deletion protection. off: Disable deletion protection. Default to off. Only postpaid instance support this function.

instance_charge_type: pulumi.Output[str] = None

The billing method of the load balancer. Valid values are “PrePaid” and “PostPaid”. Default to “PostPaid”.

internet: pulumi.Output[bool] = None

Field ‘internet’ has been deprecated from provider version 1.55.3. Use ‘address_type’ replaces it.

internet_charge_type: pulumi.Output[str] = None

Valid values are PayByBandwidth, PayByTraffic. If this value is “PayByBandwidth”, then argument “internet” must be “true”. Default is “PayByTraffic”. If load balancer launched in VPC, this value must be “PayByTraffic”. Before version 1.10.1, the valid values are “paybybandwidth” and “paybytraffic”.

master_zone_id: pulumi.Output[str] = None

The primary zone ID of the SLB instance. If not specified, the system will be randomly assigned. You can query the primary and standby zones in a region by calling the DescribeZone API.

period: pulumi.Output[float] = None

The duration that you will buy the resource, in month. It is valid when instance_charge_type is PrePaid. Default to 1. Valid values: [1-9, 12, 24, 36].

resource_group_id: pulumi.Output[str] = None

The Id of resource group which the SLB belongs.

slave_zone_id: pulumi.Output[str] = None

The standby zone ID of the SLB instance. If not specified, the system will be randomly assigned. You can query the primary and standby zones in a region by calling the DescribeZone API.

specification: pulumi.Output[str] = None

The specification of the Server Load Balancer instance. Default to empty string indicating it is “Shared-Performance” instance. Launching “Performance-guaranteed” instance, it is must be specified and it valid values are: “slb.s1.small”, “slb.s2.small”, “slb.s2.medium”, “slb.s3.small”, “slb.s3.medium”, “slb.s3.large” and “slb.s4.large”.

tags: pulumi.Output[dict] = None

A mapping of tags to assign to the resource. The tags can have a maximum of 10 tag for every load balancer instance.

vswitch_id: pulumi.Output[str] = None

The VSwitch ID to launch in. If address_type is internet, it will be ignore.

static get(resource_name, id, opts=None, address=None, address_ip_version=None, address_type=None, bandwidth=None, delete_protection=None, instance_charge_type=None, internet=None, internet_charge_type=None, master_zone_id=None, name=None, period=None, resource_group_id=None, slave_zone_id=None, specification=None, tags=None, vswitch_id=None)

Get an existing LoadBalancer resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • address (pulumi.Input[str]) – Specify the IP address of the private network for the SLB instance, which must be in the destination CIDR block of the correspond ing switch.

  • address_ip_version (pulumi.Input[str]) – The IP version of the SLB instance to be created, which can be set to ipv4 or ipv6 . Default to “ipv4”. Now, only internet instance support ipv6 address.

  • address_type (pulumi.Input[str]) – The network type of the SLB instance. Valid values: [“internet”, “intranet”]. If load balancer launched in VPC, this value must be “intranet”.

- internet: After an Internet SLB instance is created, the system allocates a public IP address so that the instance can forward requests from the Internet.
- intranet: After an intranet SLB instance is created, the system allocates an intranet IP address so that the instance can only forward intranet requests.
Parameters
  • bandwidth (pulumi.Input[float]) – Valid value is between 1 and 1000, If argument “internet_charge_type” is “paybytraffic”, then this value will be ignore.

  • delete_protection (pulumi.Input[str]) – Whether enable the deletion protection or not. on: Enable deletion protection. off: Disable deletion protection. Default to off. Only postpaid instance support this function.

  • instance_charge_type (pulumi.Input[str]) – The billing method of the load balancer. Valid values are “PrePaid” and “PostPaid”. Default to “PostPaid”.

  • internet (pulumi.Input[bool]) – Field ‘internet’ has been deprecated from provider version 1.55.3. Use ‘address_type’ replaces it.

  • internet_charge_type (pulumi.Input[str]) – Valid values are PayByBandwidth, PayByTraffic. If this value is “PayByBandwidth”, then argument “internet” must be “true”. Default is “PayByTraffic”. If load balancer launched in VPC, this value must be “PayByTraffic”. Before version 1.10.1, the valid values are “paybybandwidth” and “paybytraffic”.

  • master_zone_id (pulumi.Input[str]) – The primary zone ID of the SLB instance. If not specified, the system will be randomly assigned. You can query the primary and standby zones in a region by calling the DescribeZone API.

  • period (pulumi.Input[float]) – The duration that you will buy the resource, in month. It is valid when instance_charge_type is PrePaid. Default to 1. Valid values: [1-9, 12, 24, 36].

  • resource_group_id (pulumi.Input[str]) – The Id of resource group which the SLB belongs.

  • slave_zone_id (pulumi.Input[str]) – The standby zone ID of the SLB instance. If not specified, the system will be randomly assigned. You can query the primary and standby zones in a region by calling the DescribeZone API.

  • specification (pulumi.Input[str]) –

    The specification of the Server Load Balancer instance. Default to empty string indicating it is “Shared-Performance” instance. Launching “Performance-guaranteed” instance, it is must be specified and it valid values are: “slb.s1.small”, “slb.s2.small”, “slb.s2.medium”, “slb.s3.small”, “slb.s3.medium”, “slb.s3.large” and “slb.s4.large”.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource. The tags can have a maximum of 10 tag for every load balancer instance.

  • vswitch_id (pulumi.Input[str]) – The VSwitch ID to launch in. If address_type is internet, it will be ignore.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.slb.MasterSlaveServerGroup(resource_name, opts=None, delete_protection_validation=None, load_balancer_id=None, name=None, servers=None, __props__=None, __name__=None, __opts__=None)

A master slave server group contains two ECS instances. The master slave server group can help you to define multiple listening dimension.

NOTE: One ECS instance can be added into multiple master slave server groups.

NOTE: One master slave server group can only add two ECS instances, which are master server and slave server.

NOTE: One master slave server group can be attached with tcp/udp listeners in one load balancer.

NOTE: One Classic and Internet load balancer, its master slave server group can add Classic and VPC ECS instances.

NOTE: One Classic and Intranet load balancer, its master slave server group can only add Classic ECS instances.

NOTE: One VPC load balancer, its master slave server group can only add the same VPC ECS instances.

NOTE: Available in 1.54.0+

import pulumi
import pulumi_alicloud as alicloud

default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
    available_resource_creation="VSwitch")
default_instance_types = alicloud.ecs.get_instance_types(availability_zone=default_zones.zones[0]["id"],
    eni_amount=2)
image = alicloud.ecs.get_images(most_recent=True,
    name_regex="^ubuntu_18.*64",
    owners="system")
config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "tf-testAccSlbMasterSlaveServerGroupVpc"
number = config.get("number")
if number is None:
    number = "1"
main_network = alicloud.vpc.Network("mainNetwork", cidr_block="172.16.0.0/16")
main_switch = alicloud.vpc.Switch("mainSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/16",
    vpc_id=main_network.id)
group_security_group = alicloud.ecs.SecurityGroup("groupSecurityGroup", vpc_id=main_network.id)
instance_instance = []
for range in [{"value": i} for i in range(0, 2)]:
    instance_instance.append(alicloud.ecs.Instance(f"instanceInstance-{range['value']}",
        availability_zone=default_zones.zones[0]["id"],
        image_id=image.images[0]["id"],
        instance_charge_type="PostPaid",
        instance_name=name,
        instance_type=default_instance_types.instance_types[0]["id"],
        internet_charge_type="PayByTraffic",
        internet_max_bandwidth_out="10",
        security_groups=[group_security_group.id],
        system_disk_category="cloud_efficiency",
        vswitch_id=main_switch.id))
instance_load_balancer = alicloud.slb.LoadBalancer("instanceLoadBalancer",
    specification="slb.s2.small",
    vswitch_id=main_switch.id)
default_network_interface = []
for range in [{"value": i} for i in range(0, number)]:
    default_network_interface.append(alicloud.vpc.NetworkInterface(f"defaultNetworkInterface-{range['value']}",
        security_groups=[group_security_group.id],
        vswitch_id=main_switch.id))
default_network_interface_attachment = []
for range in [{"value": i} for i in range(0, number)]:
    default_network_interface_attachment.append(alicloud.vpc.NetworkInterfaceAttachment(f"defaultNetworkInterfaceAttachment-{range['value']}",
        instance_id=instance_instance[0].id,
        network_interface_id=[__item.id for __item in default_network_interface][range["index"]]))
group_master_slave_server_group = alicloud.slb.MasterSlaveServerGroup("groupMasterSlaveServerGroup",
    load_balancer_id=instance_load_balancer.id,
    servers=[
        {
            "port": 100,
            "serverId": instance_instance[0].id,
            "server_type": "Master",
            "weight": 100,
        },
        {
            "port": 100,
            "serverId": instance_instance[1].id,
            "server_type": "Slave",
            "weight": 100,
        },
    ])
tcp = alicloud.slb.Listener("tcp",
    bandwidth="10",
    established_timeout=600,
    frontend_port="22",
    health_check_connect_port=20,
    health_check_http_code="http_2xx",
    health_check_interval=5,
    health_check_timeout=8,
    health_check_type="tcp",
    health_check_uri="/console",
    healthy_threshold=8,
    load_balancer_id=instance_load_balancer.id,
    master_slave_server_group_id=group_master_slave_server_group.id,
    persistence_timeout=3600,
    protocol="tcp",
    unhealthy_threshold=8)

The servers mapping supports the following:

  • server_ids - (Required) A list backend server ID (ECS instance ID).

  • port - (Required) The port used by the backend server. Valid value range: [1-65535].

  • weight - (Optional) Weight of the backend server. Valid value range: [0-100]. Default to 100.

  • type - (Optional, Available in 1.51.0+) Type of the backend server. Valid value ecs, eni. Default to eni.

  • server_type - (Optional) The server type of the backend server. Valid value Master, Slave.

  • is_backup - (Removed from v1.63.0) Determine if the server is executing. Valid value 0, 1.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • load_balancer_id (pulumi.Input[str]) – The Load Balancer ID which is used to launch a new master slave server group.

  • name (pulumi.Input[str]) – Name of the master slave server group.

  • servers (pulumi.Input[list]) – A list of ECS instances to be added. Only two ECS instances can be supported in one resource. It contains six sub-fields as Block server follows.

The servers object supports the following:

  • port (pulumi.Input[float])

  • serverId (pulumi.Input[str])

  • server_type (pulumi.Input[str])

  • type (pulumi.Input[str])

  • weight (pulumi.Input[float])

delete_protection_validation: pulumi.Output[bool] = None

Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

load_balancer_id: pulumi.Output[str] = None

The Load Balancer ID which is used to launch a new master slave server group.

name: pulumi.Output[str] = None

Name of the master slave server group.

servers: pulumi.Output[list] = None

A list of ECS instances to be added. Only two ECS instances can be supported in one resource. It contains six sub-fields as Block server follows.

  • port (float)

  • serverId (str)

  • server_type (str)

  • type (str)

  • weight (float)

static get(resource_name, id, opts=None, delete_protection_validation=None, load_balancer_id=None, name=None, servers=None)

Get an existing MasterSlaveServerGroup resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • load_balancer_id (pulumi.Input[str]) – The Load Balancer ID which is used to launch a new master slave server group.

  • name (pulumi.Input[str]) – Name of the master slave server group.

  • servers (pulumi.Input[list]) – A list of ECS instances to be added. Only two ECS instances can be supported in one resource. It contains six sub-fields as Block server follows.

The servers object supports the following:

  • port (pulumi.Input[float])

  • serverId (pulumi.Input[str])

  • server_type (pulumi.Input[str])

  • type (pulumi.Input[str])

  • weight (pulumi.Input[float])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.slb.Rule(resource_name, opts=None, cookie=None, cookie_timeout=None, delete_protection_validation=None, domain=None, frontend_port=None, health_check=None, health_check_connect_port=None, health_check_domain=None, health_check_http_code=None, health_check_interval=None, health_check_timeout=None, health_check_uri=None, healthy_threshold=None, listener_sync=None, load_balancer_id=None, name=None, scheduler=None, server_group_id=None, sticky_session=None, sticky_session_type=None, unhealthy_threshold=None, url=None, __props__=None, __name__=None, __opts__=None)

A forwarding rule is configured in HTTP/HTTPS listener and it used to listen a list of backend servers which in one specified virtual backend server group. You can add forwarding rules to a listener to forward requests based on the domain names or the URL in the request.

NOTE: One virtual backend server group can be attached in multiple forwarding rules.

NOTE: At least one “Domain” or “Url” must be specified when creating a new rule.

NOTE: Having the same ‘Domain’ and ‘Url’ rule can not be created repeatedly in the one listener.

NOTE: Rule only be created in the HTTP or HTTPS listener.

NOTE: Only rule’s virtual server group can be modified.

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "slbrulebasicconfig"
default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
    available_resource_creation="VSwitch")
default_instance_types = alicloud.ecs.get_instance_types(availability_zone=default_zones.zones[0]["id"],
    cpu_core_count=1,
    memory_size=2)
default_images = alicloud.ecs.get_images(most_recent=True,
    name_regex="^ubuntu_18.*64",
    owners="system")
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/16",
    vpc_id=default_network.id)
default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup", vpc_id=default_network.id)
default_instance = alicloud.ecs.Instance("defaultInstance",
    availability_zone=default_zones.zones[0]["id"],
    image_id=default_images.images[0]["id"],
    instance_charge_type="PostPaid",
    instance_name=name,
    instance_type=default_instance_types.instance_types[0]["id"],
    internet_charge_type="PayByTraffic",
    internet_max_bandwidth_out="10",
    security_groups=[__item.id for __item in [default_security_group]],
    system_disk_category="cloud_efficiency",
    vswitch_id=default_switch.id)
default_load_balancer = alicloud.slb.LoadBalancer("defaultLoadBalancer", vswitch_id=default_switch.id)
default_listener = alicloud.slb.Listener("defaultListener",
    backend_port=22,
    bandwidth=5,
    frontend_port=22,
    health_check_connect_port="20",
    load_balancer_id=default_load_balancer.id,
    protocol="http")
default_server_group = alicloud.slb.ServerGroup("defaultServerGroup",
    load_balancer_id=default_load_balancer.id,
    servers=[{
        "port": 80,
        "serverIds": [__item.id for __item in [default_instance]],
        "weight": 100,
    }])
default_rule = alicloud.slb.Rule("defaultRule",
    cookie="23ffsa",
    cookie_timeout=100,
    domain="*.aliyun.com",
    frontend_port=default_listener.frontend_port,
    health_check="on",
    health_check_connect_port=80,
    health_check_domain="test",
    health_check_http_code="http_2xx",
    health_check_interval=10,
    health_check_timeout=30,
    health_check_uri="/test",
    healthy_threshold=3,
    listener_sync="off",
    load_balancer_id=default_load_balancer.id,
    scheduler="rr",
    server_group_id=default_server_group.id,
    sticky_session="on",
    sticky_session_type="server",
    unhealthy_threshold=5,
    url="/image")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • cookie (pulumi.Input[str]) – The cookie configured on the server. It is mandatory when sticky_session is “on” and sticky_session_type is “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.

  • cookie_timeout (pulumi.Input[float]) – Cookie timeout. It is mandatory when sticky_session is “on” and sticky_session_type is “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • domain (pulumi.Input[str]) – Domain name of the forwarding rule. It can contain letters a-z, numbers 0-9, hyphens (-), and periods (.), and wildcard characters. The following two domain name formats are supported:

- Standard domain name: www.test.com
- Wildcard domain name: *.test.com. wildcard (*) must be the first character in the format of (*.)
Parameters
  • frontend_port (pulumi.Input[float]) – The listener frontend port which is used to launch the new forwarding rule. Valid range: [1-65535].

  • health_check (pulumi.Input[str]) – Whether to enable health check. Valid values areon and off. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener. This parameter is required and takes effect only when ListenerSync is set to off.

  • health_check_connect_port (pulumi.Input[float]) – Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.

  • health_check_domain (pulumi.Input[str]) – Domain name used for health check. When it used to launch TCP listener, health_check_type must be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.

  • health_check_http_code (pulumi.Input[str]) – Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when health_check is on. Default to http_2xx. Valid values are: http_2xx, http_3xx, http_4xx and http_5xx.

  • health_check_interval (pulumi.Input[float]) – Time interval of health checks. It is required when health_check is on. Valid value range: [1-50] in seconds. Default to 2.

  • health_check_timeout (pulumi.Input[float]) – Maximum timeout of each health check response. It is required when health_check is on. Valid value range: [1-300] in seconds. Default to 5. Note: If health_check_timeout < health_check_interval, its will be replaced by health_check_interval.

  • health_check_uri (pulumi.Input[str]) – URI used for health check. When it used to launch TCP listener, health_check_type must be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.

  • healthy_threshold (pulumi.Input[float]) – Threshold determining the result of the health check is success. It is required when health_check is on. Valid value range: [1-10] in seconds. Default to 3.

  • listener_sync (pulumi.Input[str]) – Indicates whether a forwarding rule inherits the settings of a health check , session persistence, and scheduling algorithm from a listener. Default to on.

  • load_balancer_id (pulumi.Input[str]) – The Load Balancer ID which is used to launch the new forwarding rule.

  • name (pulumi.Input[str]) – Name of the forwarding rule. Our plugin provides a default name: “tf-slb-rule”.

  • scheduler (pulumi.Input[str]) – Scheduling algorithm, Valid values are wrr, rr and wlc. Default to “wrr”. This parameter is required and takes effect only when ListenerSync is set to off.

  • server_group_id (pulumi.Input[str]) – ID of a virtual server group that will be forwarded.

  • sticky_session (pulumi.Input[str]) – Whether to enable session persistence, Valid values are on and off. Default to off. This parameter is required and takes effect only when ListenerSync is set to off.

  • sticky_session_type (pulumi.Input[str]) – Mode for handling the cookie. If sticky_session is “on”, it is mandatory. Otherwise, it will be ignored. Valid values are insert and server. insert means it is inserted from Server Load Balancer; server means the Server Load Balancer learns from the backend server.

  • unhealthy_threshold (pulumi.Input[float]) – Threshold determining the result of the health check is fail. It is required when health_check is on. Valid value range: [1-10] in seconds. Default to 3.

  • url (pulumi.Input[str]) – Domain of the forwarding rule. It must be 2-80 characters in length. Only letters a-z, numbers 0-9, and characters ‘-‘ ‘/’ ‘?’ ‘%’ ‘#’ and ‘&’ are allowed. URLs must be started with the character ‘/’, but cannot be ‘/’ alone.

cookie: pulumi.Output[str] = None

The cookie configured on the server. It is mandatory when sticky_session is “on” and sticky_session_type is “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.

cookie_timeout: pulumi.Output[float] = None

Cookie timeout. It is mandatory when sticky_session is “on” and sticky_session_type is “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.

delete_protection_validation: pulumi.Output[bool] = None

Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

domain: pulumi.Output[str] = None

Domain name of the forwarding rule. It can contain letters a-z, numbers 0-9, hyphens (-), and periods (.), and wildcard characters. The following two domain name formats are supported:

  • Standard domain name: www.test.com

  • Wildcard domain name: .test.com. wildcard () must be the first character in the format of (*.)

frontend_port: pulumi.Output[float] = None

The listener frontend port which is used to launch the new forwarding rule. Valid range: [1-65535].

health_check: pulumi.Output[str] = None

Whether to enable health check. Valid values areon and off. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener. This parameter is required and takes effect only when ListenerSync is set to off.

health_check_connect_port: pulumi.Output[float] = None

Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.

health_check_domain: pulumi.Output[str] = None

Domain name used for health check. When it used to launch TCP listener, health_check_type must be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.

health_check_http_code: pulumi.Output[str] = None

Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when health_check is on. Default to http_2xx. Valid values are: http_2xx, http_3xx, http_4xx and http_5xx.

health_check_interval: pulumi.Output[float] = None

Time interval of health checks. It is required when health_check is on. Valid value range: [1-50] in seconds. Default to 2.

health_check_timeout: pulumi.Output[float] = None

Maximum timeout of each health check response. It is required when health_check is on. Valid value range: [1-300] in seconds. Default to 5. Note: If health_check_timeout < health_check_interval, its will be replaced by health_check_interval.

health_check_uri: pulumi.Output[str] = None

URI used for health check. When it used to launch TCP listener, health_check_type must be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.

healthy_threshold: pulumi.Output[float] = None

Threshold determining the result of the health check is success. It is required when health_check is on. Valid value range: [1-10] in seconds. Default to 3.

listener_sync: pulumi.Output[str] = None

Indicates whether a forwarding rule inherits the settings of a health check , session persistence, and scheduling algorithm from a listener. Default to on.

load_balancer_id: pulumi.Output[str] = None

The Load Balancer ID which is used to launch the new forwarding rule.

name: pulumi.Output[str] = None

Name of the forwarding rule. Our plugin provides a default name: “tf-slb-rule”.

scheduler: pulumi.Output[str] = None

Scheduling algorithm, Valid values are wrr, rr and wlc. Default to “wrr”. This parameter is required and takes effect only when ListenerSync is set to off.

server_group_id: pulumi.Output[str] = None

ID of a virtual server group that will be forwarded.

sticky_session: pulumi.Output[str] = None

Whether to enable session persistence, Valid values are on and off. Default to off. This parameter is required and takes effect only when ListenerSync is set to off.

sticky_session_type: pulumi.Output[str] = None

Mode for handling the cookie. If sticky_session is “on”, it is mandatory. Otherwise, it will be ignored. Valid values are insert and server. insert means it is inserted from Server Load Balancer; server means the Server Load Balancer learns from the backend server.

unhealthy_threshold: pulumi.Output[float] = None

Threshold determining the result of the health check is fail. It is required when health_check is on. Valid value range: [1-10] in seconds. Default to 3.

url: pulumi.Output[str] = None

Domain of the forwarding rule. It must be 2-80 characters in length. Only letters a-z, numbers 0-9, and characters ‘-‘ ‘/’ ‘?’ ‘%’ ‘#’ and ‘&’ are allowed. URLs must be started with the character ‘/’, but cannot be ‘/’ alone.

static get(resource_name, id, opts=None, cookie=None, cookie_timeout=None, delete_protection_validation=None, domain=None, frontend_port=None, health_check=None, health_check_connect_port=None, health_check_domain=None, health_check_http_code=None, health_check_interval=None, health_check_timeout=None, health_check_uri=None, healthy_threshold=None, listener_sync=None, load_balancer_id=None, name=None, scheduler=None, server_group_id=None, sticky_session=None, sticky_session_type=None, unhealthy_threshold=None, url=None)

Get an existing Rule resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • cookie (pulumi.Input[str]) – The cookie configured on the server. It is mandatory when sticky_session is “on” and sticky_session_type is “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.

  • cookie_timeout (pulumi.Input[float]) – Cookie timeout. It is mandatory when sticky_session is “on” and sticky_session_type is “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • domain (pulumi.Input[str]) – Domain name of the forwarding rule. It can contain letters a-z, numbers 0-9, hyphens (-), and periods (.), and wildcard characters. The following two domain name formats are supported:

- Standard domain name: www.test.com
- Wildcard domain name: *.test.com. wildcard (*) must be the first character in the format of (*.)
Parameters
  • frontend_port (pulumi.Input[float]) – The listener frontend port which is used to launch the new forwarding rule. Valid range: [1-65535].

  • health_check (pulumi.Input[str]) – Whether to enable health check. Valid values areon and off. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener. This parameter is required and takes effect only when ListenerSync is set to off.

  • health_check_connect_port (pulumi.Input[float]) – Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.

  • health_check_domain (pulumi.Input[str]) – Domain name used for health check. When it used to launch TCP listener, health_check_type must be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.

  • health_check_http_code (pulumi.Input[str]) – Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when health_check is on. Default to http_2xx. Valid values are: http_2xx, http_3xx, http_4xx and http_5xx.

  • health_check_interval (pulumi.Input[float]) – Time interval of health checks. It is required when health_check is on. Valid value range: [1-50] in seconds. Default to 2.

  • health_check_timeout (pulumi.Input[float]) – Maximum timeout of each health check response. It is required when health_check is on. Valid value range: [1-300] in seconds. Default to 5. Note: If health_check_timeout < health_check_interval, its will be replaced by health_check_interval.

  • health_check_uri (pulumi.Input[str]) – URI used for health check. When it used to launch TCP listener, health_check_type must be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.

  • healthy_threshold (pulumi.Input[float]) – Threshold determining the result of the health check is success. It is required when health_check is on. Valid value range: [1-10] in seconds. Default to 3.

  • listener_sync (pulumi.Input[str]) – Indicates whether a forwarding rule inherits the settings of a health check , session persistence, and scheduling algorithm from a listener. Default to on.

  • load_balancer_id (pulumi.Input[str]) – The Load Balancer ID which is used to launch the new forwarding rule.

  • name (pulumi.Input[str]) – Name of the forwarding rule. Our plugin provides a default name: “tf-slb-rule”.

  • scheduler (pulumi.Input[str]) – Scheduling algorithm, Valid values are wrr, rr and wlc. Default to “wrr”. This parameter is required and takes effect only when ListenerSync is set to off.

  • server_group_id (pulumi.Input[str]) – ID of a virtual server group that will be forwarded.

  • sticky_session (pulumi.Input[str]) – Whether to enable session persistence, Valid values are on and off. Default to off. This parameter is required and takes effect only when ListenerSync is set to off.

  • sticky_session_type (pulumi.Input[str]) – Mode for handling the cookie. If sticky_session is “on”, it is mandatory. Otherwise, it will be ignored. Valid values are insert and server. insert means it is inserted from Server Load Balancer; server means the Server Load Balancer learns from the backend server.

  • unhealthy_threshold (pulumi.Input[float]) – Threshold determining the result of the health check is fail. It is required when health_check is on. Valid value range: [1-10] in seconds. Default to 3.

  • url (pulumi.Input[str]) – Domain of the forwarding rule. It must be 2-80 characters in length. Only letters a-z, numbers 0-9, and characters ‘-‘ ‘/’ ‘?’ ‘%’ ‘#’ and ‘&’ are allowed. URLs must be started with the character ‘/’, but cannot be ‘/’ alone.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.slb.ServerCertificate(resource_name, opts=None, alicloud_certifacte_id=None, alicloud_certifacte_name=None, alicloud_certificate_id=None, alicloud_certificate_name=None, alicloud_certificate_region_id=None, name=None, private_key=None, resource_group_id=None, server_certificate=None, tags=None, __props__=None, __name__=None, __opts__=None)

A Load Balancer Server Certificate is an ssl Certificate used by the listener of the protocol https.

For information about slb and how to use it, see What is Server Load Balancer.

For information about Server Certificate and how to use it, see Configure Server Certificate.

import pulumi
import pulumi_alicloud as alicloud

# create a server certificate
foo = alicloud.slb.ServerCertificate("foo",
    private_key="""-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQDO0knDrlNdiys******ErVpjsckAaOW/JDG5PCSwkaMxk=
-----END RSA PRIVATE KEY-----
""",
    server_certificate="""-----BEGIN CERTIFICATE-----
MIIDRjCCAq+gAwIBAgI+OuMs******XTtI90EAxEG/bJJyOm5LqoiA=
-----END CERTIFICATE-----
""")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • alicloud_certificate_id (pulumi.Input[str]) – an id of server certificate ssued/proxied by alibaba cloud. but it is not supported on the international site of alibaba cloud now.

  • alicloud_certificate_name (pulumi.Input[str]) – the name of the certificate specified by alicloud_certificate_id.but it is not supported on the international site of alibaba cloud now.

  • alicloud_certificate_region_id (pulumi.Input[str]) – the region of the certificate specified by alicloud_certificate_id. but it is not supported on the international site of alibaba cloud now.

  • name (pulumi.Input[str]) – Name of the Server Certificate.

  • private_key (pulumi.Input[str]) – the content of privat key of the ssl certificate specified by server_certificate. where alicloud_certificate_id is null, it is required, otherwise it is ignored.

  • resource_group_id (pulumi.Input[str]) – The Id of resource group which the slb server certificate belongs.

  • server_certificate (pulumi.Input[str]) – the content of the ssl certificate. where alicloud_certificate_id is null, it is required, otherwise it is ignored.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

alicloud_certificate_id: pulumi.Output[str] = None

an id of server certificate ssued/proxied by alibaba cloud. but it is not supported on the international site of alibaba cloud now.

alicloud_certificate_name: pulumi.Output[str] = None

the name of the certificate specified by alicloud_certificate_id.but it is not supported on the international site of alibaba cloud now.

alicloud_certificate_region_id: pulumi.Output[str] = None

the region of the certificate specified by alicloud_certificate_id. but it is not supported on the international site of alibaba cloud now.

name: pulumi.Output[str] = None

Name of the Server Certificate.

private_key: pulumi.Output[str] = None

the content of privat key of the ssl certificate specified by server_certificate. where alicloud_certificate_id is null, it is required, otherwise it is ignored.

resource_group_id: pulumi.Output[str] = None

The Id of resource group which the slb server certificate belongs.

server_certificate: pulumi.Output[str] = None

the content of the ssl certificate. where alicloud_certificate_id is null, it is required, otherwise it is ignored.

tags: pulumi.Output[dict] = None

A mapping of tags to assign to the resource.

static get(resource_name, id, opts=None, alicloud_certifacte_id=None, alicloud_certifacte_name=None, alicloud_certificate_id=None, alicloud_certificate_name=None, alicloud_certificate_region_id=None, name=None, private_key=None, resource_group_id=None, server_certificate=None, tags=None)

Get an existing ServerCertificate resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • alicloud_certificate_id (pulumi.Input[str]) – an id of server certificate ssued/proxied by alibaba cloud. but it is not supported on the international site of alibaba cloud now.

  • alicloud_certificate_name (pulumi.Input[str]) – the name of the certificate specified by alicloud_certificate_id.but it is not supported on the international site of alibaba cloud now.

  • alicloud_certificate_region_id (pulumi.Input[str]) – the region of the certificate specified by alicloud_certificate_id. but it is not supported on the international site of alibaba cloud now.

  • name (pulumi.Input[str]) – Name of the Server Certificate.

  • private_key (pulumi.Input[str]) – the content of privat key of the ssl certificate specified by server_certificate. where alicloud_certificate_id is null, it is required, otherwise it is ignored.

  • resource_group_id (pulumi.Input[str]) – The Id of resource group which the slb server certificate belongs.

  • server_certificate (pulumi.Input[str]) – the content of the ssl certificate. where alicloud_certificate_id is null, it is required, otherwise it is ignored.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.slb.ServerGroup(resource_name, opts=None, delete_protection_validation=None, load_balancer_id=None, name=None, servers=None, __props__=None, __name__=None, __opts__=None)

A virtual server group contains several ECS instances. The virtual server group can help you to define multiple listening dimension, and to meet the personalized requirements of domain name and URL forwarding.

NOTE: One ECS instance can be added into multiple virtual server groups.

NOTE: One virtual server group can be attached with multiple listeners in one load balancer.

NOTE: One Classic and Internet load balancer, its virtual server group can add Classic and VPC ECS instances.

NOTE: One Classic and Intranet load balancer, its virtual server group can only add Classic ECS instances.

NOTE: One VPC load balancer, its virtual server group can only add the same VPC ECS instances.

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "slbservergroupvpc"
default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
    available_resource_creation="VSwitch")
default_instance_types = alicloud.ecs.get_instance_types(availability_zone=default_zones.zones[0]["id"],
    cpu_core_count=1,
    memory_size=2)
default_images = alicloud.ecs.get_images(most_recent=True,
    name_regex="^ubuntu_18.*64",
    owners="system")
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/16",
    vpc_id=default_network.id)
default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup", vpc_id=default_network.id)
instance = []
for range in [{"value": i} for i in range(0, 2)]:
    instance.append(alicloud.ecs.Instance(f"instance-{range['value']}",
        availability_zone=default_zones.zones[0]["id"],
        image_id=default_images.images[0]["id"],
        instance_charge_type="PostPaid",
        instance_name=name,
        instance_type=default_instance_types.instance_types[0]["id"],
        internet_charge_type="PayByTraffic",
        internet_max_bandwidth_out="10",
        security_groups=[__item.id for __item in [default_security_group]],
        system_disk_category="cloud_efficiency",
        vswitch_id=default_switch.id))
default_load_balancer = alicloud.slb.LoadBalancer("defaultLoadBalancer", vswitch_id=default_switch.id)
default_server_group = alicloud.slb.ServerGroup("defaultServerGroup",
    load_balancer_id=default_load_balancer.id,
    servers=[
        {
            "port": 100,
            "serverIds": [
                instance[0].id,
                instance[1].id,
            ],
            "weight": 10,
        },
        {
            "port": 80,
            "serverIds": [__item.id for __item in instance],
            "weight": 100,
        },
    ])

The servers mapping supports the following:

  • server_ids - (Required) A list backend server ID (ECS instance ID).

  • port - (Required) The port used by the backend server. Valid value range: [1-65535].

  • weight - (Optional) Weight of the backend server. Valid value range: [0-100]. Default to 100.

  • type - (Optional, Available in 1.51.0+) Type of the backend server. Valid value ecs, eni. Default to eni.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • load_balancer_id (pulumi.Input[str]) – The Load Balancer ID which is used to launch a new virtual server group.

  • name (pulumi.Input[str]) – Name of the virtual server group. Our plugin provides a default name: “tf-server-group”.

  • servers (pulumi.Input[list]) – A list of ECS instances to be added. At most 20 ECS instances can be supported in one resource. It contains three sub-fields as Block server follows.

The servers object supports the following:

  • port (pulumi.Input[float])

  • serverIds (pulumi.Input[list])

  • type (pulumi.Input[str])

  • weight (pulumi.Input[float])

delete_protection_validation: pulumi.Output[bool] = None

Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

load_balancer_id: pulumi.Output[str] = None

The Load Balancer ID which is used to launch a new virtual server group.

name: pulumi.Output[str] = None

Name of the virtual server group. Our plugin provides a default name: “tf-server-group”.

servers: pulumi.Output[list] = None

A list of ECS instances to be added. At most 20 ECS instances can be supported in one resource. It contains three sub-fields as Block server follows.

  • port (float)

  • serverIds (list)

  • type (str)

  • weight (float)

static get(resource_name, id, opts=None, delete_protection_validation=None, load_balancer_id=None, name=None, servers=None)

Get an existing ServerGroup resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • delete_protection_validation (pulumi.Input[bool]) – Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

  • load_balancer_id (pulumi.Input[str]) – The Load Balancer ID which is used to launch a new virtual server group.

  • name (pulumi.Input[str]) – Name of the virtual server group. Our plugin provides a default name: “tf-server-group”.

  • servers (pulumi.Input[list]) – A list of ECS instances to be added. At most 20 ECS instances can be supported in one resource. It contains three sub-fields as Block server follows.

The servers object supports the following:

  • port (pulumi.Input[float])

  • serverIds (pulumi.Input[list])

  • type (pulumi.Input[str])

  • weight (pulumi.Input[float])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

pulumi_alicloud.slb.get_acls(ids=None, name_regex=None, output_file=None, resource_group_id=None, tags=None, opts=None)

This data source provides the acls in the region.

import pulumi
import pulumi_alicloud as alicloud

sample_ds = alicloud.slb.get_acls()
pulumi.export("firstSlbAclId", sample_ds.acls[0]["id"])

The entry mapping supports the following:

  • entry - An IP addresses or CIDR blocks.

  • comment - the comment of the entry.

The Listener mapping supports the following:

  • load_balancer_id - the id of load balancer instance, the listener belongs to.

  • frontend_port - the listener port.

  • protocol - the listener protocol (such as tcp/udp/http/https, etc).

  • acl_type - the type of acl (such as white/black).

Parameters
  • ids (list) – A list of acls IDs to filter results.

  • name_regex (str) – A regex string to filter results by acl name.

  • resource_group_id (str) – The Id of resource group which acl belongs.

  • tags (dict) – A mapping of tags to assign to the resource.

pulumi_alicloud.slb.get_attachments(instance_ids=None, load_balancer_id=None, output_file=None, opts=None)

This data source provides the server load balancer attachments of the current Alibaba Cloud user.

import pulumi
import pulumi_alicloud as alicloud

sample_ds = alicloud.slb.get_attachments(load_balancer_id=alicloud_slb["sample_slb"]["id"])
pulumi.export("firstSlbAttachmentInstanceId", sample_ds.slb_attachments[0]["instance_id"])
Parameters
  • instance_ids (list) – List of attached ECS instance IDs.

  • load_balancer_id (str) – ID of the SLB with attachments.

pulumi_alicloud.slb.get_backend_servers(ids=None, load_balancer_id=None, output_file=None, opts=None)

This data source provides the server load balancer backend servers related to a server load balancer..

NOTE: Available in 1.53.0+

Parameters
  • ids (list) – List of attached ECS instance IDs.

  • load_balancer_id (str) – ID of the SLB with attachments.

pulumi_alicloud.slb.get_ca_certificates(ids=None, name_regex=None, output_file=None, resource_group_id=None, tags=None, opts=None)

This data source provides the CA certificate list.

import pulumi
import pulumi_alicloud as alicloud

sample_ds = alicloud.slb.get_ca_certificates()
pulumi.export("firstSlbCaCertificateId", sample_ds.certificates[0]["id"])
Parameters
  • ids (list) – A list of ca certificates IDs to filter results.

  • name_regex (str) – A regex string to filter results by ca certificate name.

  • resource_group_id (str) – The Id of resource group which ca certificates belongs.

  • tags (dict) – A mapping of tags to assign to the resource.

pulumi_alicloud.slb.get_domain_extensions(frontend_port=None, ids=None, load_balancer_id=None, output_file=None, opts=None)

This data source provides the domain extensions associated with a server load balancer listener.

NOTE: Available in 1.60.0+

import pulumi
import pulumi_alicloud as alicloud

foo = alicloud.slb.get_domain_extensions(frontend_port="fake-port",
    ids=["fake-de-id"],
    load_balancer_id="fake-lb-id")
Parameters
  • frontend_port (float) – The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.

  • ids (list) – IDs of the SLB domain extensions.

  • load_balancer_id (str) – The ID of the SLB instance.

pulumi_alicloud.slb.get_listeners(description_regex=None, frontend_port=None, load_balancer_id=None, output_file=None, protocol=None, opts=None)

This data source provides the listeners related to a server load balancer of the current Alibaba Cloud user.

import pulumi
import pulumi_alicloud as alicloud

sample_ds = alicloud.slb.get_listeners(load_balancer_id=alicloud_slb["sample_slb"]["id"])
pulumi.export("firstSlbListenerProtocol", sample_ds.slb_listeners[0]["protocol"])
Parameters
  • description_regex (str) – A regex string to filter results by SLB listener description.

  • frontend_port (float) – Filter listeners by the specified frontend port.

  • load_balancer_id (str) – ID of the SLB with listeners.

  • protocol (str) – Filter listeners by the specified protocol. Valid values: http, https, tcp and udp.

pulumi_alicloud.slb.get_load_balancers(address=None, ids=None, master_availability_zone=None, name_regex=None, network_type=None, output_file=None, resource_group_id=None, slave_availability_zone=None, tags=None, vpc_id=None, vswitch_id=None, opts=None)

This data source provides the server load balancers of the current Alibaba Cloud user.

import pulumi
import pulumi_alicloud as alicloud

slbs_ds = alicloud.slb.get_load_balancers(name_regex="sample_slb")
pulumi.export("firstSlbId", slbs_ds.slbs[0]["id"])
Parameters
  • address (str) – Service address of the SLBs.

  • ids (list) – A list of SLBs IDs.

  • master_availability_zone (str) – Master availability zone of the SLBs.

  • name_regex (str) – A regex string to filter results by SLB name.

  • network_type (str) – Network type of the SLBs. Valid values: vpc and classic.

  • resource_group_id (str) – The Id of resource group which SLB belongs.

  • slave_availability_zone (str) – Slave availability zone of the SLBs.

  • tags (dict) – A map of tags assigned to the SLB instances. The tags can have a maximum of 5 tag. It must be in the format:

```
data "slb.getLoadBalancers" "taggedInstances" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
```
Parameters
  • vpc_id (str) – ID of the VPC linked to the SLBs.

  • vswitch_id (str) – ID of the VSwitch linked to the SLBs.

pulumi_alicloud.slb.get_master_slave_server_groups(ids=None, load_balancer_id=None, name_regex=None, output_file=None, opts=None)

This data source provides the master slave server groups related to a server load balancer.

NOTE: Available in 1.54.0+

import pulumi
import pulumi_alicloud as alicloud

sample_ds = alicloud.slb.get_master_slave_server_groups(load_balancer_id=alicloud_slb["sample_slb"]["id"])
pulumi.export("firstSlbServerGroupId", sample_ds.groups[0]["id"])
Parameters
  • ids (list) – A list of master slave server group IDs to filter results.

  • load_balancer_id (str) – ID of the SLB.

  • name_regex (str) – A regex string to filter results by master slave server group name.

pulumi_alicloud.slb.get_rules(frontend_port=None, ids=None, load_balancer_id=None, name_regex=None, output_file=None, opts=None)

This data source provides the rules associated with a server load balancer listener.

import pulumi
import pulumi_alicloud as alicloud

sample_ds = alicloud.slb.get_rules(frontend_port=80,
    load_balancer_id=alicloud_slb["sample_slb"]["id"])
pulumi.export("firstSlbRuleId", sample_ds.slb_rules[0]["id"])
Parameters
  • frontend_port (float) – SLB listener port.

  • ids (list) – A list of rules IDs to filter results.

  • load_balancer_id (str) – ID of the SLB with listener rules.

  • name_regex (str) – A regex string to filter results by rule name.

pulumi_alicloud.slb.get_server_certificates(ids=None, name_regex=None, output_file=None, resource_group_id=None, tags=None, opts=None)

This data source provides the server certificate list.

import pulumi
import pulumi_alicloud as alicloud

sample_ds = alicloud.slb.get_server_certificates()
pulumi.export("firstSlbServerCertificateId", sample_ds.certificates[0]["id"])
Parameters
  • ids (list) – A list of server certificates IDs to filter results.

  • name_regex (str) – A regex string to filter results by server certificate name.

  • resource_group_id (str) – The Id of resource group which the slb server certificates belongs.

  • tags (dict) – A mapping of tags to assign to the resource.

pulumi_alicloud.slb.get_server_groups(ids=None, load_balancer_id=None, name_regex=None, output_file=None, opts=None)

This data source provides the VServer groups related to a server load balancer.

import pulumi
import pulumi_alicloud as alicloud

sample_ds = alicloud.slb.get_server_groups(load_balancer_id=alicloud_slb["sample_slb"]["id"])
pulumi.export("firstSlbServerGroupId", sample_ds.slb_server_groups[0]["id"])
Parameters
  • ids (list) – A list of VServer group IDs to filter results.

  • load_balancer_id (str) – ID of the SLB.

  • name_regex (str) – A regex string to filter results by VServer group name.

pulumi_alicloud.slb.get_zones(available_slb_address_ip_version=None, available_slb_address_type=None, enable_details=None, output_file=None, opts=None)

This data source provides availability zones for SLB that can be accessed by an Alibaba Cloud account within the region configured in the provider.

NOTE: Available in v1.73.0+.

import pulumi
import pulumi_alicloud as alicloud

zones_ids = alicloud.slb.get_zones()
Parameters
  • available_slb_address_ip_version (str) – Filter the results by a slb instance address version. Can be either ipv4, or ipv6.

  • available_slb_address_type (str) – Filter the results by a slb instance address type. Can be either Vpc, classic_internet or classic_intranet

  • enable_details (bool) – Default to false and only output id in the zones block. Set it to true can output more details.