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

alicloud.nlb.ServerGroupServerAttachment

Explore with Pulumi AI

Provides a Network Load Balancer (NLB) Server Group Server Attachment resource.

Network Server Load Balancer.

For information about Network Load Balancer (NLB) Server Group Server Attachment and how to use it, see What is Server Group Server Attachment.

NOTE: Available since v1.192.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const _default = alicloud.resourcemanager.getResourceGroups({});
const defaultNetwork = new alicloud.vpc.Network("default", {
    vpcName: name,
    cidrBlock: "10.4.0.0/16",
});
const defaultServerGroup = new alicloud.nlb.ServerGroup("default", {
    resourceGroupId: _default.then(_default => _default.ids?.[0]),
    serverGroupName: name,
    serverGroupType: "Ip",
    vpcId: defaultNetwork.id,
    scheduler: "Wrr",
    protocol: "TCP",
    healthCheck: {
        healthCheckEnabled: false,
    },
    addressIpVersion: "Ipv4",
});
const defaultServerGroupServerAttachment = new alicloud.nlb.ServerGroupServerAttachment("default", {
    serverType: "Ip",
    serverId: "10.0.0.0",
    description: name,
    port: 80,
    serverGroupId: defaultServerGroup.id,
    weight: 100,
    serverIp: "10.0.0.0",
});
Copy
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "tf-example"
default = alicloud.resourcemanager.get_resource_groups()
default_network = alicloud.vpc.Network("default",
    vpc_name=name,
    cidr_block="10.4.0.0/16")
default_server_group = alicloud.nlb.ServerGroup("default",
    resource_group_id=default.ids[0],
    server_group_name=name,
    server_group_type="Ip",
    vpc_id=default_network.id,
    scheduler="Wrr",
    protocol="TCP",
    health_check={
        "health_check_enabled": False,
    },
    address_ip_version="Ipv4")
default_server_group_server_attachment = alicloud.nlb.ServerGroupServerAttachment("default",
    server_type="Ip",
    server_id="10.0.0.0",
    description=name,
    port=80,
    server_group_id=default_server_group.id,
    weight=100,
    server_ip="10.0.0.0")
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/nlb"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "tf-example"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		_default, err := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{}, nil)
		if err != nil {
			return err
		}
		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
			VpcName:   pulumi.String(name),
			CidrBlock: pulumi.String("10.4.0.0/16"),
		})
		if err != nil {
			return err
		}
		defaultServerGroup, err := nlb.NewServerGroup(ctx, "default", &nlb.ServerGroupArgs{
			ResourceGroupId: pulumi.String(_default.Ids[0]),
			ServerGroupName: pulumi.String(name),
			ServerGroupType: pulumi.String("Ip"),
			VpcId:           defaultNetwork.ID(),
			Scheduler:       pulumi.String("Wrr"),
			Protocol:        pulumi.String("TCP"),
			HealthCheck: &nlb.ServerGroupHealthCheckArgs{
				HealthCheckEnabled: pulumi.Bool(false),
			},
			AddressIpVersion: pulumi.String("Ipv4"),
		})
		if err != nil {
			return err
		}
		_, err = nlb.NewServerGroupServerAttachment(ctx, "default", &nlb.ServerGroupServerAttachmentArgs{
			ServerType:    pulumi.String("Ip"),
			ServerId:      pulumi.String("10.0.0.0"),
			Description:   pulumi.String(name),
			Port:          pulumi.Int(80),
			ServerGroupId: defaultServerGroup.ID(),
			Weight:        pulumi.Int(100),
			ServerIp:      pulumi.String("10.0.0.0"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var name = config.Get("name") ?? "tf-example";
    var @default = AliCloud.ResourceManager.GetResourceGroups.Invoke();

    var defaultNetwork = new AliCloud.Vpc.Network("default", new()
    {
        VpcName = name,
        CidrBlock = "10.4.0.0/16",
    });

    var defaultServerGroup = new AliCloud.Nlb.ServerGroup("default", new()
    {
        ResourceGroupId = @default.Apply(@default => @default.Apply(getResourceGroupsResult => getResourceGroupsResult.Ids[0])),
        ServerGroupName = name,
        ServerGroupType = "Ip",
        VpcId = defaultNetwork.Id,
        Scheduler = "Wrr",
        Protocol = "TCP",
        HealthCheck = new AliCloud.Nlb.Inputs.ServerGroupHealthCheckArgs
        {
            HealthCheckEnabled = false,
        },
        AddressIpVersion = "Ipv4",
    });

    var defaultServerGroupServerAttachment = new AliCloud.Nlb.ServerGroupServerAttachment("default", new()
    {
        ServerType = "Ip",
        ServerId = "10.0.0.0",
        Description = name,
        Port = 80,
        ServerGroupId = defaultServerGroup.Id,
        Weight = 100,
        ServerIp = "10.0.0.0",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.nlb.ServerGroup;
import com.pulumi.alicloud.nlb.ServerGroupArgs;
import com.pulumi.alicloud.nlb.inputs.ServerGroupHealthCheckArgs;
import com.pulumi.alicloud.nlb.ServerGroupServerAttachment;
import com.pulumi.alicloud.nlb.ServerGroupServerAttachmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var config = ctx.config();
        final var name = config.get("name").orElse("tf-example");
        final var default = ResourcemanagerFunctions.getResourceGroups();

        var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
            .vpcName(name)
            .cidrBlock("10.4.0.0/16")
            .build());

        var defaultServerGroup = new ServerGroup("defaultServerGroup", ServerGroupArgs.builder()
            .resourceGroupId(default_.ids()[0])
            .serverGroupName(name)
            .serverGroupType("Ip")
            .vpcId(defaultNetwork.id())
            .scheduler("Wrr")
            .protocol("TCP")
            .healthCheck(ServerGroupHealthCheckArgs.builder()
                .healthCheckEnabled(false)
                .build())
            .addressIpVersion("Ipv4")
            .build());

        var defaultServerGroupServerAttachment = new ServerGroupServerAttachment("defaultServerGroupServerAttachment", ServerGroupServerAttachmentArgs.builder()
            .serverType("Ip")
            .serverId("10.0.0.0")
            .description(name)
            .port(80)
            .serverGroupId(defaultServerGroup.id())
            .weight(100)
            .serverIp("10.0.0.0")
            .build());

    }
}
Copy
configuration:
  name:
    type: string
    default: tf-example
resources:
  defaultNetwork:
    type: alicloud:vpc:Network
    name: default
    properties:
      vpcName: ${name}
      cidrBlock: 10.4.0.0/16
  defaultServerGroup:
    type: alicloud:nlb:ServerGroup
    name: default
    properties:
      resourceGroupId: ${default.ids[0]}
      serverGroupName: ${name}
      serverGroupType: Ip
      vpcId: ${defaultNetwork.id}
      scheduler: Wrr
      protocol: TCP
      healthCheck:
        healthCheckEnabled: false
      addressIpVersion: Ipv4
  defaultServerGroupServerAttachment:
    type: alicloud:nlb:ServerGroupServerAttachment
    name: default
    properties:
      serverType: Ip
      serverId: 10.0.0.0
      description: ${name}
      port: 80
      serverGroupId: ${defaultServerGroup.id}
      weight: 100
      serverIp: 10.0.0.0
variables:
  default:
    fn::invoke:
      function: alicloud:resourcemanager:getResourceGroups
      arguments: {}
Copy

Create ServerGroupServerAttachment Resource

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

Constructor syntax

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

@overload
def ServerGroupServerAttachment(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                server_group_id: Optional[str] = None,
                                server_id: Optional[str] = None,
                                server_type: Optional[str] = None,
                                description: Optional[str] = None,
                                port: Optional[int] = None,
                                server_ip: Optional[str] = None,
                                weight: Optional[int] = None)
func NewServerGroupServerAttachment(ctx *Context, name string, args ServerGroupServerAttachmentArgs, opts ...ResourceOption) (*ServerGroupServerAttachment, error)
public ServerGroupServerAttachment(string name, ServerGroupServerAttachmentArgs args, CustomResourceOptions? opts = null)
public ServerGroupServerAttachment(String name, ServerGroupServerAttachmentArgs args)
public ServerGroupServerAttachment(String name, ServerGroupServerAttachmentArgs args, CustomResourceOptions options)
type: alicloud:nlb:ServerGroupServerAttachment
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. ServerGroupServerAttachmentArgs
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. ServerGroupServerAttachmentArgs
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. ServerGroupServerAttachmentArgs
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. ServerGroupServerAttachmentArgs
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. ServerGroupServerAttachmentArgs
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 serverGroupServerAttachmentResource = new AliCloud.Nlb.ServerGroupServerAttachment("serverGroupServerAttachmentResource", new()
{
    ServerGroupId = "string",
    ServerId = "string",
    ServerType = "string",
    Description = "string",
    Port = 0,
    ServerIp = "string",
    Weight = 0,
});
Copy
example, err := nlb.NewServerGroupServerAttachment(ctx, "serverGroupServerAttachmentResource", &nlb.ServerGroupServerAttachmentArgs{
	ServerGroupId: pulumi.String("string"),
	ServerId:      pulumi.String("string"),
	ServerType:    pulumi.String("string"),
	Description:   pulumi.String("string"),
	Port:          pulumi.Int(0),
	ServerIp:      pulumi.String("string"),
	Weight:        pulumi.Int(0),
})
Copy
var serverGroupServerAttachmentResource = new ServerGroupServerAttachment("serverGroupServerAttachmentResource", ServerGroupServerAttachmentArgs.builder()
    .serverGroupId("string")
    .serverId("string")
    .serverType("string")
    .description("string")
    .port(0)
    .serverIp("string")
    .weight(0)
    .build());
Copy
server_group_server_attachment_resource = alicloud.nlb.ServerGroupServerAttachment("serverGroupServerAttachmentResource",
    server_group_id="string",
    server_id="string",
    server_type="string",
    description="string",
    port=0,
    server_ip="string",
    weight=0)
Copy
const serverGroupServerAttachmentResource = new alicloud.nlb.ServerGroupServerAttachment("serverGroupServerAttachmentResource", {
    serverGroupId: "string",
    serverId: "string",
    serverType: "string",
    description: "string",
    port: 0,
    serverIp: "string",
    weight: 0,
});
Copy
type: alicloud:nlb:ServerGroupServerAttachment
properties:
    description: string
    port: 0
    serverGroupId: string
    serverId: string
    serverIp: string
    serverType: string
    weight: 0
Copy

ServerGroupServerAttachment 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 ServerGroupServerAttachment resource accepts the following input properties:

ServerGroupId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the server group.
ServerId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the server.

  • If the server group type is Instance, set the ServerId parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
  • If the server group type is Ip, set the ServerId parameter to an IP address.
ServerType
This property is required.
Changes to this property will trigger replacement.
string
The type of the backend server. Valid values:

  • Ecs: ECS instance
  • Eni: ENI
  • Eci: an elastic container instance
  • Ip: an IP address
Description string
The description of the servers. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).
Port Changes to this property will trigger replacement. int
The port that is used by the backend server. Valid values: 1 to 65535.
ServerIp Changes to this property will trigger replacement. string
The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.
Weight int
The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the weight of a backend server is set to 0, no requests are forwarded to the backend server.
ServerGroupId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the server group.
ServerId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the server.

  • If the server group type is Instance, set the ServerId parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
  • If the server group type is Ip, set the ServerId parameter to an IP address.
ServerType
This property is required.
Changes to this property will trigger replacement.
string
The type of the backend server. Valid values:

  • Ecs: ECS instance
  • Eni: ENI
  • Eci: an elastic container instance
  • Ip: an IP address
Description string
The description of the servers. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).
Port Changes to this property will trigger replacement. int
The port that is used by the backend server. Valid values: 1 to 65535.
ServerIp Changes to this property will trigger replacement. string
The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.
Weight int
The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the weight of a backend server is set to 0, no requests are forwarded to the backend server.
serverGroupId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the server group.
serverId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the server.

  • If the server group type is Instance, set the ServerId parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
  • If the server group type is Ip, set the ServerId parameter to an IP address.
serverType
This property is required.
Changes to this property will trigger replacement.
String
The type of the backend server. Valid values:

  • Ecs: ECS instance
  • Eni: ENI
  • Eci: an elastic container instance
  • Ip: an IP address
description String
The description of the servers. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).
port Changes to this property will trigger replacement. Integer
The port that is used by the backend server. Valid values: 1 to 65535.
serverIp Changes to this property will trigger replacement. String
The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.
weight Integer
The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the weight of a backend server is set to 0, no requests are forwarded to the backend server.
serverGroupId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the server group.
serverId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the server.

  • If the server group type is Instance, set the ServerId parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
  • If the server group type is Ip, set the ServerId parameter to an IP address.
serverType
This property is required.
Changes to this property will trigger replacement.
string
The type of the backend server. Valid values:

  • Ecs: ECS instance
  • Eni: ENI
  • Eci: an elastic container instance
  • Ip: an IP address
description string
The description of the servers. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).
port Changes to this property will trigger replacement. number
The port that is used by the backend server. Valid values: 1 to 65535.
serverIp Changes to this property will trigger replacement. string
The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.
weight number
The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the weight of a backend server is set to 0, no requests are forwarded to the backend server.
server_group_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the server group.
server_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the server.

  • If the server group type is Instance, set the ServerId parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
  • If the server group type is Ip, set the ServerId parameter to an IP address.
server_type
This property is required.
Changes to this property will trigger replacement.
str
The type of the backend server. Valid values:

  • Ecs: ECS instance
  • Eni: ENI
  • Eci: an elastic container instance
  • Ip: an IP address
description str
The description of the servers. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).
port Changes to this property will trigger replacement. int
The port that is used by the backend server. Valid values: 1 to 65535.
server_ip Changes to this property will trigger replacement. str
The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.
weight int
The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the weight of a backend server is set to 0, no requests are forwarded to the backend server.
serverGroupId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the server group.
serverId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the server.

  • If the server group type is Instance, set the ServerId parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
  • If the server group type is Ip, set the ServerId parameter to an IP address.
serverType
This property is required.
Changes to this property will trigger replacement.
String
The type of the backend server. Valid values:

  • Ecs: ECS instance
  • Eni: ENI
  • Eci: an elastic container instance
  • Ip: an IP address
description String
The description of the servers. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).
port Changes to this property will trigger replacement. Number
The port that is used by the backend server. Valid values: 1 to 65535.
serverIp Changes to this property will trigger replacement. String
The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.
weight Number
The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the weight of a backend server is set to 0, no requests are forwarded to the backend server.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the resource
ZoneId string
The zone ID of the server.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the resource
ZoneId string
The zone ID of the server.
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the resource
zoneId String
The zone ID of the server.
id string
The provider-assigned unique ID for this managed resource.
status string
The status of the resource
zoneId string
The zone ID of the server.
id str
The provider-assigned unique ID for this managed resource.
status str
The status of the resource
zone_id str
The zone ID of the server.
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the resource
zoneId String
The zone ID of the server.

Look up Existing ServerGroupServerAttachment Resource

Get an existing ServerGroupServerAttachment 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?: ServerGroupServerAttachmentState, opts?: CustomResourceOptions): ServerGroupServerAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        port: Optional[int] = None,
        server_group_id: Optional[str] = None,
        server_id: Optional[str] = None,
        server_ip: Optional[str] = None,
        server_type: Optional[str] = None,
        status: Optional[str] = None,
        weight: Optional[int] = None,
        zone_id: Optional[str] = None) -> ServerGroupServerAttachment
func GetServerGroupServerAttachment(ctx *Context, name string, id IDInput, state *ServerGroupServerAttachmentState, opts ...ResourceOption) (*ServerGroupServerAttachment, error)
public static ServerGroupServerAttachment Get(string name, Input<string> id, ServerGroupServerAttachmentState? state, CustomResourceOptions? opts = null)
public static ServerGroupServerAttachment get(String name, Output<String> id, ServerGroupServerAttachmentState state, CustomResourceOptions options)
resources:  _:    type: alicloud:nlb:ServerGroupServerAttachment    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:
Description string
The description of the servers. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).
Port Changes to this property will trigger replacement. int
The port that is used by the backend server. Valid values: 1 to 65535.
ServerGroupId Changes to this property will trigger replacement. string
The ID of the server group.
ServerId Changes to this property will trigger replacement. string
The ID of the server.

  • If the server group type is Instance, set the ServerId parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
  • If the server group type is Ip, set the ServerId parameter to an IP address.
ServerIp Changes to this property will trigger replacement. string
The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.
ServerType Changes to this property will trigger replacement. string
The type of the backend server. Valid values:

  • Ecs: ECS instance
  • Eni: ENI
  • Eci: an elastic container instance
  • Ip: an IP address
Status string
The status of the resource
Weight int
The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the weight of a backend server is set to 0, no requests are forwarded to the backend server.
ZoneId string
The zone ID of the server.
Description string
The description of the servers. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).
Port Changes to this property will trigger replacement. int
The port that is used by the backend server. Valid values: 1 to 65535.
ServerGroupId Changes to this property will trigger replacement. string
The ID of the server group.
ServerId Changes to this property will trigger replacement. string
The ID of the server.

  • If the server group type is Instance, set the ServerId parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
  • If the server group type is Ip, set the ServerId parameter to an IP address.
ServerIp Changes to this property will trigger replacement. string
The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.
ServerType Changes to this property will trigger replacement. string
The type of the backend server. Valid values:

  • Ecs: ECS instance
  • Eni: ENI
  • Eci: an elastic container instance
  • Ip: an IP address
Status string
The status of the resource
Weight int
The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the weight of a backend server is set to 0, no requests are forwarded to the backend server.
ZoneId string
The zone ID of the server.
description String
The description of the servers. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).
port Changes to this property will trigger replacement. Integer
The port that is used by the backend server. Valid values: 1 to 65535.
serverGroupId Changes to this property will trigger replacement. String
The ID of the server group.
serverId Changes to this property will trigger replacement. String
The ID of the server.

  • If the server group type is Instance, set the ServerId parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
  • If the server group type is Ip, set the ServerId parameter to an IP address.
serverIp Changes to this property will trigger replacement. String
The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.
serverType Changes to this property will trigger replacement. String
The type of the backend server. Valid values:

  • Ecs: ECS instance
  • Eni: ENI
  • Eci: an elastic container instance
  • Ip: an IP address
status String
The status of the resource
weight Integer
The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the weight of a backend server is set to 0, no requests are forwarded to the backend server.
zoneId String
The zone ID of the server.
description string
The description of the servers. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).
port Changes to this property will trigger replacement. number
The port that is used by the backend server. Valid values: 1 to 65535.
serverGroupId Changes to this property will trigger replacement. string
The ID of the server group.
serverId Changes to this property will trigger replacement. string
The ID of the server.

  • If the server group type is Instance, set the ServerId parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
  • If the server group type is Ip, set the ServerId parameter to an IP address.
serverIp Changes to this property will trigger replacement. string
The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.
serverType Changes to this property will trigger replacement. string
The type of the backend server. Valid values:

  • Ecs: ECS instance
  • Eni: ENI
  • Eci: an elastic container instance
  • Ip: an IP address
status string
The status of the resource
weight number
The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the weight of a backend server is set to 0, no requests are forwarded to the backend server.
zoneId string
The zone ID of the server.
description str
The description of the servers. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).
port Changes to this property will trigger replacement. int
The port that is used by the backend server. Valid values: 1 to 65535.
server_group_id Changes to this property will trigger replacement. str
The ID of the server group.
server_id Changes to this property will trigger replacement. str
The ID of the server.

  • If the server group type is Instance, set the ServerId parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
  • If the server group type is Ip, set the ServerId parameter to an IP address.
server_ip Changes to this property will trigger replacement. str
The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.
server_type Changes to this property will trigger replacement. str
The type of the backend server. Valid values:

  • Ecs: ECS instance
  • Eni: ENI
  • Eci: an elastic container instance
  • Ip: an IP address
status str
The status of the resource
weight int
The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the weight of a backend server is set to 0, no requests are forwarded to the backend server.
zone_id str
The zone ID of the server.
description String
The description of the servers. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).
port Changes to this property will trigger replacement. Number
The port that is used by the backend server. Valid values: 1 to 65535.
serverGroupId Changes to this property will trigger replacement. String
The ID of the server group.
serverId Changes to this property will trigger replacement. String
The ID of the server.

  • If the server group type is Instance, set the ServerId parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
  • If the server group type is Ip, set the ServerId parameter to an IP address.
serverIp Changes to this property will trigger replacement. String
The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.
serverType Changes to this property will trigger replacement. String
The type of the backend server. Valid values:

  • Ecs: ECS instance
  • Eni: ENI
  • Eci: an elastic container instance
  • Ip: an IP address
status String
The status of the resource
weight Number
The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the weight of a backend server is set to 0, no requests are forwarded to the backend server.
zoneId String
The zone ID of the server.

Import

Network Load Balancer (NLB) Server Group Server Attachment can be imported using the id, e.g.

$ pulumi import alicloud:nlb/serverGroupServerAttachment:ServerGroupServerAttachment example <server_group_id>_<server_id>_<server_ip>_<server_type>_<port>
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.