1. Packages
  2. Linode Provider
  3. API Docs
  4. PlacementGroup
Linode v4.27.2 published on Tuesday, Sep 24, 2024 by Pulumi

linode.PlacementGroup

Explore with Pulumi AI

linode logo
Linode v4.27.2 published on Tuesday, Sep 24, 2024 by Pulumi

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

    NOTE: Placement Groups may not currently be available to all users.

    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",
    });
    
    import pulumi
    import pulumi_linode as linode
    
    test = linode.PlacementGroup("test",
        label="my-placement-group",
        region="us-mia",
        placement_group_type="anti_affinity:local")
    
    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
    	})
    }
    
    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",
        });
    
    });
    
    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());
    
        }
    }
    
    resources:
      test:
        type: linode:PlacementGroup
        properties:
          label: my-placement-group
          region: us-mia
          placementGroupType: anti_affinity:local
    

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

    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

    The PlacementGroup resource accepts the following input properties:

    Label string
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    PlacementGroupType string
    The placement group type to use when placing Linodes in this group.
    Region string
    The region of the Placement Group.
    PlacementGroupPolicy string
    Whether Linodes must be able to become compliant during assignment. (Default strict)
    Label string
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    PlacementGroupType string
    The placement group type to use when placing Linodes in this group.
    Region string
    The region of the Placement Group.
    PlacementGroupPolicy string
    Whether Linodes must be able to become compliant during assignment. (Default strict)
    label String
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    placementGroupType String
    The placement group type to use when placing Linodes in this group.
    region String
    The region of the Placement Group.
    placementGroupPolicy String
    Whether Linodes must be able to become compliant during assignment. (Default strict)
    label string
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    placementGroupType string
    The placement group type to use when placing Linodes in this group.
    region string
    The region of the Placement Group.
    placementGroupPolicy string
    Whether Linodes must be able to become compliant during assignment. (Default strict)
    label str
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    placement_group_type str
    The placement group type to use when placing Linodes in this group.
    region str
    The region of the Placement Group.
    placement_group_policy str
    Whether Linodes must be able to become compliant during assignment. (Default strict)
    label String
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    placementGroupType String
    The placement group type to use when placing Linodes in this group.
    region 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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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 bool
    Whether this Linode is currently compliant with the group's placement group type.
    LinodeId int
    The ID of the Linode.
    IsCompliant bool
    Whether this Linode is currently compliant with the group's placement group type.
    LinodeId int
    The ID of the Linode.
    isCompliant Boolean
    Whether this Linode is currently compliant with the group's placement group type.
    linodeId Integer
    The ID of the Linode.
    isCompliant boolean
    Whether this Linode is currently compliant with the group's placement group type.
    linodeId number
    The ID of the Linode.
    is_compliant bool
    Whether this Linode is currently compliant with the group's placement group type.
    linode_id int
    The ID of the Linode.
    isCompliant Boolean
    Whether this Linode is currently compliant with the group's placement group type.
    linodeId 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
    

    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.
    linode logo
    Linode v4.27.2 published on Tuesday, Sep 24, 2024 by Pulumi