1. Packages
  2. Gcore Provider
  3. API Docs
  4. Servergroup
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

gcore.Servergroup

Explore with Pulumi AI

gcore logo
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

    Represent server group resource

    Example Usage

    Prerequisite

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const project = gcore.getProject({
        name: "Default",
    });
    const region = gcore.getRegion({
        name: "Luxembourg-2",
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    project = gcore.get_project(name="Default")
    region = gcore.get_region(name="Luxembourg-2")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gcore.GetProject(ctx, &gcore.GetProjectArgs{
    			Name: "Default",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = gcore.GetRegion(ctx, &gcore.GetRegionArgs{
    			Name: "Luxembourg-2",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var project = Gcore.GetProject.Invoke(new()
        {
            Name = "Default",
        });
    
        var region = Gcore.GetRegion.Invoke(new()
        {
            Name = "Luxembourg-2",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.GcoreFunctions;
    import com.pulumi.gcore.inputs.GetProjectArgs;
    import com.pulumi.gcore.inputs.GetRegionArgs;
    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 project = GcoreFunctions.getProject(GetProjectArgs.builder()
                .name("Default")
                .build());
    
            final var region = GcoreFunctions.getRegion(GetRegionArgs.builder()
                .name("Luxembourg-2")
                .build());
    
        }
    }
    
    variables:
      project:
        fn::invoke:
          function: gcore:getProject
          arguments:
            name: Default
      region:
        fn::invoke:
          function: gcore:getRegion
          arguments:
            name: Luxembourg-2
    

    Creating basic server group

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const servergroup = new gcore.Servergroup("servergroup", {
        policy: "affinity",
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    servergroup = gcore.Servergroup("servergroup",
        policy="affinity",
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gcore.NewServergroup(ctx, "servergroup", &gcore.ServergroupArgs{
    			Policy:    pulumi.String("affinity"),
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var servergroup = new Gcore.Servergroup("servergroup", new()
        {
            Policy = "affinity",
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.Servergroup;
    import com.pulumi.gcore.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) {
            var servergroup = new Servergroup("servergroup", ServergroupArgs.builder()
                .policy("affinity")
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
        }
    }
    
    resources:
      servergroup:
        type: gcore:Servergroup
        properties:
          policy: affinity
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
    

    Creating server group with two instances

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const ubuntu = gcore.getImage({
        name: "ubuntu-22.04-x64",
        regionId: data.gcore_region.region.id,
        projectId: data.gcore_project.project.id,
    });
    const bootVolume = new gcore.Volume("bootVolume", {
        typeName: "ssd_hiiops",
        size: 5,
        imageId: ubuntu.then(ubuntu => ubuntu.id),
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    const bootVolume2 = new gcore.Volume("bootVolume2", {
        typeName: "ssd_hiiops",
        size: 5,
        imageId: ubuntu.then(ubuntu => ubuntu.id),
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    const instance = new gcore.Instancev2("instance", {
        flavorId: "g1-standard-2-4",
        volumes: [{
            volumeId: bootVolume.volumeId,
            bootIndex: 0,
        }],
        interfaces: [{
            type: "external",
            name: "my-external-interface",
        }],
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    const instance2 = new gcore.Instancev2("instance2", {
        flavorId: "g1-standard-2-4",
        volumes: [{
            volumeId: bootVolume2.volumeId,
            bootIndex: 0,
        }],
        interfaces: [{
            type: "external",
            name: "my-external-interface",
        }],
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    const servergroup = new gcore.Servergroup("servergroup", {
        policy: "affinity",
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
        instances: [
            {
                instanceId: instance.instancev2Id,
            },
            {
                instanceId: instance2.instancev2Id,
            },
        ],
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    ubuntu = gcore.get_image(name="ubuntu-22.04-x64",
        region_id=data["gcore_region"]["region"]["id"],
        project_id=data["gcore_project"]["project"]["id"])
    boot_volume = gcore.Volume("bootVolume",
        type_name="ssd_hiiops",
        size=5,
        image_id=ubuntu.id,
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    boot_volume2 = gcore.Volume("bootVolume2",
        type_name="ssd_hiiops",
        size=5,
        image_id=ubuntu.id,
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    instance = gcore.Instancev2("instance",
        flavor_id="g1-standard-2-4",
        volumes=[{
            "volume_id": boot_volume.volume_id,
            "boot_index": 0,
        }],
        interfaces=[{
            "type": "external",
            "name": "my-external-interface",
        }],
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    instance2 = gcore.Instancev2("instance2",
        flavor_id="g1-standard-2-4",
        volumes=[{
            "volume_id": boot_volume2.volume_id,
            "boot_index": 0,
        }],
        interfaces=[{
            "type": "external",
            "name": "my-external-interface",
        }],
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    servergroup = gcore.Servergroup("servergroup",
        policy="affinity",
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"],
        instances=[
            {
                "instance_id": instance.instancev2_id,
            },
            {
                "instance_id": instance2.instancev2_id,
            },
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ubuntu, err := gcore.GetImage(ctx, &gcore.GetImageArgs{
    			Name:      pulumi.StringRef("ubuntu-22.04-x64"),
    			RegionId:  pulumi.Float64Ref(data.Gcore_region.Region.Id),
    			ProjectId: pulumi.Float64Ref(data.Gcore_project.Project.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		bootVolume, err := gcore.NewVolume(ctx, "bootVolume", &gcore.VolumeArgs{
    			TypeName:  pulumi.String("ssd_hiiops"),
    			Size:      pulumi.Float64(5),
    			ImageId:   pulumi.String(ubuntu.Id),
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		bootVolume2, err := gcore.NewVolume(ctx, "bootVolume2", &gcore.VolumeArgs{
    			TypeName:  pulumi.String("ssd_hiiops"),
    			Size:      pulumi.Float64(5),
    			ImageId:   pulumi.String(ubuntu.Id),
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		instance, err := gcore.NewInstancev2(ctx, "instance", &gcore.Instancev2Args{
    			FlavorId: pulumi.String("g1-standard-2-4"),
    			Volumes: gcore.Instancev2VolumeArray{
    				&gcore.Instancev2VolumeArgs{
    					VolumeId:  bootVolume.VolumeId,
    					BootIndex: pulumi.Float64(0),
    				},
    			},
    			Interfaces: gcore.Instancev2InterfaceArray{
    				&gcore.Instancev2InterfaceArgs{
    					Type: pulumi.String("external"),
    					Name: pulumi.String("my-external-interface"),
    				},
    			},
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		instance2, err := gcore.NewInstancev2(ctx, "instance2", &gcore.Instancev2Args{
    			FlavorId: pulumi.String("g1-standard-2-4"),
    			Volumes: gcore.Instancev2VolumeArray{
    				&gcore.Instancev2VolumeArgs{
    					VolumeId:  bootVolume2.VolumeId,
    					BootIndex: pulumi.Float64(0),
    				},
    			},
    			Interfaces: gcore.Instancev2InterfaceArray{
    				&gcore.Instancev2InterfaceArgs{
    					Type: pulumi.String("external"),
    					Name: pulumi.String("my-external-interface"),
    				},
    			},
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gcore.NewServergroup(ctx, "servergroup", &gcore.ServergroupArgs{
    			Policy:    pulumi.String("affinity"),
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    			Instances: gcore.ServergroupInstanceArray{
    				&gcore.ServergroupInstanceArgs{
    					InstanceId: instance.Instancev2Id,
    				},
    				&gcore.ServergroupInstanceArgs{
    					InstanceId: instance2.Instancev2Id,
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var ubuntu = Gcore.GetImage.Invoke(new()
        {
            Name = "ubuntu-22.04-x64",
            RegionId = data.Gcore_region.Region.Id,
            ProjectId = data.Gcore_project.Project.Id,
        });
    
        var bootVolume = new Gcore.Volume("bootVolume", new()
        {
            TypeName = "ssd_hiiops",
            Size = 5,
            ImageId = ubuntu.Apply(getImageResult => getImageResult.Id),
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
        var bootVolume2 = new Gcore.Volume("bootVolume2", new()
        {
            TypeName = "ssd_hiiops",
            Size = 5,
            ImageId = ubuntu.Apply(getImageResult => getImageResult.Id),
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
        var instance = new Gcore.Instancev2("instance", new()
        {
            FlavorId = "g1-standard-2-4",
            Volumes = new[]
            {
                new Gcore.Inputs.Instancev2VolumeArgs
                {
                    VolumeId = bootVolume.VolumeId,
                    BootIndex = 0,
                },
            },
            Interfaces = new[]
            {
                new Gcore.Inputs.Instancev2InterfaceArgs
                {
                    Type = "external",
                    Name = "my-external-interface",
                },
            },
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
        var instance2 = new Gcore.Instancev2("instance2", new()
        {
            FlavorId = "g1-standard-2-4",
            Volumes = new[]
            {
                new Gcore.Inputs.Instancev2VolumeArgs
                {
                    VolumeId = bootVolume2.VolumeId,
                    BootIndex = 0,
                },
            },
            Interfaces = new[]
            {
                new Gcore.Inputs.Instancev2InterfaceArgs
                {
                    Type = "external",
                    Name = "my-external-interface",
                },
            },
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
        var servergroup = new Gcore.Servergroup("servergroup", new()
        {
            Policy = "affinity",
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
            Instances = new[]
            {
                new Gcore.Inputs.ServergroupInstanceArgs
                {
                    InstanceId = instance.Instancev2Id,
                },
                new Gcore.Inputs.ServergroupInstanceArgs
                {
                    InstanceId = instance2.Instancev2Id,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.GcoreFunctions;
    import com.pulumi.gcore.inputs.GetImageArgs;
    import com.pulumi.gcore.Volume;
    import com.pulumi.gcore.VolumeArgs;
    import com.pulumi.gcore.Instancev2;
    import com.pulumi.gcore.Instancev2Args;
    import com.pulumi.gcore.inputs.Instancev2VolumeArgs;
    import com.pulumi.gcore.inputs.Instancev2InterfaceArgs;
    import com.pulumi.gcore.Servergroup;
    import com.pulumi.gcore.ServergroupArgs;
    import com.pulumi.gcore.inputs.ServergroupInstanceArgs;
    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 ubuntu = GcoreFunctions.getImage(GetImageArgs.builder()
                .name("ubuntu-22.04-x64")
                .regionId(data.gcore_region().region().id())
                .projectId(data.gcore_project().project().id())
                .build());
    
            var bootVolume = new Volume("bootVolume", VolumeArgs.builder()
                .typeName("ssd_hiiops")
                .size(5)
                .imageId(ubuntu.applyValue(getImageResult -> getImageResult.id()))
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
            var bootVolume2 = new Volume("bootVolume2", VolumeArgs.builder()
                .typeName("ssd_hiiops")
                .size(5)
                .imageId(ubuntu.applyValue(getImageResult -> getImageResult.id()))
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
            var instance = new Instancev2("instance", Instancev2Args.builder()
                .flavorId("g1-standard-2-4")
                .volumes(Instancev2VolumeArgs.builder()
                    .volumeId(bootVolume.volumeId())
                    .bootIndex(0)
                    .build())
                .interfaces(Instancev2InterfaceArgs.builder()
                    .type("external")
                    .name("my-external-interface")
                    .build())
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
            var instance2 = new Instancev2("instance2", Instancev2Args.builder()
                .flavorId("g1-standard-2-4")
                .volumes(Instancev2VolumeArgs.builder()
                    .volumeId(bootVolume2.volumeId())
                    .bootIndex(0)
                    .build())
                .interfaces(Instancev2InterfaceArgs.builder()
                    .type("external")
                    .name("my-external-interface")
                    .build())
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
            var servergroup = new Servergroup("servergroup", ServergroupArgs.builder()
                .policy("affinity")
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .instances(            
                    ServergroupInstanceArgs.builder()
                        .instanceId(instance.instancev2Id())
                        .build(),
                    ServergroupInstanceArgs.builder()
                        .instanceId(instance2.instancev2Id())
                        .build())
                .build());
    
        }
    }
    
    resources:
      bootVolume:
        type: gcore:Volume
        properties:
          typeName: ssd_hiiops
          size: 5
          imageId: ${ubuntu.id}
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
      bootVolume2:
        type: gcore:Volume
        properties:
          typeName: ssd_hiiops
          size: 5
          imageId: ${ubuntu.id}
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
      instance:
        type: gcore:Instancev2
        properties:
          flavorId: g1-standard-2-4
          volumes:
            - volumeId: ${bootVolume.volumeId}
              bootIndex: 0
          interfaces:
            - type: external
              name: my-external-interface
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
      instance2:
        type: gcore:Instancev2
        properties:
          flavorId: g1-standard-2-4
          volumes:
            - volumeId: ${bootVolume2.volumeId}
              bootIndex: 0
          interfaces:
            - type: external
              name: my-external-interface
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
      servergroup:
        type: gcore:Servergroup
        properties:
          policy: affinity
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
          instances:
            - instanceId: ${instance.instancev2Id}
            - instanceId: ${instance2.instancev2Id}
    variables:
      ubuntu:
        fn::invoke:
          function: gcore:getImage
          arguments:
            name: ubuntu-22.04-x64
            regionId: ${data.gcore_region.region.id}
            projectId: ${data.gcore_project.project.id}
    

    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,
                    policy: Optional[str] = None,
                    instances: Optional[Sequence[ServergroupInstanceArgs]] = None,
                    name: Optional[str] = None,
                    project_id: Optional[float] = None,
                    project_name: Optional[str] = None,
                    region_id: Optional[float] = None,
                    region_name: Optional[str] = None,
                    servergroup_id: 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: gcore:Servergroup
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ServergroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args ServergroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServergroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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 servergroupResource = new Gcore.Servergroup("servergroupResource", new()
    {
        Policy = "string",
        Instances = new[]
        {
            new Gcore.Inputs.ServergroupInstanceArgs
            {
                InstanceId = "string",
                InstanceName = "string",
            },
        },
        Name = "string",
        ProjectId = 0,
        ProjectName = "string",
        RegionId = 0,
        RegionName = "string",
        ServergroupId = "string",
    });
    
    example, err := gcore.NewServergroup(ctx, "servergroupResource", &gcore.ServergroupArgs{
    	Policy: pulumi.String("string"),
    	Instances: gcore.ServergroupInstanceArray{
    		&gcore.ServergroupInstanceArgs{
    			InstanceId:   pulumi.String("string"),
    			InstanceName: pulumi.String("string"),
    		},
    	},
    	Name:          pulumi.String("string"),
    	ProjectId:     pulumi.Float64(0),
    	ProjectName:   pulumi.String("string"),
    	RegionId:      pulumi.Float64(0),
    	RegionName:    pulumi.String("string"),
    	ServergroupId: pulumi.String("string"),
    })
    
    var servergroupResource = new Servergroup("servergroupResource", ServergroupArgs.builder()
        .policy("string")
        .instances(ServergroupInstanceArgs.builder()
            .instanceId("string")
            .instanceName("string")
            .build())
        .name("string")
        .projectId(0)
        .projectName("string")
        .regionId(0)
        .regionName("string")
        .servergroupId("string")
        .build());
    
    servergroup_resource = gcore.Servergroup("servergroupResource",
        policy="string",
        instances=[{
            "instance_id": "string",
            "instance_name": "string",
        }],
        name="string",
        project_id=0,
        project_name="string",
        region_id=0,
        region_name="string",
        servergroup_id="string")
    
    const servergroupResource = new gcore.Servergroup("servergroupResource", {
        policy: "string",
        instances: [{
            instanceId: "string",
            instanceName: "string",
        }],
        name: "string",
        projectId: 0,
        projectName: "string",
        regionId: 0,
        regionName: "string",
        servergroupId: "string",
    });
    
    type: gcore:Servergroup
    properties:
        instances:
            - instanceId: string
              instanceName: string
        name: string
        policy: string
        projectId: 0
        projectName: string
        regionId: 0
        regionName: string
        servergroupId: string
    

    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:

    Policy string
    Server group policy. Available value is 'affinity' 'anti-affinity' 'soft-anti-affinity'.
    Instances List<ServergroupInstance>
    Instances in this server group
    Name string
    Displayed server group name
    ProjectId double
    ProjectName string
    RegionId double
    RegionName string
    ServergroupId string
    Policy string
    Server group policy. Available value is 'affinity' 'anti-affinity' 'soft-anti-affinity'.
    Instances []ServergroupInstanceArgs
    Instances in this server group
    Name string
    Displayed server group name
    ProjectId float64
    ProjectName string
    RegionId float64
    RegionName string
    ServergroupId string
    policy String
    Server group policy. Available value is 'affinity' 'anti-affinity' 'soft-anti-affinity'.
    instances List<ServergroupInstance>
    Instances in this server group
    name String
    Displayed server group name
    projectId Double
    projectName String
    regionId Double
    regionName String
    servergroupId String
    policy string
    Server group policy. Available value is 'affinity' 'anti-affinity' 'soft-anti-affinity'.
    instances ServergroupInstance[]
    Instances in this server group
    name string
    Displayed server group name
    projectId number
    projectName string
    regionId number
    regionName string
    servergroupId string
    policy str
    Server group policy. Available value is 'affinity' 'anti-affinity' 'soft-anti-affinity'.
    instances Sequence[ServergroupInstanceArgs]
    Instances in this server group
    name str
    Displayed server group name
    project_id float
    project_name str
    region_id float
    region_name str
    servergroup_id str
    policy String
    Server group policy. Available value is 'affinity' 'anti-affinity' 'soft-anti-affinity'.
    instances List<Property Map>
    Instances in this server group
    name String
    Displayed server group name
    projectId Number
    projectName String
    regionId Number
    regionName String
    servergroupId String

    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,
            instances: Optional[Sequence[ServergroupInstanceArgs]] = None,
            name: Optional[str] = None,
            policy: Optional[str] = None,
            project_id: Optional[float] = None,
            project_name: Optional[str] = None,
            region_id: Optional[float] = None,
            region_name: Optional[str] = None,
            servergroup_id: 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: gcore:Servergroup    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    Instances List<ServergroupInstance>
    Instances in this server group
    Name string
    Displayed server group name
    Policy string
    Server group policy. Available value is 'affinity' 'anti-affinity' 'soft-anti-affinity'.
    ProjectId double
    ProjectName string
    RegionId double
    RegionName string
    ServergroupId string
    Instances []ServergroupInstanceArgs
    Instances in this server group
    Name string
    Displayed server group name
    Policy string
    Server group policy. Available value is 'affinity' 'anti-affinity' 'soft-anti-affinity'.
    ProjectId float64
    ProjectName string
    RegionId float64
    RegionName string
    ServergroupId string
    instances List<ServergroupInstance>
    Instances in this server group
    name String
    Displayed server group name
    policy String
    Server group policy. Available value is 'affinity' 'anti-affinity' 'soft-anti-affinity'.
    projectId Double
    projectName String
    regionId Double
    regionName String
    servergroupId String
    instances ServergroupInstance[]
    Instances in this server group
    name string
    Displayed server group name
    policy string
    Server group policy. Available value is 'affinity' 'anti-affinity' 'soft-anti-affinity'.
    projectId number
    projectName string
    regionId number
    regionName string
    servergroupId string
    instances Sequence[ServergroupInstanceArgs]
    Instances in this server group
    name str
    Displayed server group name
    policy str
    Server group policy. Available value is 'affinity' 'anti-affinity' 'soft-anti-affinity'.
    project_id float
    project_name str
    region_id float
    region_name str
    servergroup_id str
    instances List<Property Map>
    Instances in this server group
    name String
    Displayed server group name
    policy String
    Server group policy. Available value is 'affinity' 'anti-affinity' 'soft-anti-affinity'.
    projectId Number
    projectName String
    regionId Number
    regionName String
    servergroupId String

    Supporting Types

    ServergroupInstance, ServergroupInstanceArgs

    Import

    import using <project_id>:<region_id>:<servergroup_id> format

    $ pulumi import gcore:index/servergroup:Servergroup servergroup1 1:6:447d2959-8ae0-4ca0-8d47-9f050a3637d7
    

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

    Package Details

    Repository
    gcore g-core/terraform-provider-gcore
    License
    Notes
    This Pulumi package is based on the gcore Terraform Provider.
    gcore logo
    gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core