ServerGroupServerAttachmentArgs

data class ServerGroupServerAttachmentArgs(val description: Output<String>? = null, val port: Output<Int>? = null, val serverGroupId: Output<String>? = null, val serverId: Output<String>? = null, val serverIp: Output<String>? = null, val serverType: Output<String>? = null, val weight: Output<Int>? = null) : ConvertibleToJava<ServerGroupServerAttachmentArgs>

Provides a NLB Server Group Server Attachment resource. For information about 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

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 defaultResourceGroups = 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(defaultResourceGroups.applyValue(getResourceGroupsResult -> getResourceGroupsResult.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());
}
}

Import

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_type>:<port>

Constructors

Link copied to clipboard
fun ServerGroupServerAttachmentArgs(description: Output<String>? = null, port: Output<Int>? = null, serverGroupId: Output<String>? = null, serverId: Output<String>? = null, serverIp: Output<String>? = null, serverType: Output<String>? = null, weight: Output<Int>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ServerGroupServerAttachmentArgs

Properties

Link copied to clipboard
val description: Output<String>? = null

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 (-).

Link copied to clipboard
val port: Output<Int>? = null

The port used by the backend server. Valid values: 1 to 65535.

Link copied to clipboard
val serverGroupId: Output<String>? = null

The ID of the server group.

Link copied to clipboard
val serverId: Output<String>? = null

The ID of the server.

Link copied to clipboard
val serverIp: Output<String>? = null

The IP address of the server. If the server group type is Ip, set the ServerId parameter to an IP address.

Link copied to clipboard
val serverType: Output<String>? = null

The type of the backend server. Valid values: Ecs, Eni, Eci, Ip.

Link copied to clipboard
val weight: Output<Int>? = null

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.