1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. slb
  5. BackendServer
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.slb.BackendServer

Explore with Pulumi AI

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+

Create BackendServer Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new BackendServer(name: string, args: BackendServerArgs, opts?: CustomResourceOptions);
@overload
def BackendServer(resource_name: str,
                  args: BackendServerArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def BackendServer(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  load_balancer_id: Optional[str] = None,
                  backend_servers: Optional[Sequence[BackendServerBackendServerArgs]] = None,
                  delete_protection_validation: Optional[bool] = None)
func NewBackendServer(ctx *Context, name string, args BackendServerArgs, opts ...ResourceOption) (*BackendServer, error)
public BackendServer(string name, BackendServerArgs args, CustomResourceOptions? opts = null)
public BackendServer(String name, BackendServerArgs args)
public BackendServer(String name, BackendServerArgs args, CustomResourceOptions options)
type: alicloud:slb:BackendServer
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. BackendServerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. BackendServerArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. BackendServerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. BackendServerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. BackendServerArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var backendServerResource = new AliCloud.Slb.BackendServer("backendServerResource", new()
{
    LoadBalancerId = "string",
    BackendServers = new[]
    {
        new AliCloud.Slb.Inputs.BackendServerBackendServerArgs
        {
            ServerId = "string",
            Weight = 0,
            ServerIp = "string",
            Type = "string",
        },
    },
    DeleteProtectionValidation = false,
});
Copy
example, err := slb.NewBackendServer(ctx, "backendServerResource", &slb.BackendServerArgs{
	LoadBalancerId: pulumi.String("string"),
	BackendServers: slb.BackendServerBackendServerArray{
		&slb.BackendServerBackendServerArgs{
			ServerId: pulumi.String("string"),
			Weight:   pulumi.Int(0),
			ServerIp: pulumi.String("string"),
			Type:     pulumi.String("string"),
		},
	},
	DeleteProtectionValidation: pulumi.Bool(false),
})
Copy
var backendServerResource = new BackendServer("backendServerResource", BackendServerArgs.builder()
    .loadBalancerId("string")
    .backendServers(BackendServerBackendServerArgs.builder()
        .serverId("string")
        .weight(0)
        .serverIp("string")
        .type("string")
        .build())
    .deleteProtectionValidation(false)
    .build());
Copy
backend_server_resource = alicloud.slb.BackendServer("backendServerResource",
    load_balancer_id="string",
    backend_servers=[{
        "server_id": "string",
        "weight": 0,
        "server_ip": "string",
        "type": "string",
    }],
    delete_protection_validation=False)
Copy
const backendServerResource = new alicloud.slb.BackendServer("backendServerResource", {
    loadBalancerId: "string",
    backendServers: [{
        serverId: "string",
        weight: 0,
        serverIp: "string",
        type: "string",
    }],
    deleteProtectionValidation: false,
});
Copy
type: alicloud:slb:BackendServer
properties:
    backendServers:
        - serverId: string
          serverIp: string
          type: string
          weight: 0
    deleteProtectionValidation: false
    loadBalancerId: string
Copy

BackendServer Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The BackendServer resource accepts the following input properties:

LoadBalancerId
This property is required.
Changes to this property will trigger replacement.
string
ID of the load balancer.
BackendServers List<Pulumi.AliCloud.Slb.Inputs.BackendServerBackendServer>
A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.
DeleteProtectionValidation 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.
LoadBalancerId
This property is required.
Changes to this property will trigger replacement.
string
ID of the load balancer.
BackendServers []BackendServerBackendServerArgs
A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.
DeleteProtectionValidation 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.
loadBalancerId
This property is required.
Changes to this property will trigger replacement.
String
ID of the load balancer.
backendServers List<BackendServerBackendServer>
A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.
deleteProtectionValidation Boolean
Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
loadBalancerId
This property is required.
Changes to this property will trigger replacement.
string
ID of the load balancer.
backendServers BackendServerBackendServer[]
A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.
deleteProtectionValidation boolean
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
This property is required.
Changes to this property will trigger replacement.
str
ID of the load balancer.
backend_servers Sequence[BackendServerBackendServerArgs]
A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.
delete_protection_validation 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.
loadBalancerId
This property is required.
Changes to this property will trigger replacement.
String
ID of the load balancer.
backendServers List<Property Map>
A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.
deleteProtectionValidation Boolean
Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

Outputs

All input properties are implicitly available as output properties. Additionally, the BackendServer resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing BackendServer Resource

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

public static get(name: string, id: Input<ID>, state?: BackendServerState, opts?: CustomResourceOptions): BackendServer
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        backend_servers: Optional[Sequence[BackendServerBackendServerArgs]] = None,
        delete_protection_validation: Optional[bool] = None,
        load_balancer_id: Optional[str] = None) -> BackendServer
func GetBackendServer(ctx *Context, name string, id IDInput, state *BackendServerState, opts ...ResourceOption) (*BackendServer, error)
public static BackendServer Get(string name, Input<string> id, BackendServerState? state, CustomResourceOptions? opts = null)
public static BackendServer get(String name, Output<String> id, BackendServerState state, CustomResourceOptions options)
resources:  _:    type: alicloud:slb:BackendServer    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
BackendServers List<Pulumi.AliCloud.Slb.Inputs.BackendServerBackendServer>
A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.
DeleteProtectionValidation 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.
LoadBalancerId Changes to this property will trigger replacement. string
ID of the load balancer.
BackendServers []BackendServerBackendServerArgs
A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.
DeleteProtectionValidation 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.
LoadBalancerId Changes to this property will trigger replacement. string
ID of the load balancer.
backendServers List<BackendServerBackendServer>
A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.
deleteProtectionValidation Boolean
Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
loadBalancerId Changes to this property will trigger replacement. String
ID of the load balancer.
backendServers BackendServerBackendServer[]
A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.
deleteProtectionValidation boolean
Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
loadBalancerId Changes to this property will trigger replacement. string
ID of the load balancer.
backend_servers Sequence[BackendServerBackendServerArgs]
A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.
delete_protection_validation 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 Changes to this property will trigger replacement. str
ID of the load balancer.
backendServers List<Property Map>
A list of instances to added backend server in the SLB. It contains three sub-fields as Block server follows.
deleteProtectionValidation Boolean
Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
loadBalancerId Changes to this property will trigger replacement. String
ID of the load balancer.

Supporting Types

BackendServerBackendServer
, BackendServerBackendServerArgs

ServerId This property is required. string
Weight This property is required. int
ServerIp string
Type string
ServerId This property is required. string
Weight This property is required. int
ServerIp string
Type string
serverId This property is required. String
weight This property is required. Integer
serverIp String
type String
serverId This property is required. string
weight This property is required. number
serverIp string
type string
server_id This property is required. str
weight This property is required. int
server_ip str
type str
serverId This property is required. String
weight This property is required. Number
serverIp String
type String

Import

Load balancer backend server can be imported using the load balancer id.

$ pulumi import alicloud:slb/backendServer:BackendServer example <load_balancer_id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.