1. Packages
  2. Gcore Provider
  3. API Docs
  4. getCloudPlacementGroup
Viewing docs for gcore 2.0.0-alpha.3
published on Monday, Mar 30, 2026 by g-core
Viewing docs for gcore 2.0.0-alpha.3
published on Monday, Mar 30, 2026 by g-core

    Placement groups enforce affinity or anti-affinity policies that control whether virtual machines are hosted on the same or different physical servers.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const exampleCloudPlacementGroup = gcore.getCloudPlacementGroup({
        projectId: 0,
        regionId: 0,
        groupId: "group_id",
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    example_cloud_placement_group = gcore.get_cloud_placement_group(project_id=0,
        region_id=0,
        group_id="group_id")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/v2/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gcore.LookupCloudPlacementGroup(ctx, &gcore.LookupCloudPlacementGroupArgs{
    			ProjectId: pulumi.Float64Ref(0),
    			RegionId:  pulumi.Float64Ref(0),
    			GroupId:   "group_id",
    		}, 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 exampleCloudPlacementGroup = Gcore.GetCloudPlacementGroup.Invoke(new()
        {
            ProjectId = 0,
            RegionId = 0,
            GroupId = "group_id",
        });
    
    });
    
    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.GetCloudPlacementGroupArgs;
    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 exampleCloudPlacementGroup = GcoreFunctions.getCloudPlacementGroup(GetCloudPlacementGroupArgs.builder()
                .projectId(0)
                .regionId(0)
                .groupId("group_id")
                .build());
    
        }
    }
    
    variables:
      exampleCloudPlacementGroup:
        fn::invoke:
          function: gcore:getCloudPlacementGroup
          arguments:
            projectId: 0
            regionId: 0
            groupId: group_id
    

    Using getCloudPlacementGroup

    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 getCloudPlacementGroup(args: GetCloudPlacementGroupArgs, opts?: InvokeOptions): Promise<GetCloudPlacementGroupResult>
    function getCloudPlacementGroupOutput(args: GetCloudPlacementGroupOutputArgs, opts?: InvokeOptions): Output<GetCloudPlacementGroupResult>
    def get_cloud_placement_group(group_id: Optional[str] = None,
                                  project_id: Optional[float] = None,
                                  region_id: Optional[float] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetCloudPlacementGroupResult
    def get_cloud_placement_group_output(group_id: Optional[pulumi.Input[str]] = None,
                                  project_id: Optional[pulumi.Input[float]] = None,
                                  region_id: Optional[pulumi.Input[float]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetCloudPlacementGroupResult]
    func LookupCloudPlacementGroup(ctx *Context, args *LookupCloudPlacementGroupArgs, opts ...InvokeOption) (*LookupCloudPlacementGroupResult, error)
    func LookupCloudPlacementGroupOutput(ctx *Context, args *LookupCloudPlacementGroupOutputArgs, opts ...InvokeOption) LookupCloudPlacementGroupResultOutput

    > Note: This function is named LookupCloudPlacementGroup in the Go SDK.

    public static class GetCloudPlacementGroup 
    {
        public static Task<GetCloudPlacementGroupResult> InvokeAsync(GetCloudPlacementGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudPlacementGroupResult> Invoke(GetCloudPlacementGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCloudPlacementGroupResult> getCloudPlacementGroup(GetCloudPlacementGroupArgs args, InvokeOptions options)
    public static Output<GetCloudPlacementGroupResult> getCloudPlacementGroup(GetCloudPlacementGroupArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcore:index/getCloudPlacementGroup:getCloudPlacementGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    GroupId string
    ProjectId double
    RegionId double
    GroupId string
    ProjectId float64
    RegionId float64
    groupId String
    projectId Double
    regionId Double
    groupId string
    projectId number
    regionId number
    groupId String
    projectId Number
    regionId Number

    getCloudPlacementGroup Result

    The following output properties are available:

    GroupId string
    Id string
    The ID of this resource.
    Instances List<GetCloudPlacementGroupInstance>
    The list of instances in this server group.
    Name string
    The name of the server group.
    Policy string
    The server group policy. Options are: anti-affinity, affinity, or soft-anti-affinity.
    Region string
    Region name
    ServergroupId string
    The ID of the server group.
    ProjectId double
    RegionId double
    GroupId string
    Id string
    The ID of this resource.
    Instances []GetCloudPlacementGroupInstance
    The list of instances in this server group.
    Name string
    The name of the server group.
    Policy string
    The server group policy. Options are: anti-affinity, affinity, or soft-anti-affinity.
    Region string
    Region name
    ServergroupId string
    The ID of the server group.
    ProjectId float64
    RegionId float64
    groupId String
    id String
    The ID of this resource.
    instances List<GetCloudPlacementGroupInstance>
    The list of instances in this server group.
    name String
    The name of the server group.
    policy String
    The server group policy. Options are: anti-affinity, affinity, or soft-anti-affinity.
    region String
    Region name
    servergroupId String
    The ID of the server group.
    projectId Double
    regionId Double
    groupId string
    id string
    The ID of this resource.
    instances GetCloudPlacementGroupInstance[]
    The list of instances in this server group.
    name string
    The name of the server group.
    policy string
    The server group policy. Options are: anti-affinity, affinity, or soft-anti-affinity.
    region string
    Region name
    servergroupId string
    The ID of the server group.
    projectId number
    regionId number
    group_id str
    id str
    The ID of this resource.
    instances Sequence[GetCloudPlacementGroupInstance]
    The list of instances in this server group.
    name str
    The name of the server group.
    policy str
    The server group policy. Options are: anti-affinity, affinity, or soft-anti-affinity.
    region str
    Region name
    servergroup_id str
    The ID of the server group.
    project_id float
    region_id float
    groupId String
    id String
    The ID of this resource.
    instances List<Property Map>
    The list of instances in this server group.
    name String
    The name of the server group.
    policy String
    The server group policy. Options are: anti-affinity, affinity, or soft-anti-affinity.
    region String
    Region name
    servergroupId String
    The ID of the server group.
    projectId Number
    regionId Number

    Supporting Types

    GetCloudPlacementGroupInstance

    InstanceId string
    The ID of the instance, corresponding to the attribute 'id'.
    InstanceName string
    The name of the instance, corresponding to the attribute 'name'.
    InstanceId string
    The ID of the instance, corresponding to the attribute 'id'.
    InstanceName string
    The name of the instance, corresponding to the attribute 'name'.
    instanceId String
    The ID of the instance, corresponding to the attribute 'id'.
    instanceName String
    The name of the instance, corresponding to the attribute 'name'.
    instanceId string
    The ID of the instance, corresponding to the attribute 'id'.
    instanceName string
    The name of the instance, corresponding to the attribute 'name'.
    instance_id str
    The ID of the instance, corresponding to the attribute 'id'.
    instance_name str
    The name of the instance, corresponding to the attribute 'name'.
    instanceId String
    The ID of the instance, corresponding to the attribute 'id'.
    instanceName String
    The name of the instance, corresponding to the attribute 'name'.

    Package Details

    Repository
    gcore g-core/terraform-provider-gcore
    License
    Notes
    This Pulumi package is based on the gcore Terraform Provider.
    Viewing docs for gcore 2.0.0-alpha.3
    published on Monday, Mar 30, 2026 by g-core
      Try Pulumi Cloud free. Your team will thank you.