1. Packages
  2. Gcorelabs Provider
  3. API Docs
  4. Servergroup
gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core

gcorelabs.Servergroup

Explore with Pulumi AI

Represent server group resource

Example Usage

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

const _default = new gcore.index.Gcore_servergroup("default", {
    name: "default",
    policy: "affinity",
    regionId: 1,
    projectId: 1,
});
Copy
import pulumi
import pulumi_gcore as gcore

default = gcore.index.Gcore_servergroup("default",
    name=default,
    policy=affinity,
    region_id=1,
    project_id=1)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcore/sdk/go/gcore"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gcore.NewGcore_servergroup(ctx, "default", &gcore.Gcore_servergroupArgs{
			Name:      "default",
			Policy:    "affinity",
			RegionId:  1,
			ProjectId: 1,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;

return await Deployment.RunAsync(() => 
{
    var @default = new Gcore.Index.Gcore_servergroup("default", new()
    {
        Name = "default",
        Policy = "affinity",
        RegionId = 1,
        ProjectId = 1,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.gcore_servergroup;
import com.pulumi.gcore.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 default_ = new Gcore_servergroup("default", Gcore_servergroupArgs.builder()
            .name("default")
            .policy("affinity")
            .regionId(1)
            .projectId(1)
            .build());

    }
}
Copy
resources:
  default:
    type: gcore:gcore_servergroup
    properties:
      name: default
      policy: affinity
      regionId: 1
      projectId: 1
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,
                policy: Optional[str] = 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: gcorelabs: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 servergroupResource = new Gcorelabs.Servergroup("servergroupResource", new()
{
    Policy = "string",
    Name = "string",
    ProjectId = 0,
    ProjectName = "string",
    RegionId = 0,
    RegionName = "string",
    ServergroupId = "string",
});
Copy
example, err := gcorelabs.NewServergroup(ctx, "servergroupResource", &gcorelabs.ServergroupArgs{
Policy: 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"),
})
Copy
var servergroupResource = new Servergroup("servergroupResource", ServergroupArgs.builder()
    .policy("string")
    .name("string")
    .projectId(0)
    .projectName("string")
    .regionId(0)
    .regionName("string")
    .servergroupId("string")
    .build());
Copy
servergroup_resource = gcorelabs.Servergroup("servergroupResource",
    policy="string",
    name="string",
    project_id=0,
    project_name="string",
    region_id=0,
    region_name="string",
    servergroup_id="string")
Copy
const servergroupResource = new gcorelabs.Servergroup("servergroupResource", {
    policy: "string",
    name: "string",
    projectId: 0,
    projectName: "string",
    regionId: 0,
    regionName: "string",
    servergroupId: "string",
});
Copy
type: gcorelabs:Servergroup
properties:
    name: string
    policy: string
    projectId: 0
    projectName: string
    regionId: 0
    regionName: string
    servergroupId: 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:

Policy This property is required. string
Server group policy. Available value is 'affinity', 'anti-affinity'
Name string
Displayed server group name
ProjectId double
ProjectName string
RegionId double
RegionName string
ServergroupId string
The ID of this resource.
Policy This property is required. string
Server group policy. Available value is 'affinity', 'anti-affinity'
Name string
Displayed server group name
ProjectId float64
ProjectName string
RegionId float64
RegionName string
ServergroupId string
The ID of this resource.
policy This property is required. String
Server group policy. Available value is 'affinity', 'anti-affinity'
name String
Displayed server group name
projectId Double
projectName String
regionId Double
regionName String
servergroupId String
The ID of this resource.
policy This property is required. string
Server group policy. Available value is 'affinity', 'anti-affinity'
name string
Displayed server group name
projectId number
projectName string
regionId number
regionName string
servergroupId string
The ID of this resource.
policy This property is required. str
Server group policy. Available value is 'affinity', 'anti-affinity'
name str
Displayed server group name
project_id float
project_name str
region_id float
region_name str
servergroup_id str
The ID of this resource.
policy This property is required. String
Server group policy. Available value is 'affinity', 'anti-affinity'
name String
Displayed server group name
projectId Number
projectName String
regionId Number
regionName String
servergroupId String
The ID of this resource.

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.
Instances List<ServergroupInstance>
Instances in this server group
Id string
The provider-assigned unique ID for this managed resource.
Instances []ServergroupInstance
Instances in this server group
id String
The provider-assigned unique ID for this managed resource.
instances List<ServergroupInstance>
Instances in this server group
id string
The provider-assigned unique ID for this managed resource.
instances ServergroupInstance[]
Instances in this server group
id str
The provider-assigned unique ID for this managed resource.
instances Sequence[ServergroupInstance]
Instances in this server group
id String
The provider-assigned unique ID for this managed resource.
instances List<Property Map>
Instances in this server group

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: gcorelabs: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:
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'
ProjectId double
ProjectName string
RegionId double
RegionName string
ServergroupId string
The ID of this resource.
Instances []ServergroupInstanceArgs
Instances in this server group
Name string
Displayed server group name
Policy string
Server group policy. Available value is 'affinity', 'anti-affinity'
ProjectId float64
ProjectName string
RegionId float64
RegionName string
ServergroupId string
The ID of this resource.
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'
projectId Double
projectName String
regionId Double
regionName String
servergroupId String
The ID of this resource.
instances ServergroupInstance[]
Instances in this server group
name string
Displayed server group name
policy string
Server group policy. Available value is 'affinity', 'anti-affinity'
projectId number
projectName string
regionId number
regionName string
servergroupId string
The ID of this resource.
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'
project_id float
project_name str
region_id float
region_name str
servergroup_id str
The ID of this resource.
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'
projectId Number
projectName String
regionId Number
regionName String
servergroupId String
The ID of this resource.

Supporting Types

ServergroupInstance
, ServergroupInstanceArgs

InstanceId This property is required. string
InstanceName This property is required. string
InstanceId This property is required. string
InstanceName This property is required. string
instanceId This property is required. String
instanceName This property is required. String
instanceId This property is required. string
instanceName This property is required. string
instance_id This property is required. str
instance_name This property is required. str
instanceId This property is required. String
instanceName This property is required. String

Import

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

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

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

Package Details

Repository
gcorelabs g-core/terraform-provider-gcorelabs
License
Notes
This Pulumi package is based on the gcorelabs Terraform Provider.