Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine
volcengine.clb.ServerGroupServers
Explore with Pulumi AI
Use this data source to query detailed information of server group servers
Example Usage
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",
    });
    var fooSecurityGroup = new Volcengine.Vpc.SecurityGroup("fooSecurityGroup", new()
    {
        VpcId = fooVpc.Id,
        SecurityGroupName = "acc-test-security-group",
    });
    var fooInstance = new Volcengine.Ecs.Instance("fooInstance", new()
    {
        ImageId = "image-ycjwwciuzy5pkh54xx8f",
        InstanceType = "ecs.c3i.large",
        InstanceName = "acc-test-ecs-name",
        Password = "93f0cb0614Aab12",
        InstanceChargeType = "PostPaid",
        SystemVolumeType = "ESSD_PL0",
        SystemVolumeSize = 40,
        SubnetId = fooSubnet.Id,
        SecurityGroupIds = new[]
        {
            fooSecurityGroup.Id,
        },
    });
    var fooServerGroupServer = new Volcengine.Clb.ServerGroupServer("fooServerGroupServer", new()
    {
        ServerGroupId = fooServerGroup.Id,
        InstanceId = fooInstance.Id,
        Type = "ecs",
        Weight = 100,
        Port = 80,
        Description = "This is a acc test server",
    });
    var fooServerGroupServers = Volcengine.Clb.ServerGroupServers.Invoke(new()
    {
        Ids = new[]
        {
            fooServerGroupServer.Id.Split(":")[fooServerGroupServer.Id.Split(":").Length - 1],
        },
        ServerGroupId = fooServerGroup.Id,
    });
});
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
		}
		fooServerGroup, 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
		}
		fooSecurityGroup, err := vpc.NewSecurityGroup(ctx, "fooSecurityGroup", &vpc.SecurityGroupArgs{
			VpcId:             fooVpc.ID(),
			SecurityGroupName: pulumi.String("acc-test-security-group"),
		})
		if err != nil {
			return err
		}
		fooInstance, err := ecs.NewInstance(ctx, "fooInstance", &ecs.InstanceArgs{
			ImageId:            pulumi.String("image-ycjwwciuzy5pkh54xx8f"),
			InstanceType:       pulumi.String("ecs.c3i.large"),
			InstanceName:       pulumi.String("acc-test-ecs-name"),
			Password:           pulumi.String("93f0cb0614Aab12"),
			InstanceChargeType: pulumi.String("PostPaid"),
			SystemVolumeType:   pulumi.String("ESSD_PL0"),
			SystemVolumeSize:   pulumi.Int(40),
			SubnetId:           fooSubnet.ID(),
			SecurityGroupIds: pulumi.StringArray{
				fooSecurityGroup.ID(),
			},
		})
		if err != nil {
			return err
		}
		fooServerGroupServer, err := clb.NewServerGroupServer(ctx, "fooServerGroupServer", &clb.ServerGroupServerArgs{
			ServerGroupId: fooServerGroup.ID(),
			InstanceId:    fooInstance.ID(),
			Type:          pulumi.String("ecs"),
			Weight:        pulumi.Int(100),
			Port:          pulumi.Int(80),
			Description:   pulumi.String("This is a acc test server"),
		})
		if err != nil {
			return err
		}
		_ = clb.ServerGroupServersOutput(ctx, clb.ServerGroupServersOutputArgs{
			Ids: pulumi.StringArray{
				pulumi.All(fooServerGroupServer.ID().ApplyT(func(id string) (pulumi.StringArray, error) {
					return pulumi.StringArray("TODO: call split"), nil
				}).(pulumi.StringArrayOutput), len(fooServerGroupServer.ID().ApplyT(func(id string) (pulumi.StringArray, error) {
					return pulumi.StringArray("TODO: call split"), nil
				}).(pulumi.StringArrayOutput))).ApplyT(func(_args []interface{}) (string, error) {
					split := _args[0].([]string)
					length := _args[1].(int)
					return "TODO: element", nil
				}).(pulumi.StringOutput),
			},
			ServerGroupId: fooServerGroup.ID(),
		}, nil)
		return nil
	})
}
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 com.pulumi.volcengine.vpc.SecurityGroup;
import com.pulumi.volcengine.vpc.SecurityGroupArgs;
import com.pulumi.volcengine.ecs.Instance;
import com.pulumi.volcengine.ecs.InstanceArgs;
import com.pulumi.volcengine.clb.ServerGroupServer;
import com.pulumi.volcengine.clb.ServerGroupServerArgs;
import com.pulumi.volcengine.clb.ClbFunctions;
import com.pulumi.volcengine.clb.inputs.ServerGroupServersArgs;
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());
        var fooSecurityGroup = new SecurityGroup("fooSecurityGroup", SecurityGroupArgs.builder()        
            .vpcId(fooVpc.id())
            .securityGroupName("acc-test-security-group")
            .build());
        var fooInstance = new Instance("fooInstance", InstanceArgs.builder()        
            .imageId("image-ycjwwciuzy5pkh54xx8f")
            .instanceType("ecs.c3i.large")
            .instanceName("acc-test-ecs-name")
            .password("93f0cb0614Aab12")
            .instanceChargeType("PostPaid")
            .systemVolumeType("ESSD_PL0")
            .systemVolumeSize(40)
            .subnetId(fooSubnet.id())
            .securityGroupIds(fooSecurityGroup.id())
            .build());
        var fooServerGroupServer = new ServerGroupServer("fooServerGroupServer", ServerGroupServerArgs.builder()        
            .serverGroupId(fooServerGroup.id())
            .instanceId(fooInstance.id())
            .type("ecs")
            .weight(100)
            .port(80)
            .description("This is a acc test server")
            .build());
        final var fooServerGroupServers = ClbFunctions.ServerGroupServers(ServerGroupServersArgs.builder()
            .ids(Output.tuple(fooServerGroupServer.id().applyValue(id -> id.split(":")), fooServerGroupServer.id().applyValue(id -> id.split(":")).length()).applyValue(values -> {
                var split = values.t1;
                var length = values.t2;
                return split[length - 1];
            }))
            .serverGroupId(fooServerGroup.id())
            .build());
    }
}
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")
foo_security_group = volcengine.vpc.SecurityGroup("fooSecurityGroup",
    vpc_id=foo_vpc.id,
    security_group_name="acc-test-security-group")
foo_instance = volcengine.ecs.Instance("fooInstance",
    image_id="image-ycjwwciuzy5pkh54xx8f",
    instance_type="ecs.c3i.large",
    instance_name="acc-test-ecs-name",
    password="93f0cb0614Aab12",
    instance_charge_type="PostPaid",
    system_volume_type="ESSD_PL0",
    system_volume_size=40,
    subnet_id=foo_subnet.id,
    security_group_ids=[foo_security_group.id])
foo_server_group_server = volcengine.clb.ServerGroupServer("fooServerGroupServer",
    server_group_id=foo_server_group.id,
    instance_id=foo_instance.id,
    type="ecs",
    weight=100,
    port=80,
    description="This is a acc test server")
foo_server_group_servers = volcengine.clb.server_group_servers_output(ids=[pulumi.Output.all(foo_server_group_server.id.apply(lambda id: id.split(":")), len(foo_server_group_server.id.apply(lambda id: id.split(":")))).apply(lambda split, length: split[length - 1])],
    server_group_id=foo_server_group.id)
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",
});
const fooSecurityGroup = new volcengine.vpc.SecurityGroup("fooSecurityGroup", {
    vpcId: fooVpc.id,
    securityGroupName: "acc-test-security-group",
});
const fooInstance = new volcengine.ecs.Instance("fooInstance", {
    imageId: "image-ycjwwciuzy5pkh54xx8f",
    instanceType: "ecs.c3i.large",
    instanceName: "acc-test-ecs-name",
    password: "93f0cb0614Aab12",
    instanceChargeType: "PostPaid",
    systemVolumeType: "ESSD_PL0",
    systemVolumeSize: 40,
    subnetId: fooSubnet.id,
    securityGroupIds: [fooSecurityGroup.id],
});
const fooServerGroupServer = new volcengine.clb.ServerGroupServer("fooServerGroupServer", {
    serverGroupId: fooServerGroup.id,
    instanceId: fooInstance.id,
    type: "ecs",
    weight: 100,
    port: 80,
    description: "This is a acc test server",
});
const fooServerGroupServers = volcengine.clb.ServerGroupServersOutput({
    ids: [pulumi.all([fooServerGroupServer.id.apply(id => id.split(":")), fooServerGroupServer.id.apply(id => id.split(":")).length]).apply(([split, length]) => split[length - 1])],
    serverGroupId: fooServerGroup.id,
});
Coming soon!
Using ServerGroupServers
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function serverGroupServers(args: ServerGroupServersArgs, opts?: InvokeOptions): Promise<ServerGroupServersResult>
function serverGroupServersOutput(args: ServerGroupServersOutputArgs, opts?: InvokeOptions): Output<ServerGroupServersResult>def server_group_servers(ids: Optional[Sequence[str]] = None,
                         name_regex: Optional[str] = None,
                         output_file: Optional[str] = None,
                         server_group_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> ServerGroupServersResult
def server_group_servers_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                         name_regex: Optional[pulumi.Input[str]] = None,
                         output_file: Optional[pulumi.Input[str]] = None,
                         server_group_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[ServerGroupServersResult]func ServerGroupServers(ctx *Context, args *ServerGroupServersArgs, opts ...InvokeOption) (*ServerGroupServersResult, error)
func ServerGroupServersOutput(ctx *Context, args *ServerGroupServersOutputArgs, opts ...InvokeOption) ServerGroupServersResultOutputpublic static class ServerGroupServers 
{
    public static Task<ServerGroupServersResult> InvokeAsync(ServerGroupServersArgs args, InvokeOptions? opts = null)
    public static Output<ServerGroupServersResult> Invoke(ServerGroupServersInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<ServerGroupServersResult> serverGroupServers(ServerGroupServersArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: volcengine:clb:ServerGroupServers
  arguments:
    # arguments dictionaryThe following arguments are supported:
- ServerGroup stringId 
- The ID of the ServerGroup.
- Ids List<string>
- The list of ServerGroupServer IDs.
- NameRegex string
- A Name Regex of ServerGroupServer.
- OutputFile string
- File name where to save data source results.
- ServerGroup stringId 
- The ID of the ServerGroup.
- Ids []string
- The list of ServerGroupServer IDs.
- NameRegex string
- A Name Regex of ServerGroupServer.
- OutputFile string
- File name where to save data source results.
- serverGroup StringId 
- The ID of the ServerGroup.
- ids List<String>
- The list of ServerGroupServer IDs.
- nameRegex String
- A Name Regex of ServerGroupServer.
- outputFile String
- File name where to save data source results.
- serverGroup stringId 
- The ID of the ServerGroup.
- ids string[]
- The list of ServerGroupServer IDs.
- nameRegex string
- A Name Regex of ServerGroupServer.
- outputFile string
- File name where to save data source results.
- server_group_ strid 
- The ID of the ServerGroup.
- ids Sequence[str]
- The list of ServerGroupServer IDs.
- name_regex str
- A Name Regex of ServerGroupServer.
- output_file str
- File name where to save data source results.
- serverGroup StringId 
- The ID of the ServerGroup.
- ids List<String>
- The list of ServerGroupServer IDs.
- nameRegex String
- A Name Regex of ServerGroupServer.
- outputFile String
- File name where to save data source results.
ServerGroupServers Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- ServerGroup stringId 
- Servers
List<ServerGroup Servers Server> 
- The server list of ServerGroup.
- TotalCount int
- The total count of ServerGroupServer query.
- Ids List<string>
- NameRegex string
- OutputFile string
- Id string
- The provider-assigned unique ID for this managed resource.
- ServerGroup stringId 
- Servers
[]ServerGroup Servers Server 
- The server list of ServerGroup.
- TotalCount int
- The total count of ServerGroupServer query.
- Ids []string
- NameRegex string
- OutputFile string
- id String
- The provider-assigned unique ID for this managed resource.
- serverGroup StringId 
- servers
List<ServerGroup Servers Server> 
- The server list of ServerGroup.
- totalCount Integer
- The total count of ServerGroupServer query.
- ids List<String>
- nameRegex String
- outputFile String
- id string
- The provider-assigned unique ID for this managed resource.
- serverGroup stringId 
- servers
ServerGroup Servers Server[] 
- The server list of ServerGroup.
- totalCount number
- The total count of ServerGroupServer query.
- ids string[]
- nameRegex string
- outputFile string
- id str
- The provider-assigned unique ID for this managed resource.
- server_group_ strid 
- servers
Sequence[ServerGroup Servers Server] 
- The server list of ServerGroup.
- total_count int
- The total count of ServerGroupServer query.
- ids Sequence[str]
- name_regex str
- output_file str
- id String
- The provider-assigned unique ID for this managed resource.
- serverGroup StringId 
- servers List<Property Map>
- The server list of ServerGroup.
- totalCount Number
- The total count of ServerGroupServer query.
- ids List<String>
- nameRegex String
- outputFile String
Supporting Types
ServerGroupServersServer   
- Description string
- The description of the instance.
- Id string
- The server id of instance in ServerGroup.
- InstanceId string
- The ID of ecs instance or the network card bound to ecs instance.
- Ip string
- The private ip of the instance.
- Port int
- The port receiving request.
- ServerId string
- The server id of instance in ServerGroup.
- Type string
- The type of instance. Optional choice contains ecs,eni.
- Weight int
- The weight of the instance.
- Description string
- The description of the instance.
- Id string
- The server id of instance in ServerGroup.
- InstanceId string
- The ID of ecs instance or the network card bound to ecs instance.
- Ip string
- The private ip of the instance.
- Port int
- The port receiving request.
- ServerId string
- The server id of instance in ServerGroup.
- Type string
- The type of instance. Optional choice contains ecs,eni.
- Weight int
- The weight of the instance.
- description String
- The description of the instance.
- id String
- The server id of instance in ServerGroup.
- instanceId String
- The ID of ecs instance or the network card bound to ecs instance.
- ip String
- The private ip of the instance.
- port Integer
- The port receiving request.
- serverId String
- The server id of instance in ServerGroup.
- type String
- The type of instance. Optional choice contains ecs,eni.
- weight Integer
- The weight of the instance.
- description string
- The description of the instance.
- id string
- The server id of instance in ServerGroup.
- instanceId string
- The ID of ecs instance or the network card bound to ecs instance.
- ip string
- The private ip of the instance.
- port number
- The port receiving request.
- serverId string
- The server id of instance in ServerGroup.
- type string
- The type of instance. Optional choice contains ecs,eni.
- weight number
- The weight of the instance.
- description str
- The description of the instance.
- id str
- The server id of instance in ServerGroup.
- instance_id str
- The ID of ecs instance or the network card bound to ecs instance.
- ip str
- The private ip of the instance.
- port int
- The port receiving request.
- server_id str
- The server id of instance in ServerGroup.
- type str
- The type of instance. Optional choice contains ecs,eni.
- weight int
- The weight of the instance.
- description String
- The description of the instance.
- id String
- The server id of instance in ServerGroup.
- instanceId String
- The ID of ecs instance or the network card bound to ecs instance.
- ip String
- The private ip of the instance.
- port Number
- The port receiving request.
- serverId String
- The server id of instance in ServerGroup.
- type String
- The type of instance. Optional choice contains ecs,eni.
- weight Number
- The weight of the instance.
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the volcengineTerraform Provider.