1. Packages
  2. Linode
  3. API Docs
  4. PlacementGroup
Linode v4.22.0 published on Tuesday, Jun 25, 2024 by Pulumi

linode.PlacementGroup

Explore with Pulumi AI

linode logo
Linode v4.22.0 published on Tuesday, Jun 25, 2024 by Pulumi

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

    Manages a Linode Placement Group.

    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",
        affinityType: "anti_affinity:local",
    });
    
    import pulumi
    import pulumi_linode as linode
    
    test = linode.PlacementGroup("test",
        label="my-placement-group",
        region="us-mia",
        affinity_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"),
    			AffinityType: 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",
            AffinityType = "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")
                .affinityType("anti_affinity:local")
                .build());
    
        }
    }
    
    resources:
      test:
        type: linode:PlacementGroup
        properties:
          label: my-placement-group
          region: us-mia
          affinityType: 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,
                       affinity_type: Optional[str] = None,
                       label: Optional[str] = None,
                       region: Optional[str] = None,
                       is_strict: Optional[bool] = 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()
    {
        AffinityType = "string",
        Label = "string",
        Region = "string",
        IsStrict = false,
    });
    
    example, err := linode.NewPlacementGroup(ctx, "placementGroupResource", &linode.PlacementGroupArgs{
    	AffinityType: pulumi.String("string"),
    	Label:        pulumi.String("string"),
    	Region:       pulumi.String("string"),
    	IsStrict:     pulumi.Bool(false),
    })
    
    var placementGroupResource = new PlacementGroup("placementGroupResource", PlacementGroupArgs.builder()
        .affinityType("string")
        .label("string")
        .region("string")
        .isStrict(false)
        .build());
    
    placement_group_resource = linode.PlacementGroup("placementGroupResource",
        affinity_type="string",
        label="string",
        region="string",
        is_strict=False)
    
    const placementGroupResource = new linode.PlacementGroup("placementGroupResource", {
        affinityType: "string",
        label: "string",
        region: "string",
        isStrict: false,
    });
    
    type: linode:PlacementGroup
    properties:
        affinityType: string
        isStrict: false
        label: 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:

    AffinityType string
    The affinity policy to use when placing Linodes in this group.
    Label string
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    Region string
    The region of the Placement Group.
    IsStrict bool
    Whether Linodes must be able to become compliant during assignment. (Default true)
    AffinityType string
    The affinity policy to use when placing Linodes in this group.
    Label string
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    Region string
    The region of the Placement Group.
    IsStrict bool
    Whether Linodes must be able to become compliant during assignment. (Default true)
    affinityType String
    The affinity policy to use when placing Linodes in this group.
    label String
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    region String
    The region of the Placement Group.
    isStrict Boolean
    Whether Linodes must be able to become compliant during assignment. (Default true)
    affinityType string
    The affinity policy to use when placing Linodes in this group.
    label string
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    region string
    The region of the Placement Group.
    isStrict boolean
    Whether Linodes must be able to become compliant during assignment. (Default true)
    affinity_type str
    The affinity policy to use when placing Linodes in this group.
    label str
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    region str
    The region of the Placement Group.
    is_strict bool
    Whether Linodes must be able to become compliant during assignment. (Default true)
    affinityType String
    The affinity policy to use when placing Linodes in this group.
    label String
    The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
    region String
    The region of the Placement Group.
    isStrict Boolean
    Whether Linodes must be able to become compliant during assignment. (Default true)

    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 affinity policy.
    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 affinity policy.
    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 affinity policy.
    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 affinity policy.
    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 affinity policy.
    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 affinity policy.
    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,
            affinity_type: Optional[str] = None,
            is_compliant: Optional[bool] = None,
            is_strict: Optional[bool] = None,
            label: Optional[str] = None,
            members: Optional[Sequence[PlacementGroupMemberArgs]] = 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:
    AffinityType string
    The affinity policy to use when placing Linodes in this group.
    IsCompliant bool
    Whether this Linode is currently compliant with the group's affinity policy.
    IsStrict bool
    Whether Linodes must be able to become compliant during assignment. (Default true)
    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.
    Region string
    The region of the Placement Group.
    AffinityType string
    The affinity policy to use when placing Linodes in this group.
    IsCompliant bool
    Whether this Linode is currently compliant with the group's affinity policy.
    IsStrict bool
    Whether Linodes must be able to become compliant during assignment. (Default true)
    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.
    Region string
    The region of the Placement Group.
    affinityType String
    The affinity policy to use when placing Linodes in this group.
    isCompliant Boolean
    Whether this Linode is currently compliant with the group's affinity policy.
    isStrict Boolean
    Whether Linodes must be able to become compliant during assignment. (Default true)
    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.
    region String
    The region of the Placement Group.
    affinityType string
    The affinity policy to use when placing Linodes in this group.
    isCompliant boolean
    Whether this Linode is currently compliant with the group's affinity policy.
    isStrict boolean
    Whether Linodes must be able to become compliant during assignment. (Default true)
    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.
    region string
    The region of the Placement Group.
    affinity_type str
    The affinity policy to use when placing Linodes in this group.
    is_compliant bool
    Whether this Linode is currently compliant with the group's affinity policy.
    is_strict bool
    Whether Linodes must be able to become compliant during assignment. (Default true)
    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.
    region str
    The region of the Placement Group.
    affinityType String
    The affinity policy to use when placing Linodes in this group.
    isCompliant Boolean
    Whether this Linode is currently compliant with the group's affinity policy.
    isStrict Boolean
    Whether Linodes must be able to become compliant during assignment. (Default true)
    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.
    region String
    The region of the Placement Group.

    Supporting Types

    PlacementGroupMember, PlacementGroupMemberArgs

    IsCompliant bool
    Whether this Linode is currently compliant with the group's affinity policy.
    LinodeId int
    The ID of the Linode.
    IsCompliant bool
    Whether this Linode is currently compliant with the group's affinity policy.
    LinodeId int
    The ID of the Linode.
    isCompliant Boolean
    Whether this Linode is currently compliant with the group's affinity policy.
    linodeId Integer
    The ID of the Linode.
    isCompliant boolean
    Whether this Linode is currently compliant with the group's affinity policy.
    linodeId number
    The ID of the Linode.
    is_compliant bool
    Whether this Linode is currently compliant with the group's affinity policy.
    linode_id int
    The ID of the Linode.
    isCompliant Boolean
    Whether this Linode is currently compliant with the group's affinity policy.
    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.22.0 published on Tuesday, Jun 25, 2024 by Pulumi