Hetzner Cloud v1.21.0 published on Tuesday, Nov 12, 2024 by Pulumi
hcloud.getPlacementGroups
Explore with Pulumi AI
Provides details about multiple Hetzner Cloud Placement Groups.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
const samplePlacementGroup1 = hcloud.getPlacementGroups({});
const samplePlacementGroup2 = hcloud.getPlacementGroups({
withSelector: "key=value",
});
import pulumi
import pulumi_hcloud as hcloud
sample_placement_group1 = hcloud.get_placement_groups()
sample_placement_group2 = hcloud.get_placement_groups(with_selector="key=value")
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.GetPlacementGroups(ctx, &hcloud.GetPlacementGroupsArgs{}, nil)
if err != nil {
return err
}
_, err = hcloud.GetPlacementGroups(ctx, &hcloud.GetPlacementGroupsArgs{
WithSelector: pulumi.StringRef("key=value"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;
return await Deployment.RunAsync(() =>
{
var samplePlacementGroup1 = HCloud.GetPlacementGroups.Invoke();
var samplePlacementGroup2 = HCloud.GetPlacementGroups.Invoke(new()
{
WithSelector = "key=value",
});
});
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.GetPlacementGroupsArgs;
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.getPlacementGroups();
final var samplePlacementGroup2 = HcloudFunctions.getPlacementGroups(GetPlacementGroupsArgs.builder()
.withSelector("key=value")
.build());
}
}
variables:
samplePlacementGroup1:
fn::invoke:
Function: hcloud:getPlacementGroups
Arguments: {}
samplePlacementGroup2:
fn::invoke:
Function: hcloud:getPlacementGroups
Arguments:
withSelector: key=value
Using getPlacementGroups
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 getPlacementGroups(args: GetPlacementGroupsArgs, opts?: InvokeOptions): Promise<GetPlacementGroupsResult>
function getPlacementGroupsOutput(args: GetPlacementGroupsOutputArgs, opts?: InvokeOptions): Output<GetPlacementGroupsResult>
def get_placement_groups(most_recent: Optional[bool] = None,
with_selector: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPlacementGroupsResult
def get_placement_groups_output(most_recent: Optional[pulumi.Input[bool]] = None,
with_selector: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPlacementGroupsResult]
func GetPlacementGroups(ctx *Context, args *GetPlacementGroupsArgs, opts ...InvokeOption) (*GetPlacementGroupsResult, error)
func GetPlacementGroupsOutput(ctx *Context, args *GetPlacementGroupsOutputArgs, opts ...InvokeOption) GetPlacementGroupsResultOutput
> Note: This function is named GetPlacementGroups
in the Go SDK.
public static class GetPlacementGroups
{
public static Task<GetPlacementGroupsResult> InvokeAsync(GetPlacementGroupsArgs args, InvokeOptions? opts = null)
public static Output<GetPlacementGroupsResult> Invoke(GetPlacementGroupsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPlacementGroupsResult> getPlacementGroups(GetPlacementGroupsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: hcloud:index/getPlacementGroups:getPlacementGroups
arguments:
# arguments dictionary
The following arguments are supported:
- Most
Recent bool - Sorts list by date.
- With
Selector string - Label selector
- Most
Recent bool - Sorts list by date.
- With
Selector string - Label selector
- most
Recent Boolean - Sorts list by date.
- with
Selector String - Label selector
- most
Recent boolean - Sorts list by date.
- with
Selector string - Label selector
- most_
recent bool - Sorts list by date.
- with_
selector str - Label selector
- most
Recent Boolean - Sorts list by date.
- with
Selector String - Label selector
getPlacementGroups Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Placement
Groups List<Pulumi.HCloud. Outputs. Get Placement Groups Placement Group> - (list) List of all matching placement groups. See
data.hcloud_placement_group
for schema. - Most
Recent bool - With
Selector string
- Id string
- The provider-assigned unique ID for this managed resource.
- Placement
Groups []GetPlacement Groups Placement Group - (list) List of all matching placement groups. See
data.hcloud_placement_group
for schema. - Most
Recent bool - With
Selector string
- id String
- The provider-assigned unique ID for this managed resource.
- placement
Groups List<GetPlacement Groups Placement Group> - (list) List of all matching placement groups. See
data.hcloud_placement_group
for schema. - most
Recent Boolean - with
Selector String
- id string
- The provider-assigned unique ID for this managed resource.
- placement
Groups GetPlacement Groups Placement Group[] - (list) List of all matching placement groups. See
data.hcloud_placement_group
for schema. - most
Recent boolean - with
Selector string
- id str
- The provider-assigned unique ID for this managed resource.
- placement_
groups Sequence[GetPlacement Groups Placement Group] - (list) List of all matching placement groups. See
data.hcloud_placement_group
for schema. - most_
recent bool - with_
selector str
- id String
- The provider-assigned unique ID for this managed resource.
- placement
Groups List<Property Map> - (list) List of all matching placement groups. See
data.hcloud_placement_group
for schema. - most
Recent Boolean - with
Selector String
Supporting Types
GetPlacementGroupsPlacementGroup
Package Details
- Repository
- Hetzner Cloud pulumi/pulumi-hcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
hcloud
Terraform Provider.