1. Registry
  2. Packages
  3. Linode Provider
  4. API Docs
  5. getPlacementGroups
Viewing docs for Linode v6.6.0
published on Tuesday, Sep 15, 2026 by Pulumi
linode logo linode logo
Viewing docs for Linode v6.6.0
published on Tuesday, Sep 15, 2026 by Pulumi

    Provides information about a list of Linode Placement Groups that match a set of filters. For more information, see the Linode APIv4 docs.

    Example Usage

    The following example shows how one might use this data source to list Placement Groups.

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    export = async () => {
        const all = await linode.getPlacementGroups({});
        const filtered = await linode.getPlacementGroups({
            filters: [{
                name: "label",
                values: ["my-label"],
            }],
        });
        return {
            "all-pgs": all.placementGroups,
            "filtered-pgs": filtered.placementGroups,
        };
    }
    
    import pulumi
    import pulumi_linode as linode
    
    all = linode.get_placement_groups()
    filtered = linode.get_placement_groups(filters=[{
        "name": "label",
        "values": ["my-label"],
    }])
    pulumi.export("all-pgs", all.placement_groups)
    pulumi.export("filtered-pgs", filtered.placement_groups)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v6/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		all, err := linode.GetPlacementGroups(ctx, &linode.GetPlacementGroupsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		filtered, err := linode.GetPlacementGroups(ctx, &linode.GetPlacementGroupsArgs{
    			Filters: []linode.GetPlacementGroupsFilter{
    				{
    					Name: "label",
    					Values: []string{
    						"my-label",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("all-pgs", all.PlacementGroups)
    		ctx.Export("filtered-pgs", filtered.PlacementGroups)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var all = Linode.GetPlacementGroups.Invoke();
    
        var filtered = Linode.GetPlacementGroups.Invoke(new()
        {
            Filters = new[]
            {
                new Linode.Inputs.GetPlacementGroupsFilterInputArgs
                {
                    Name = "label",
                    Values = new[]
                    {
                        "my-label",
                    },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["all-pgs"] = all.Apply(getPlacementGroupsResult => getPlacementGroupsResult.PlacementGroups),
            ["filtered-pgs"] = filtered.Apply(getPlacementGroupsResult => getPlacementGroupsResult.PlacementGroups),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetPlacementGroupsArgs;
    import com.pulumi.linode.inputs.GetPlacementGroupsFilterArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 all = LinodeFunctions.getPlacementGroups(GetPlacementGroupsArgs.builder()
                .build());
    
            final var filtered = LinodeFunctions.getPlacementGroups(GetPlacementGroupsArgs.builder()
                .filters(GetPlacementGroupsFilterArgs.builder()
                    .name("label")
                    .values("my-label")
                    .build())
                .build());
    
            ctx.export("all-pgs", all.placementGroups());
            ctx.export("filtered-pgs", filtered.placementGroups());
        }
    }
    
    variables:
      all:
        fn::invoke:
          function: linode:getPlacementGroups
          arguments: {}
      filtered:
        fn::invoke:
          function: linode:getPlacementGroups
          arguments:
            filters:
              - name: label
                values:
                  - my-label
    outputs:
      all-pgs: ${all.placementGroups}
      filtered-pgs: ${filtered.placementGroups}
    
    pulumi {
      required_providers {
        linode = {
          source = "pulumi/linode"
        }
      }
    }
    
    data "linode_getplacementgroups" "all" {
    }
    data "linode_getplacementgroups" "filtered" {
      filters {
        name   = "label"
        values = ["my-label"]
      }
    }
    
    output "all-pgs" {
      value = data.linode_getplacementgroups.all.placement_groups
    }
    output "filtered-pgs" {
      value = data.linode_getplacementgroups.filtered.placement_groups
    }
    

    Filterable Fields

    • id

    • label

    • region

    • placementGroupType

    • placementGroupPolicy

    • isCompliant

    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?: InvokeOutputOptions): Output<GetPlacementGroupsResult>
    def get_placement_groups(filters: Optional[Sequence[GetPlacementGroupsFilter]] = None,
                             order: Optional[str] = None,
                             order_by: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetPlacementGroupsResult
    def get_placement_groups_output(filters: pulumi.Input[Optional[Sequence[pulumi.Input[GetPlacementGroupsFilterArgs]]]] = None,
                             order: pulumi.Input[Optional[str]] = None,
                             order_by: pulumi.Input[Optional[str]] = None,
                             opts: Optional[InvokeOutputOptions] = 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 Output<GetPlacementGroupsResult> Invoke(GetPlacementGroupsInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetPlacementGroupsResult> getPlacementGroups(GetPlacementGroupsArgs args, InvokeOptions options)
    public static Output<GetPlacementGroupsResult> getPlacementGroups(GetPlacementGroupsArgs args, InvokeOptions options)
    public static Output<GetPlacementGroupsResult> getPlacementGroups(GetPlacementGroupsArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: linode:index/getPlacementGroups:getPlacementGroups
      arguments:
        # arguments dictionary
    data "linode_get_placement_groups" "name" {
        # arguments
    }

    The following arguments are supported:

    getPlacementGroups Result

    The following output properties are available:

    Id string
    PlacementGroups List<GetPlacementGroupsPlacementGroup>
    (Nested Attribute List) The Placement Groups returned by this data source.
    Filters List<GetPlacementGroupsFilter>
    Order string
    OrderBy string
    Id string
    PlacementGroups []GetPlacementGroupsPlacementGroup
    (Nested Attribute List) The Placement Groups returned by this data source.
    Filters []GetPlacementGroupsFilter
    Order string
    OrderBy string
    id string
    placement_groups list(object)
    (Nested Attribute List) The Placement Groups returned by this data source.
    filters list(object)
    order string
    order_by string
    id String
    placementGroups List<GetPlacementGroupsPlacementGroup>
    (Nested Attribute List) The Placement Groups returned by this data source.
    filters List<GetPlacementGroupsFilter>
    order String
    orderBy String
    id string
    placementGroups GetPlacementGroupsPlacementGroup[]
    (Nested Attribute List) The Placement Groups returned by this data source.
    filters GetPlacementGroupsFilter[]
    order string
    orderBy string
    id str
    placement_groups Sequence[GetPlacementGroupsPlacementGroup]
    (Nested Attribute List) The Placement Groups returned by this data source.
    filters Sequence[GetPlacementGroupsFilter]
    order str
    order_by str
    id String
    placementGroups List<Property Map>
    (Nested Attribute List) The Placement Groups returned by this data source.
    filters List<Property Map>
    order String
    orderBy String

    Supporting Types

    GetPlacementGroupsFilter

    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values List<string>
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values []string
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values list(string)
    A list of values for the filter to allow. These values should all be in string form.
    match_by string
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)
    name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values string[]
    A list of values for the filter to allow. These values should all be in string form.
    matchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name str
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values Sequence[str]
    A list of values for the filter to allow. These values should all be in string form.
    match_by str
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)

    GetPlacementGroupsPlacementGroup

    Id int
    The ID of the placement group.
    IsCompliant bool
    Whether this Linode is currently compliant with the group's placement group type.
    Label string
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    Members List<GetPlacementGroupsPlacementGroupMember>
    (Nested Attribute Set) A set of Linodes currently assigned to this Placement Group. Set elements can't be referenced by index; use a for expression or tolist(...) to access them.
    Migrations GetPlacementGroupsPlacementGroupMigrations
    (Nested Attribute) Any Linodes that are being migrated to or from the placement group. Referenced directly (e.g. migrations.inbound).
    PlacementGroupPolicy string
    Whether Linodes must be able to become compliant during assignment. (Default strict)
    PlacementGroupType string
    The placement group type to use when placing Linodes in this group.
    Region string
    The region of the Placement Group.
    Id int
    The ID of the placement group.
    IsCompliant bool
    Whether this Linode is currently compliant with the group's placement group type.
    Label string
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    Members []GetPlacementGroupsPlacementGroupMember
    (Nested Attribute Set) A set of Linodes currently assigned to this Placement Group. Set elements can't be referenced by index; use a for expression or tolist(...) to access them.
    Migrations GetPlacementGroupsPlacementGroupMigrations
    (Nested Attribute) Any Linodes that are being migrated to or from the placement group. Referenced directly (e.g. migrations.inbound).
    PlacementGroupPolicy string
    Whether Linodes must be able to become compliant during assignment. (Default strict)
    PlacementGroupType string
    The placement group type to use when placing Linodes in this group.
    Region string
    The region of the Placement Group.
    id number
    The ID of the placement group.
    is_compliant bool
    Whether this Linode is currently compliant with the group's placement group type.
    label string
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    members list(object)
    (Nested Attribute Set) A set of Linodes currently assigned to this Placement Group. Set elements can't be referenced by index; use a for expression or tolist(...) to access them.
    migrations object
    (Nested Attribute) Any Linodes that are being migrated to or from the placement group. Referenced directly (e.g. migrations.inbound).
    placement_group_policy string
    Whether Linodes must be able to become compliant during assignment. (Default strict)
    placement_group_type string
    The placement group type to use when placing Linodes in this group.
    region string
    The region of the Placement Group.
    id Integer
    The ID of the placement group.
    isCompliant Boolean
    Whether this Linode is currently compliant with the group's placement group type.
    label String
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    members List<GetPlacementGroupsPlacementGroupMember>
    (Nested Attribute Set) A set of Linodes currently assigned to this Placement Group. Set elements can't be referenced by index; use a for expression or tolist(...) to access them.
    migrations GetPlacementGroupsPlacementGroupMigrations
    (Nested Attribute) Any Linodes that are being migrated to or from the placement group. Referenced directly (e.g. migrations.inbound).
    placementGroupPolicy String
    Whether Linodes must be able to become compliant during assignment. (Default strict)
    placementGroupType String
    The placement group type to use when placing Linodes in this group.
    region String
    The region of the Placement Group.
    id number
    The ID of the placement group.
    isCompliant boolean
    Whether this Linode is currently compliant with the group's placement group type.
    label string
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    members GetPlacementGroupsPlacementGroupMember[]
    (Nested Attribute Set) A set of Linodes currently assigned to this Placement Group. Set elements can't be referenced by index; use a for expression or tolist(...) to access them.
    migrations GetPlacementGroupsPlacementGroupMigrations
    (Nested Attribute) Any Linodes that are being migrated to or from the placement group. Referenced directly (e.g. migrations.inbound).
    placementGroupPolicy string
    Whether Linodes must be able to become compliant during assignment. (Default strict)
    placementGroupType string
    The placement group type to use when placing Linodes in this group.
    region string
    The region of the Placement Group.
    id int
    The ID of the placement group.
    is_compliant bool
    Whether this Linode is currently compliant with the group's placement group type.
    label str
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    members Sequence[GetPlacementGroupsPlacementGroupMember]
    (Nested Attribute Set) A set of Linodes currently assigned to this Placement Group. Set elements can't be referenced by index; use a for expression or tolist(...) to access them.
    migrations GetPlacementGroupsPlacementGroupMigrations
    (Nested Attribute) Any Linodes that are being migrated to or from the placement group. Referenced directly (e.g. migrations.inbound).
    placement_group_policy str
    Whether Linodes must be able to become compliant during assignment. (Default strict)
    placement_group_type str
    The placement group type to use when placing Linodes in this group.
    region str
    The region of the Placement Group.
    id Number
    The ID of the placement group.
    isCompliant Boolean
    Whether this Linode is currently compliant with the group's placement group type.
    label String
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    members List<Property Map>
    (Nested Attribute Set) A set of Linodes currently assigned to this Placement Group. Set elements can't be referenced by index; use a for expression or tolist(...) to access them.
    migrations Property Map
    (Nested Attribute) Any Linodes that are being migrated to or from the placement group. Referenced directly (e.g. migrations.inbound).
    placementGroupPolicy String
    Whether Linodes must be able to become compliant during assignment. (Default strict)
    placementGroupType String
    The placement group type to use when placing Linodes in this group.
    region String
    The region of the Placement Group.

    GetPlacementGroupsPlacementGroupMember

    IsCompliant bool
    Whether this Linode is currently compliant with the group's placement group type.
    LinodeId int
    The unique identifier for the Linode being migrated out of the placement group.
    IsCompliant bool
    Whether this Linode is currently compliant with the group's placement group type.
    LinodeId int
    The unique identifier for the Linode being migrated out of the placement group.
    is_compliant bool
    Whether this Linode is currently compliant with the group's placement group type.
    linode_id number
    The unique identifier for the Linode being migrated out of the placement group.
    isCompliant Boolean
    Whether this Linode is currently compliant with the group's placement group type.
    linodeId Integer
    The unique identifier for the Linode being migrated out of the placement group.
    isCompliant boolean
    Whether this Linode is currently compliant with the group's placement group type.
    linodeId number
    The unique identifier for the Linode being migrated out of the placement group.
    is_compliant bool
    Whether this Linode is currently compliant with the group's placement group type.
    linode_id int
    The unique identifier for the Linode being migrated out of the placement group.
    isCompliant Boolean
    Whether this Linode is currently compliant with the group's placement group type.
    linodeId Number
    The unique identifier for the Linode being migrated out of the placement group.

    GetPlacementGroupsPlacementGroupMigrations

    Inbounds List<GetPlacementGroupsPlacementGroupMigrationsInbound>
    (Read-Only Object List) A list of the Linodes the system is migrating into the placement group. Referenced with an index (e.g. inbound.0.linode_id).
    Outbounds List<GetPlacementGroupsPlacementGroupMigrationsOutbound>
    (Read-Only Object List) A list of the Linodes the system is migrating out of the placement group. Referenced with an index (e.g. outbound.0.linode_id).
    Inbounds []GetPlacementGroupsPlacementGroupMigrationsInbound
    (Read-Only Object List) A list of the Linodes the system is migrating into the placement group. Referenced with an index (e.g. inbound.0.linode_id).
    Outbounds []GetPlacementGroupsPlacementGroupMigrationsOutbound
    (Read-Only Object List) A list of the Linodes the system is migrating out of the placement group. Referenced with an index (e.g. outbound.0.linode_id).
    inbounds list(object)
    (Read-Only Object List) A list of the Linodes the system is migrating into the placement group. Referenced with an index (e.g. inbound.0.linode_id).
    outbounds list(object)
    (Read-Only Object List) A list of the Linodes the system is migrating out of the placement group. Referenced with an index (e.g. outbound.0.linode_id).
    inbounds List<GetPlacementGroupsPlacementGroupMigrationsInbound>
    (Read-Only Object List) A list of the Linodes the system is migrating into the placement group. Referenced with an index (e.g. inbound.0.linode_id).
    outbounds List<GetPlacementGroupsPlacementGroupMigrationsOutbound>
    (Read-Only Object List) A list of the Linodes the system is migrating out of the placement group. Referenced with an index (e.g. outbound.0.linode_id).
    inbounds GetPlacementGroupsPlacementGroupMigrationsInbound[]
    (Read-Only Object List) A list of the Linodes the system is migrating into the placement group. Referenced with an index (e.g. inbound.0.linode_id).
    outbounds GetPlacementGroupsPlacementGroupMigrationsOutbound[]
    (Read-Only Object List) A list of the Linodes the system is migrating out of the placement group. Referenced with an index (e.g. outbound.0.linode_id).
    inbounds Sequence[GetPlacementGroupsPlacementGroupMigrationsInbound]
    (Read-Only Object List) A list of the Linodes the system is migrating into the placement group. Referenced with an index (e.g. inbound.0.linode_id).
    outbounds Sequence[GetPlacementGroupsPlacementGroupMigrationsOutbound]
    (Read-Only Object List) A list of the Linodes the system is migrating out of the placement group. Referenced with an index (e.g. outbound.0.linode_id).
    inbounds List<Property Map>
    (Read-Only Object List) A list of the Linodes the system is migrating into the placement group. Referenced with an index (e.g. inbound.0.linode_id).
    outbounds List<Property Map>
    (Read-Only Object List) A list of the Linodes the system is migrating out of the placement group. Referenced with an index (e.g. outbound.0.linode_id).

    GetPlacementGroupsPlacementGroupMigrationsInbound

    LinodeId int
    The unique identifier for the Linode being migrated out of the placement group.
    LinodeId int
    The unique identifier for the Linode being migrated out of the placement group.
    linode_id number
    The unique identifier for the Linode being migrated out of the placement group.
    linodeId Integer
    The unique identifier for the Linode being migrated out of the placement group.
    linodeId number
    The unique identifier for the Linode being migrated out of the placement group.
    linode_id int
    The unique identifier for the Linode being migrated out of the placement group.
    linodeId Number
    The unique identifier for the Linode being migrated out of the placement group.

    GetPlacementGroupsPlacementGroupMigrationsOutbound

    LinodeId int
    The unique identifier for the Linode being migrated out of the placement group.
    LinodeId int
    The unique identifier for the Linode being migrated out of the placement group.
    linode_id number
    The unique identifier for the Linode being migrated out of the placement group.
    linodeId Integer
    The unique identifier for the Linode being migrated out of the placement group.
    linodeId number
    The unique identifier for the Linode being migrated out of the placement group.
    linode_id int
    The unique identifier for the Linode being migrated out of the placement group.
    linodeId Number
    The unique identifier for the Linode being migrated out of the placement group.

    Package Details

    Repository
    Linode pulumi/pulumi-linode
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the linode Terraform Provider.
    linode logo linode logo
    Viewing docs for Linode v6.6.0
    published on Tuesday, Sep 15, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial