1. Packages
  2. Vkcs Provider
  3. API Docs
  4. ComputeServergroup
vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs

vkcs.ComputeServergroup

Explore with Pulumi AI

vkcs logo
vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs

    Manages a Server Group resource within VKCS.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vkcs from "@pulumi/vkcs";
    
    const cusomGroup = new vkcs.ComputeServergroup("cusomGroup", {policies: ["anti-affinity"]});
    
    import pulumi
    import pulumi_vkcs as vkcs
    
    cusom_group = vkcs.ComputeServergroup("cusomGroup", policies=["anti-affinity"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vkcs/vkcs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vkcs.NewComputeServergroup(ctx, "cusomGroup", &vkcs.ComputeServergroupArgs{
    			Policies: pulumi.StringArray{
    				pulumi.String("anti-affinity"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vkcs = Pulumi.Vkcs;
    
    return await Deployment.RunAsync(() => 
    {
        var cusomGroup = new Vkcs.ComputeServergroup("cusomGroup", new()
        {
            Policies = new[]
            {
                "anti-affinity",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vkcs.ComputeServergroup;
    import com.pulumi.vkcs.ComputeServergroupArgs;
    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 cusomGroup = new ComputeServergroup("cusomGroup", ComputeServergroupArgs.builder()
                .policies("anti-affinity")
                .build());
    
        }
    }
    
    resources:
      cusomGroup:
        type: vkcs:ComputeServergroup
        properties:
          policies:
            - anti-affinity
    

    Policies

    • affinity - All instances/servers launched in this group will be hosted on the same compute node.

    • anti-affinity - All instances/servers launched in this group will be hosted on different compute nodes.

    • soft-affinity - All instances/servers launched in this group will be hosted on the same compute node if possible, but if not possible they still will be scheduled instead of failure.

    • soft-anti-affinity - All instances/servers launched in this group will be hosted on different compute nodes if possible, but if not possible they still will be scheduled instead of failure.

    Create ComputeServergroup Resource

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

    Constructor syntax

    new ComputeServergroup(name: string, args?: ComputeServergroupArgs, opts?: CustomResourceOptions);
    @overload
    def ComputeServergroup(resource_name: str,
                           args: Optional[ComputeServergroupArgs] = None,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def ComputeServergroup(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           compute_servergroup_id: Optional[str] = None,
                           name: Optional[str] = None,
                           policies: Optional[Sequence[str]] = None,
                           region: Optional[str] = None,
                           value_specs: Optional[Mapping[str, str]] = None)
    func NewComputeServergroup(ctx *Context, name string, args *ComputeServergroupArgs, opts ...ResourceOption) (*ComputeServergroup, error)
    public ComputeServergroup(string name, ComputeServergroupArgs? args = null, CustomResourceOptions? opts = null)
    public ComputeServergroup(String name, ComputeServergroupArgs args)
    public ComputeServergroup(String name, ComputeServergroupArgs args, CustomResourceOptions options)
    
    type: vkcs:ComputeServergroup
    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 ComputeServergroupArgs
    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 ComputeServergroupArgs
    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 ComputeServergroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ComputeServergroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ComputeServergroupArgs
    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 computeServergroupResource = new Vkcs.ComputeServergroup("computeServergroupResource", new()
    {
        ComputeServergroupId = "string",
        Name = "string",
        Policies = new[]
        {
            "string",
        },
        Region = "string",
        ValueSpecs = 
        {
            { "string", "string" },
        },
    });
    
    example, err := vkcs.NewComputeServergroup(ctx, "computeServergroupResource", &vkcs.ComputeServergroupArgs{
    ComputeServergroupId: pulumi.String("string"),
    Name: pulumi.String("string"),
    Policies: pulumi.StringArray{
    pulumi.String("string"),
    },
    Region: pulumi.String("string"),
    ValueSpecs: pulumi.StringMap{
    "string": pulumi.String("string"),
    },
    })
    
    var computeServergroupResource = new ComputeServergroup("computeServergroupResource", ComputeServergroupArgs.builder()
        .computeServergroupId("string")
        .name("string")
        .policies("string")
        .region("string")
        .valueSpecs(Map.of("string", "string"))
        .build());
    
    compute_servergroup_resource = vkcs.ComputeServergroup("computeServergroupResource",
        compute_servergroup_id="string",
        name="string",
        policies=["string"],
        region="string",
        value_specs={
            "string": "string",
        })
    
    const computeServergroupResource = new vkcs.ComputeServergroup("computeServergroupResource", {
        computeServergroupId: "string",
        name: "string",
        policies: ["string"],
        region: "string",
        valueSpecs: {
            string: "string",
        },
    });
    
    type: vkcs:ComputeServergroup
    properties:
        computeServergroupId: string
        name: string
        policies:
            - string
        region: string
        valueSpecs:
            string: string
    

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

    ComputeServergroupId string
    string → ID of the resource.
    Name string
    required string → A unique name for the server group. Changing this creates a new server group.
    Policies List<string>
    optional string → The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.
    Region string
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.
    ValueSpecs Dictionary<string, string>
    optional map of string → Map of additional options.
    ComputeServergroupId string
    string → ID of the resource.
    Name string
    required string → A unique name for the server group. Changing this creates a new server group.
    Policies []string
    optional string → The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.
    Region string
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.
    ValueSpecs map[string]string
    optional map of string → Map of additional options.
    computeServergroupId String
    string → ID of the resource.
    name String
    required string → A unique name for the server group. Changing this creates a new server group.
    policies List<String>
    optional string → The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.
    region String
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.
    valueSpecs Map<String,String>
    optional map of string → Map of additional options.
    computeServergroupId string
    string → ID of the resource.
    name string
    required string → A unique name for the server group. Changing this creates a new server group.
    policies string[]
    optional string → The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.
    region string
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.
    valueSpecs {[key: string]: string}
    optional map of string → Map of additional options.
    compute_servergroup_id str
    string → ID of the resource.
    name str
    required string → A unique name for the server group. Changing this creates a new server group.
    policies Sequence[str]
    optional string → The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.
    region str
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.
    value_specs Mapping[str, str]
    optional map of string → Map of additional options.
    computeServergroupId String
    string → ID of the resource.
    name String
    required string → A unique name for the server group. Changing this creates a new server group.
    policies List<String>
    optional string → The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.
    region String
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.
    valueSpecs Map<String>
    optional map of string → Map of additional options.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ComputeServergroup resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Members List<string>
    string → The instances that are part of this server group.
    Id string
    The provider-assigned unique ID for this managed resource.
    Members []string
    string → The instances that are part of this server group.
    id String
    The provider-assigned unique ID for this managed resource.
    members List<String>
    string → The instances that are part of this server group.
    id string
    The provider-assigned unique ID for this managed resource.
    members string[]
    string → The instances that are part of this server group.
    id str
    The provider-assigned unique ID for this managed resource.
    members Sequence[str]
    string → The instances that are part of this server group.
    id String
    The provider-assigned unique ID for this managed resource.
    members List<String>
    string → The instances that are part of this server group.

    Look up Existing ComputeServergroup Resource

    Get an existing ComputeServergroup 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?: ComputeServergroupState, opts?: CustomResourceOptions): ComputeServergroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            compute_servergroup_id: Optional[str] = None,
            members: Optional[Sequence[str]] = None,
            name: Optional[str] = None,
            policies: Optional[Sequence[str]] = None,
            region: Optional[str] = None,
            value_specs: Optional[Mapping[str, str]] = None) -> ComputeServergroup
    func GetComputeServergroup(ctx *Context, name string, id IDInput, state *ComputeServergroupState, opts ...ResourceOption) (*ComputeServergroup, error)
    public static ComputeServergroup Get(string name, Input<string> id, ComputeServergroupState? state, CustomResourceOptions? opts = null)
    public static ComputeServergroup get(String name, Output<String> id, ComputeServergroupState state, CustomResourceOptions options)
    resources:  _:    type: vkcs:ComputeServergroup    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:
    ComputeServergroupId string
    string → ID of the resource.
    Members List<string>
    string → The instances that are part of this server group.
    Name string
    required string → A unique name for the server group. Changing this creates a new server group.
    Policies List<string>
    optional string → The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.
    Region string
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.
    ValueSpecs Dictionary<string, string>
    optional map of string → Map of additional options.
    ComputeServergroupId string
    string → ID of the resource.
    Members []string
    string → The instances that are part of this server group.
    Name string
    required string → A unique name for the server group. Changing this creates a new server group.
    Policies []string
    optional string → The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.
    Region string
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.
    ValueSpecs map[string]string
    optional map of string → Map of additional options.
    computeServergroupId String
    string → ID of the resource.
    members List<String>
    string → The instances that are part of this server group.
    name String
    required string → A unique name for the server group. Changing this creates a new server group.
    policies List<String>
    optional string → The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.
    region String
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.
    valueSpecs Map<String,String>
    optional map of string → Map of additional options.
    computeServergroupId string
    string → ID of the resource.
    members string[]
    string → The instances that are part of this server group.
    name string
    required string → A unique name for the server group. Changing this creates a new server group.
    policies string[]
    optional string → The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.
    region string
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.
    valueSpecs {[key: string]: string}
    optional map of string → Map of additional options.
    compute_servergroup_id str
    string → ID of the resource.
    members Sequence[str]
    string → The instances that are part of this server group.
    name str
    required string → A unique name for the server group. Changing this creates a new server group.
    policies Sequence[str]
    optional string → The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.
    region str
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.
    value_specs Mapping[str, str]
    optional map of string → Map of additional options.
    computeServergroupId String
    string → ID of the resource.
    members List<String>
    string → The instances that are part of this server group.
    name String
    required string → A unique name for the server group. Changing this creates a new server group.
    policies List<String>
    optional string → The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.
    region String
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.
    valueSpecs Map<String>
    optional map of string → Map of additional options.

    Import

    Server Groups can be imported using the id, e.g.

    $ pulumi import vkcs:index/computeServergroup:ComputeServergroup test-sg 1bc30ee9-9d5b-4c30-bdd5-7f1e663f5edf
    

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

    Package Details

    Repository
    vkcs vk-cs/terraform-provider-vkcs
    License
    Notes
    This Pulumi package is based on the vkcs Terraform Provider.
    vkcs logo
    vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs