1. Packages
  2. Hetzner Cloud
  3. API Docs
  4. getPlacementGroup
Hetzner Cloud v1.16.0 published on Wednesday, Oct 4, 2023 by Pulumi

hcloud.getPlacementGroup

Explore with Pulumi AI

hcloud logo
Hetzner Cloud v1.16.0 published on Wednesday, Oct 4, 2023 by Pulumi

    Provides details about a specific Hetzner Cloud Placement Group.

    import * as pulumi from "@pulumi/pulumi";
    import * as hcloud from "@pulumi/hcloud";
    
    const samplePlacementGroup1 = hcloud.getPlacementGroup({
        name: "sample-placement-group-1",
    });
    const samplePlacementGroup2 = hcloud.getPlacementGroup({
        id: 4711,
    });
    
    import pulumi
    import pulumi_hcloud as hcloud
    
    sample_placement_group1 = hcloud.get_placement_group(name="sample-placement-group-1")
    sample_placement_group2 = hcloud.get_placement_group(id=4711)
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using HCloud = Pulumi.HCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var samplePlacementGroup1 = HCloud.GetPlacementGroup.Invoke(new()
        {
            Name = "sample-placement-group-1",
        });
    
        var samplePlacementGroup2 = HCloud.GetPlacementGroup.Invoke(new()
        {
            Id = 4711,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := hcloud.LookupPlacementGroup(ctx, &hcloud.LookupPlacementGroupArgs{
    			Name: pulumi.StringRef("sample-placement-group-1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.LookupPlacementGroup(ctx, &hcloud.LookupPlacementGroupArgs{
    			Id: pulumi.IntRef(4711),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.hcloud.HcloudFunctions;
    import com.pulumi.hcloud.inputs.GetPlacementGroupArgs;
    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 samplePlacementGroup1 = HcloudFunctions.getPlacementGroup(GetPlacementGroupArgs.builder()
                .name("sample-placement-group-1")
                .build());
    
            final var samplePlacementGroup2 = HcloudFunctions.getPlacementGroup(GetPlacementGroupArgs.builder()
                .id("4711")
                .build());
    
        }
    }
    
    variables:
      samplePlacementGroup1:
        fn::invoke:
          Function: hcloud:getPlacementGroup
          Arguments:
            name: sample-placement-group-1
      samplePlacementGroup2:
        fn::invoke:
          Function: hcloud:getPlacementGroup
          Arguments:
            id: '4711'
    

    Using getPlacementGroup

    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 getPlacementGroup(args: GetPlacementGroupArgs, opts?: InvokeOptions): Promise<GetPlacementGroupResult>
    function getPlacementGroupOutput(args: GetPlacementGroupOutputArgs, opts?: InvokeOptions): Output<GetPlacementGroupResult>
    def get_placement_group(id: Optional[int] = None,
                            labels: Optional[Mapping[str, Any]] = None,
                            most_recent: Optional[bool] = None,
                            name: Optional[str] = None,
                            type: Optional[str] = None,
                            with_selector: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetPlacementGroupResult
    def get_placement_group_output(id: Optional[pulumi.Input[int]] = None,
                            labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                            most_recent: Optional[pulumi.Input[bool]] = None,
                            name: Optional[pulumi.Input[str]] = None,
                            type: Optional[pulumi.Input[str]] = None,
                            with_selector: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetPlacementGroupResult]
    func LookupPlacementGroup(ctx *Context, args *LookupPlacementGroupArgs, opts ...InvokeOption) (*LookupPlacementGroupResult, error)
    func LookupPlacementGroupOutput(ctx *Context, args *LookupPlacementGroupOutputArgs, opts ...InvokeOption) LookupPlacementGroupResultOutput

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

    public static class GetPlacementGroup 
    {
        public static Task<GetPlacementGroupResult> InvokeAsync(GetPlacementGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetPlacementGroupResult> Invoke(GetPlacementGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPlacementGroupResult> getPlacementGroup(GetPlacementGroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: hcloud:index/getPlacementGroup:getPlacementGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id int

    ID of the placement group.

    Labels Dictionary<string, object>

    (map) User-defined labels (key-value pairs)

    MostRecent bool

    Return most recent placement group if multiple are found.

    Name string

    Name of the placement group.

    Type string

    (string) Type of the Placement Group.

    WithSelector string

    Label selector

    Id int

    ID of the placement group.

    Labels map[string]interface{}

    (map) User-defined labels (key-value pairs)

    MostRecent bool

    Return most recent placement group if multiple are found.

    Name string

    Name of the placement group.

    Type string

    (string) Type of the Placement Group.

    WithSelector string

    Label selector

    id Integer

    ID of the placement group.

    labels Map<String,Object>

    (map) User-defined labels (key-value pairs)

    mostRecent Boolean

    Return most recent placement group if multiple are found.

    name String

    Name of the placement group.

    type String

    (string) Type of the Placement Group.

    withSelector String

    Label selector

    id number

    ID of the placement group.

    labels {[key: string]: any}

    (map) User-defined labels (key-value pairs)

    mostRecent boolean

    Return most recent placement group if multiple are found.

    name string

    Name of the placement group.

    type string

    (string) Type of the Placement Group.

    withSelector string

    Label selector

    id int

    ID of the placement group.

    labels Mapping[str, Any]

    (map) User-defined labels (key-value pairs)

    most_recent bool

    Return most recent placement group if multiple are found.

    name str

    Name of the placement group.

    type str

    (string) Type of the Placement Group.

    with_selector str

    Label selector

    id Number

    ID of the placement group.

    labels Map<Any>

    (map) User-defined labels (key-value pairs)

    mostRecent Boolean

    Return most recent placement group if multiple are found.

    name String

    Name of the placement group.

    type String

    (string) Type of the Placement Group.

    withSelector String

    Label selector

    getPlacementGroup Result

    The following output properties are available:

    Name string

    (string) Name of the Placement Group.

    Servers List<int>
    Id int

    (int) Unique ID of the Placement Group.

    Labels Dictionary<string, object>

    (map) User-defined labels (key-value pairs)

    MostRecent bool
    Type string

    (string) Type of the Placement Group.

    WithSelector string
    Name string

    (string) Name of the Placement Group.

    Servers []int
    Id int

    (int) Unique ID of the Placement Group.

    Labels map[string]interface{}

    (map) User-defined labels (key-value pairs)

    MostRecent bool
    Type string

    (string) Type of the Placement Group.

    WithSelector string
    name String

    (string) Name of the Placement Group.

    servers List<Integer>
    id Integer

    (int) Unique ID of the Placement Group.

    labels Map<String,Object>

    (map) User-defined labels (key-value pairs)

    mostRecent Boolean
    type String

    (string) Type of the Placement Group.

    withSelector String
    name string

    (string) Name of the Placement Group.

    servers number[]
    id number

    (int) Unique ID of the Placement Group.

    labels {[key: string]: any}

    (map) User-defined labels (key-value pairs)

    mostRecent boolean
    type string

    (string) Type of the Placement Group.

    withSelector string
    name str

    (string) Name of the Placement Group.

    servers Sequence[int]
    id int

    (int) Unique ID of the Placement Group.

    labels Mapping[str, Any]

    (map) User-defined labels (key-value pairs)

    most_recent bool
    type str

    (string) Type of the Placement Group.

    with_selector str
    name String

    (string) Name of the Placement Group.

    servers List<Number>
    id Number

    (int) Unique ID of the Placement Group.

    labels Map<Any>

    (map) User-defined labels (key-value pairs)

    mostRecent Boolean
    type String

    (string) Type of the Placement Group.

    withSelector String

    Package Details

    Repository
    Hetzner Cloud pulumi/pulumi-hcloud
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the hcloud Terraform Provider.

    hcloud logo
    Hetzner Cloud v1.16.0 published on Wednesday, Oct 4, 2023 by Pulumi