1. Packages
  2. Volcengine
  3. API Docs
  4. clb
  5. ServerGroup
Volcengine v0.0.28 published on Thursday, Apr 24, 2025 by Volcengine

volcengine.clb.ServerGroup

Explore with Pulumi AI

Provides a resource to manage server group

Example Usage

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

const fooZones = volcengine.ecs.Zones({});
const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
    vpcName: "acc-test-vpc",
    cidrBlock: "172.16.0.0/16",
});
const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
    subnetName: "acc-test-subnet",
    cidrBlock: "172.16.0.0/24",
    zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
    vpcId: fooVpc.id,
});
const fooClb = new volcengine.clb.Clb("fooClb", {
    type: "public",
    subnetId: fooSubnet.id,
    loadBalancerSpec: "small_1",
    description: "acc0Demo",
    loadBalancerName: "acc-test-create",
    eipBillingConfig: {
        isp: "BGP",
        eipBillingType: "PostPaidByBandwidth",
        bandwidth: 1,
    },
});
const fooServerGroup = new volcengine.clb.ServerGroup("fooServerGroup", {
    loadBalancerId: fooClb.id,
    serverGroupName: "acc-test-create",
    description: "hello demo11",
});
Copy
import pulumi
import pulumi_volcengine as volcengine

foo_zones = volcengine.ecs.zones()
foo_vpc = volcengine.vpc.Vpc("fooVpc",
    vpc_name="acc-test-vpc",
    cidr_block="172.16.0.0/16")
foo_subnet = volcengine.vpc.Subnet("fooSubnet",
    subnet_name="acc-test-subnet",
    cidr_block="172.16.0.0/24",
    zone_id=foo_zones.zones[0].id,
    vpc_id=foo_vpc.id)
foo_clb = volcengine.clb.Clb("fooClb",
    type="public",
    subnet_id=foo_subnet.id,
    load_balancer_spec="small_1",
    description="acc0Demo",
    load_balancer_name="acc-test-create",
    eip_billing_config=volcengine.clb.ClbEipBillingConfigArgs(
        isp="BGP",
        eip_billing_type="PostPaidByBandwidth",
        bandwidth=1,
    ))
foo_server_group = volcengine.clb.ServerGroup("fooServerGroup",
    load_balancer_id=foo_clb.id,
    server_group_name="acc-test-create",
    description="hello demo11")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/clb"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooZones, err := ecs.Zones(ctx, nil, nil)
		if err != nil {
			return err
		}
		fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
			VpcName:   pulumi.String("acc-test-vpc"),
			CidrBlock: pulumi.String("172.16.0.0/16"),
		})
		if err != nil {
			return err
		}
		fooSubnet, err := vpc.NewSubnet(ctx, "fooSubnet", &vpc.SubnetArgs{
			SubnetName: pulumi.String("acc-test-subnet"),
			CidrBlock:  pulumi.String("172.16.0.0/24"),
			ZoneId:     pulumi.String(fooZones.Zones[0].Id),
			VpcId:      fooVpc.ID(),
		})
		if err != nil {
			return err
		}
		fooClb, err := clb.NewClb(ctx, "fooClb", &clb.ClbArgs{
			Type:             pulumi.String("public"),
			SubnetId:         fooSubnet.ID(),
			LoadBalancerSpec: pulumi.String("small_1"),
			Description:      pulumi.String("acc0Demo"),
			LoadBalancerName: pulumi.String("acc-test-create"),
			EipBillingConfig: &clb.ClbEipBillingConfigArgs{
				Isp:            pulumi.String("BGP"),
				EipBillingType: pulumi.String("PostPaidByBandwidth"),
				Bandwidth:      pulumi.Int(1),
			},
		})
		if err != nil {
			return err
		}
		_, err = clb.NewServerGroup(ctx, "fooServerGroup", &clb.ServerGroupArgs{
			LoadBalancerId:  fooClb.ID(),
			ServerGroupName: pulumi.String("acc-test-create"),
			Description:     pulumi.String("hello demo11"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var fooZones = Volcengine.Ecs.Zones.Invoke();

    var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
    {
        VpcName = "acc-test-vpc",
        CidrBlock = "172.16.0.0/16",
    });

    var fooSubnet = new Volcengine.Vpc.Subnet("fooSubnet", new()
    {
        SubnetName = "acc-test-subnet",
        CidrBlock = "172.16.0.0/24",
        ZoneId = fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
        VpcId = fooVpc.Id,
    });

    var fooClb = new Volcengine.Clb.Clb("fooClb", new()
    {
        Type = "public",
        SubnetId = fooSubnet.Id,
        LoadBalancerSpec = "small_1",
        Description = "acc0Demo",
        LoadBalancerName = "acc-test-create",
        EipBillingConfig = new Volcengine.Clb.Inputs.ClbEipBillingConfigArgs
        {
            Isp = "BGP",
            EipBillingType = "PostPaidByBandwidth",
            Bandwidth = 1,
        },
    });

    var fooServerGroup = new Volcengine.Clb.ServerGroup("fooServerGroup", new()
    {
        LoadBalancerId = fooClb.Id,
        ServerGroupName = "acc-test-create",
        Description = "hello demo11",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.ecs.EcsFunctions;
import com.pulumi.volcengine.ecs.inputs.ZonesArgs;
import com.pulumi.volcengine.vpc.Vpc;
import com.pulumi.volcengine.vpc.VpcArgs;
import com.pulumi.volcengine.vpc.Subnet;
import com.pulumi.volcengine.vpc.SubnetArgs;
import com.pulumi.volcengine.clb.Clb;
import com.pulumi.volcengine.clb.ClbArgs;
import com.pulumi.volcengine.clb.inputs.ClbEipBillingConfigArgs;
import com.pulumi.volcengine.clb.ServerGroup;
import com.pulumi.volcengine.clb.ServerGroupArgs;
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 fooZones = EcsFunctions.Zones();

        var fooVpc = new Vpc("fooVpc", VpcArgs.builder()        
            .vpcName("acc-test-vpc")
            .cidrBlock("172.16.0.0/16")
            .build());

        var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()        
            .subnetName("acc-test-subnet")
            .cidrBlock("172.16.0.0/24")
            .zoneId(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
            .vpcId(fooVpc.id())
            .build());

        var fooClb = new Clb("fooClb", ClbArgs.builder()        
            .type("public")
            .subnetId(fooSubnet.id())
            .loadBalancerSpec("small_1")
            .description("acc0Demo")
            .loadBalancerName("acc-test-create")
            .eipBillingConfig(ClbEipBillingConfigArgs.builder()
                .isp("BGP")
                .eipBillingType("PostPaidByBandwidth")
                .bandwidth(1)
                .build())
            .build());

        var fooServerGroup = new ServerGroup("fooServerGroup", ServerGroupArgs.builder()        
            .loadBalancerId(fooClb.id())
            .serverGroupName("acc-test-create")
            .description("hello demo11")
            .build());

    }
}
Copy
resources:
  fooVpc:
    type: volcengine:vpc:Vpc
    properties:
      vpcName: acc-test-vpc
      cidrBlock: 172.16.0.0/16
  fooSubnet:
    type: volcengine:vpc:Subnet
    properties:
      subnetName: acc-test-subnet
      cidrBlock: 172.16.0.0/24
      zoneId: ${fooZones.zones[0].id}
      vpcId: ${fooVpc.id}
  fooClb:
    type: volcengine:clb:Clb
    properties:
      type: public
      subnetId: ${fooSubnet.id}
      loadBalancerSpec: small_1
      description: acc0Demo
      loadBalancerName: acc-test-create
      eipBillingConfig:
        isp: BGP
        eipBillingType: PostPaidByBandwidth
        bandwidth: 1
  fooServerGroup:
    type: volcengine:clb:ServerGroup
    properties:
      loadBalancerId: ${fooClb.id}
      serverGroupName: acc-test-create
      description: hello demo11
variables:
  fooZones:
    fn::invoke:
      Function: volcengine:ecs:Zones
      Arguments: {}
Copy

Create ServerGroup Resource

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

Constructor syntax

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

@overload
def ServerGroup(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                load_balancer_id: Optional[str] = None,
                address_ip_version: Optional[str] = None,
                description: Optional[str] = None,
                server_group_id: Optional[str] = None,
                server_group_name: Optional[str] = None)
func NewServerGroup(ctx *Context, name string, args ServerGroupArgs, opts ...ResourceOption) (*ServerGroup, error)
public ServerGroup(string name, ServerGroupArgs args, CustomResourceOptions? opts = null)
public ServerGroup(String name, ServerGroupArgs args)
public ServerGroup(String name, ServerGroupArgs args, CustomResourceOptions options)
type: volcengine:clb:ServerGroup
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. ServerGroupArgs
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. ServerGroupArgs
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. ServerGroupArgs
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. ServerGroupArgs
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. ServerGroupArgs
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 volcengineServerGroupResource = new Volcengine.Clb.ServerGroup("volcengineServerGroupResource", new()
{
    LoadBalancerId = "string",
    AddressIpVersion = "string",
    Description = "string",
    ServerGroupId = "string",
    ServerGroupName = "string",
});
Copy
example, err := clb.NewServerGroup(ctx, "volcengineServerGroupResource", &clb.ServerGroupArgs{
	LoadBalancerId:   pulumi.String("string"),
	AddressIpVersion: pulumi.String("string"),
	Description:      pulumi.String("string"),
	ServerGroupId:    pulumi.String("string"),
	ServerGroupName:  pulumi.String("string"),
})
Copy
var volcengineServerGroupResource = new com.pulumi.volcengine.clb.ServerGroup("volcengineServerGroupResource", com.pulumi.volcengine.clb.ServerGroupArgs.builder()
    .loadBalancerId("string")
    .addressIpVersion("string")
    .description("string")
    .serverGroupId("string")
    .serverGroupName("string")
    .build());
Copy
volcengine_server_group_resource = volcengine.clb.ServerGroup("volcengineServerGroupResource",
    load_balancer_id="string",
    address_ip_version="string",
    description="string",
    server_group_id="string",
    server_group_name="string")
Copy
const volcengineServerGroupResource = new volcengine.clb.ServerGroup("volcengineServerGroupResource", {
    loadBalancerId: "string",
    addressIpVersion: "string",
    description: "string",
    serverGroupId: "string",
    serverGroupName: "string",
});
Copy
type: volcengine:clb:ServerGroup
properties:
    addressIpVersion: string
    description: string
    loadBalancerId: string
    serverGroupId: string
    serverGroupName: string
Copy

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

LoadBalancerId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Clb.
AddressIpVersion Changes to this property will trigger replacement. string
The address ip version of the ServerGroup. Valid values: ipv4, ipv6. Default is ipv4.
Description string
The description of ServerGroup.
ServerGroupId string
The ID of the ServerGroup.
ServerGroupName string
The name of the ServerGroup.
LoadBalancerId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Clb.
AddressIpVersion Changes to this property will trigger replacement. string
The address ip version of the ServerGroup. Valid values: ipv4, ipv6. Default is ipv4.
Description string
The description of ServerGroup.
ServerGroupId string
The ID of the ServerGroup.
ServerGroupName string
The name of the ServerGroup.
loadBalancerId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Clb.
addressIpVersion Changes to this property will trigger replacement. String
The address ip version of the ServerGroup. Valid values: ipv4, ipv6. Default is ipv4.
description String
The description of ServerGroup.
serverGroupId String
The ID of the ServerGroup.
serverGroupName String
The name of the ServerGroup.
loadBalancerId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Clb.
addressIpVersion Changes to this property will trigger replacement. string
The address ip version of the ServerGroup. Valid values: ipv4, ipv6. Default is ipv4.
description string
The description of ServerGroup.
serverGroupId string
The ID of the ServerGroup.
serverGroupName string
The name of the ServerGroup.
load_balancer_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Clb.
address_ip_version Changes to this property will trigger replacement. str
The address ip version of the ServerGroup. Valid values: ipv4, ipv6. Default is ipv4.
description str
The description of ServerGroup.
server_group_id str
The ID of the ServerGroup.
server_group_name str
The name of the ServerGroup.
loadBalancerId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Clb.
addressIpVersion Changes to this property will trigger replacement. String
The address ip version of the ServerGroup. Valid values: ipv4, ipv6. Default is ipv4.
description String
The description of ServerGroup.
serverGroupId String
The ID of the ServerGroup.
serverGroupName String
The name of the ServerGroup.

Outputs

All input properties are implicitly available as output properties. Additionally, the ServerGroup 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 ServerGroup Resource

Get an existing ServerGroup 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?: ServerGroupState, opts?: CustomResourceOptions): ServerGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        address_ip_version: Optional[str] = None,
        description: Optional[str] = None,
        load_balancer_id: Optional[str] = None,
        server_group_id: Optional[str] = None,
        server_group_name: Optional[str] = None) -> ServerGroup
func GetServerGroup(ctx *Context, name string, id IDInput, state *ServerGroupState, opts ...ResourceOption) (*ServerGroup, error)
public static ServerGroup Get(string name, Input<string> id, ServerGroupState? state, CustomResourceOptions? opts = null)
public static ServerGroup get(String name, Output<String> id, ServerGroupState state, CustomResourceOptions options)
resources:  _:    type: volcengine:clb:ServerGroup    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:
AddressIpVersion Changes to this property will trigger replacement. string
The address ip version of the ServerGroup. Valid values: ipv4, ipv6. Default is ipv4.
Description string
The description of ServerGroup.
LoadBalancerId Changes to this property will trigger replacement. string
The ID of the Clb.
ServerGroupId string
The ID of the ServerGroup.
ServerGroupName string
The name of the ServerGroup.
AddressIpVersion Changes to this property will trigger replacement. string
The address ip version of the ServerGroup. Valid values: ipv4, ipv6. Default is ipv4.
Description string
The description of ServerGroup.
LoadBalancerId Changes to this property will trigger replacement. string
The ID of the Clb.
ServerGroupId string
The ID of the ServerGroup.
ServerGroupName string
The name of the ServerGroup.
addressIpVersion Changes to this property will trigger replacement. String
The address ip version of the ServerGroup. Valid values: ipv4, ipv6. Default is ipv4.
description String
The description of ServerGroup.
loadBalancerId Changes to this property will trigger replacement. String
The ID of the Clb.
serverGroupId String
The ID of the ServerGroup.
serverGroupName String
The name of the ServerGroup.
addressIpVersion Changes to this property will trigger replacement. string
The address ip version of the ServerGroup. Valid values: ipv4, ipv6. Default is ipv4.
description string
The description of ServerGroup.
loadBalancerId Changes to this property will trigger replacement. string
The ID of the Clb.
serverGroupId string
The ID of the ServerGroup.
serverGroupName string
The name of the ServerGroup.
address_ip_version Changes to this property will trigger replacement. str
The address ip version of the ServerGroup. Valid values: ipv4, ipv6. Default is ipv4.
description str
The description of ServerGroup.
load_balancer_id Changes to this property will trigger replacement. str
The ID of the Clb.
server_group_id str
The ID of the ServerGroup.
server_group_name str
The name of the ServerGroup.
addressIpVersion Changes to this property will trigger replacement. String
The address ip version of the ServerGroup. Valid values: ipv4, ipv6. Default is ipv4.
description String
The description of ServerGroup.
loadBalancerId Changes to this property will trigger replacement. String
The ID of the Clb.
serverGroupId String
The ID of the ServerGroup.
serverGroupName String
The name of the ServerGroup.

Import

ServerGroup can be imported using the id, e.g.

$ pulumi import volcengine:clb/serverGroup:ServerGroup default rsp-273yv0kir1vk07fap8tt9jtwg
Copy

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

Package Details

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