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,
});
import pulumi
import pulumi_gcore as gcore
default = gcore.index.Gcore_servergroup("default",
name=default,
policy=affinity,
region_id=1,
project_id=1)
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
})
}
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,
});
});
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());
}
}
resources:
default:
type: gcore:gcore_servergroup
properties:
name: default
policy: affinity
regionId: 1
projectId: 1
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 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 Gcorelabs.Servergroup("servergroupResource", new()
{
Policy = "string",
Name = "string",
ProjectId = 0,
ProjectName = "string",
RegionId = 0,
RegionName = "string",
ServergroupId = "string",
});
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"),
})
var servergroupResource = new Servergroup("servergroupResource", ServergroupArgs.builder()
.policy("string")
.name("string")
.projectId(0)
.projectName("string")
.regionId(0)
.regionName("string")
.servergroupId("string")
.build());
servergroup_resource = gcorelabs.Servergroup("servergroupResource",
policy="string",
name="string",
project_id=0,
project_name="string",
region_id=0,
region_name="string",
servergroup_id="string")
const servergroupResource = new gcorelabs.Servergroup("servergroupResource", {
policy: "string",
name: "string",
projectId: 0,
projectName: "string",
regionId: 0,
regionName: "string",
servergroupId: "string",
});
type: gcorelabs:Servergroup
properties:
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'
- Name string
- Displayed server group name
- Project
Id double - Project
Name string - Region
Id double - Region
Name string - Servergroup
Id string - The ID of this resource.
- Policy string
- Server group policy. Available value is 'affinity', 'anti-affinity'
- Name string
- Displayed server group name
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string - Servergroup
Id string - The ID of this resource.
- policy String
- Server group policy. Available value is 'affinity', 'anti-affinity'
- name String
- Displayed server group name
- project
Id Double - project
Name String - region
Id Double - region
Name String - servergroup
Id String - The ID of this resource.
- policy string
- Server group policy. Available value is 'affinity', 'anti-affinity'
- name string
- Displayed server group name
- project
Id number - project
Name string - region
Id number - region
Name string - servergroup
Id string - The ID of this resource.
- policy 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 String
- Server group policy. Available value is 'affinity', 'anti-affinity'
- name String
- Displayed server group name
- project
Id Number - project
Name String - region
Id Number - region
Name String - servergroup
Id 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<Servergroup
Instance> - Instances in this server group
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
[]Servergroup
Instance - Instances in this server group
- id String
- The provider-assigned unique ID for this managed resource.
- instances
List<Servergroup
Instance> - Instances in this server group
- id string
- The provider-assigned unique ID for this managed resource.
- instances
Servergroup
Instance[] - Instances in this server group
- id str
- The provider-assigned unique ID for this managed resource.
- instances
Sequence[Servergroup
Instance] - 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
- 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.
- Instances
List<Servergroup
Instance> - Instances in this server group
- Name string
- Displayed server group name
- Policy string
- Server group policy. Available value is 'affinity', 'anti-affinity'
- Project
Id double - Project
Name string - Region
Id double - Region
Name string - Servergroup
Id string - The ID of this resource.
- Instances
[]Servergroup
Instance Args - Instances in this server group
- Name string
- Displayed server group name
- Policy string
- Server group policy. Available value is 'affinity', 'anti-affinity'
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string - Servergroup
Id string - The ID of this resource.
- instances
List<Servergroup
Instance> - Instances in this server group
- name String
- Displayed server group name
- policy String
- Server group policy. Available value is 'affinity', 'anti-affinity'
- project
Id Double - project
Name String - region
Id Double - region
Name String - servergroup
Id String - The ID of this resource.
- instances
Servergroup
Instance[] - Instances in this server group
- name string
- Displayed server group name
- policy string
- Server group policy. Available value is 'affinity', 'anti-affinity'
- project
Id number - project
Name string - region
Id number - region
Name string - servergroup
Id string - The ID of this resource.
- instances
Sequence[Servergroup
Instance Args] - 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'
- project
Id Number - project
Name String - region
Id Number - region
Name String - servergroup
Id String - The ID of this resource.
Supporting Types
ServergroupInstance, ServergroupInstanceArgs
- Instance
Id string - Instance
Name string
- Instance
Id string - Instance
Name string
- instance
Id String - instance
Name String
- instance
Id string - instance
Name string
- instance_
id str - instance_
name str
- instance
Id String - instance
Name 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
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.