1. Packages
  2. Linode Provider
  3. API Docs
  4. PlacementGroup
Linode v4.37.0 published on Thursday, Apr 10, 2025 by Pulumi

linode.PlacementGroup

Explore with Pulumi AI

Manages a Linode Placement Group. For more information, see the Linode APIv4 docs.

Example Usage

Create a Placement Group with the local anti-affinity policy:

import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";

const test = new linode.PlacementGroup("test", {
    label: "my-placement-group",
    region: "us-mia",
    placementGroupType: "anti_affinity:local",
});
Copy
import pulumi
import pulumi_linode as linode

test = linode.PlacementGroup("test",
    label="my-placement-group",
    region="us-mia",
    placement_group_type="anti_affinity:local")
Copy
package main

import (
	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := linode.NewPlacementGroup(ctx, "test", &linode.PlacementGroupArgs{
			Label:              pulumi.String("my-placement-group"),
			Region:             pulumi.String("us-mia"),
			PlacementGroupType: pulumi.String("anti_affinity:local"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;

return await Deployment.RunAsync(() => 
{
    var test = new Linode.PlacementGroup("test", new()
    {
        Label = "my-placement-group",
        Region = "us-mia",
        PlacementGroupType = "anti_affinity:local",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.linode.PlacementGroup;
import com.pulumi.linode.PlacementGroupArgs;
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 test = new PlacementGroup("test", PlacementGroupArgs.builder()
            .label("my-placement-group")
            .region("us-mia")
            .placementGroupType("anti_affinity:local")
            .build());

    }
}
Copy
resources:
  test:
    type: linode:PlacementGroup
    properties:
      label: my-placement-group
      region: us-mia
      placementGroupType: anti_affinity:local
Copy

Create PlacementGroup Resource

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

Constructor syntax

new PlacementGroup(name: string, args: PlacementGroupArgs, opts?: CustomResourceOptions);
@overload
def PlacementGroup(resource_name: str,
                   args: PlacementGroupArgs,
                   opts: Optional[ResourceOptions] = None)

@overload
def PlacementGroup(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   label: Optional[str] = None,
                   placement_group_type: Optional[str] = None,
                   region: Optional[str] = None,
                   placement_group_policy: Optional[str] = None)
func NewPlacementGroup(ctx *Context, name string, args PlacementGroupArgs, opts ...ResourceOption) (*PlacementGroup, error)
public PlacementGroup(string name, PlacementGroupArgs args, CustomResourceOptions? opts = null)
public PlacementGroup(String name, PlacementGroupArgs args)
public PlacementGroup(String name, PlacementGroupArgs args, CustomResourceOptions options)
type: linode:PlacementGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. PlacementGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. PlacementGroupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. PlacementGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. PlacementGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. PlacementGroupArgs
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 placementGroupResource = new Linode.PlacementGroup("placementGroupResource", new()
{
    Label = "string",
    PlacementGroupType = "string",
    Region = "string",
    PlacementGroupPolicy = "string",
});
Copy
example, err := linode.NewPlacementGroup(ctx, "placementGroupResource", &linode.PlacementGroupArgs{
	Label:                pulumi.String("string"),
	PlacementGroupType:   pulumi.String("string"),
	Region:               pulumi.String("string"),
	PlacementGroupPolicy: pulumi.String("string"),
})
Copy
var placementGroupResource = new PlacementGroup("placementGroupResource", PlacementGroupArgs.builder()
    .label("string")
    .placementGroupType("string")
    .region("string")
    .placementGroupPolicy("string")
    .build());
Copy
placement_group_resource = linode.PlacementGroup("placementGroupResource",
    label="string",
    placement_group_type="string",
    region="string",
    placement_group_policy="string")
Copy
const placementGroupResource = new linode.PlacementGroup("placementGroupResource", {
    label: "string",
    placementGroupType: "string",
    region: "string",
    placementGroupPolicy: "string",
});
Copy
type: linode:PlacementGroup
properties:
    label: string
    placementGroupPolicy: string
    placementGroupType: string
    region: string
Copy

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

Label This property is required. string
The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
PlacementGroupType This property is required. string
The placement group type to use when placing Linodes in this group.
Region This property is required. string
The region of the Placement Group.
PlacementGroupPolicy string
Whether Linodes must be able to become compliant during assignment. (Default strict)
Label This property is required. string
The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
PlacementGroupType This property is required. string
The placement group type to use when placing Linodes in this group.
Region This property is required. string
The region of the Placement Group.
PlacementGroupPolicy string
Whether Linodes must be able to become compliant during assignment. (Default strict)
label This property is required. String
The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
placementGroupType This property is required. String
The placement group type to use when placing Linodes in this group.
region This property is required. String
The region of the Placement Group.
placementGroupPolicy String
Whether Linodes must be able to become compliant during assignment. (Default strict)
label This property is required. string
The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
placementGroupType This property is required. string
The placement group type to use when placing Linodes in this group.
region This property is required. string
The region of the Placement Group.
placementGroupPolicy string
Whether Linodes must be able to become compliant during assignment. (Default strict)
label This property is required. str
The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
placement_group_type This property is required. str
The placement group type to use when placing Linodes in this group.
region This property is required. str
The region of the Placement Group.
placement_group_policy str
Whether Linodes must be able to become compliant during assignment. (Default strict)
label This property is required. String
The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
placementGroupType This property is required. String
The placement group type to use when placing Linodes in this group.
region This property is required. String
The region of the Placement Group.
placementGroupPolicy String
Whether Linodes must be able to become compliant during assignment. (Default strict)

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
IsCompliant bool
Whether this Linode is currently compliant with the group's placement group type.
Members List<PlacementGroupMember>
A set of Linodes currently assigned to this Placement Group.
Id string
The provider-assigned unique ID for this managed resource.
IsCompliant bool
Whether this Linode is currently compliant with the group's placement group type.
Members []PlacementGroupMember
A set of Linodes currently assigned to this Placement Group.
id String
The provider-assigned unique ID for this managed resource.
isCompliant Boolean
Whether this Linode is currently compliant with the group's placement group type.
members List<PlacementGroupMember>
A set of Linodes currently assigned to this Placement Group.
id string
The provider-assigned unique ID for this managed resource.
isCompliant boolean
Whether this Linode is currently compliant with the group's placement group type.
members PlacementGroupMember[]
A set of Linodes currently assigned to this Placement Group.
id str
The provider-assigned unique ID for this managed resource.
is_compliant bool
Whether this Linode is currently compliant with the group's placement group type.
members Sequence[PlacementGroupMember]
A set of Linodes currently assigned to this Placement Group.
id String
The provider-assigned unique ID for this managed resource.
isCompliant Boolean
Whether this Linode is currently compliant with the group's placement group type.
members List<Property Map>
A set of Linodes currently assigned to this Placement Group.

Look up Existing PlacementGroup Resource

Get an existing PlacementGroup 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?: PlacementGroupState, opts?: CustomResourceOptions): PlacementGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        is_compliant: Optional[bool] = None,
        label: Optional[str] = None,
        members: Optional[Sequence[PlacementGroupMemberArgs]] = None,
        placement_group_policy: Optional[str] = None,
        placement_group_type: Optional[str] = None,
        region: Optional[str] = None) -> PlacementGroup
func GetPlacementGroup(ctx *Context, name string, id IDInput, state *PlacementGroupState, opts ...ResourceOption) (*PlacementGroup, error)
public static PlacementGroup Get(string name, Input<string> id, PlacementGroupState? state, CustomResourceOptions? opts = null)
public static PlacementGroup get(String name, Output<String> id, PlacementGroupState state, CustomResourceOptions options)
resources:  _:    type: linode:PlacementGroup    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
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<PlacementGroupMember>
A set of Linodes currently assigned to this Placement Group.
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.
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 []PlacementGroupMemberArgs
A set of Linodes currently assigned to this Placement Group.
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.
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<PlacementGroupMember>
A set of Linodes currently assigned to this Placement Group.
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.
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 PlacementGroupMember[]
A set of Linodes currently assigned to this Placement Group.
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.
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[PlacementGroupMemberArgs]
A set of Linodes currently assigned to this Placement Group.
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.
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>
A set of Linodes currently assigned to this Placement Group.
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.

Supporting Types

PlacementGroupMember
, PlacementGroupMemberArgs

IsCompliant This property is required. bool
Whether this Linode is currently compliant with the group's placement group type.
LinodeId This property is required. int
The ID of the Linode.
IsCompliant This property is required. bool
Whether this Linode is currently compliant with the group's placement group type.
LinodeId This property is required. int
The ID of the Linode.
isCompliant This property is required. Boolean
Whether this Linode is currently compliant with the group's placement group type.
linodeId This property is required. Integer
The ID of the Linode.
isCompliant This property is required. boolean
Whether this Linode is currently compliant with the group's placement group type.
linodeId This property is required. number
The ID of the Linode.
is_compliant This property is required. bool
Whether this Linode is currently compliant with the group's placement group type.
linode_id This property is required. int
The ID of the Linode.
isCompliant This property is required. Boolean
Whether this Linode is currently compliant with the group's placement group type.
linodeId This property is required. Number
The ID of the Linode.

Import

Placement Groups be imported using their unique id, e.g.

$ pulumi import linode:index/placementGroup:PlacementGroup mygroup 1234567
Copy

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

Package Details

Repository
Linode pulumi/pulumi-linode
License
Apache-2.0
Notes
This Pulumi package is based on the linode Terraform Provider.