linode.PlacementGroup
Explore with Pulumi AI
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:
- Affinity
Type 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.
- Is
Strict bool - Whether Linodes must be able to become compliant during assignment. (Default
true
)
- Affinity
Type 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.
- Is
Strict bool - Whether Linodes must be able to become compliant during assignment. (Default
true
)
- affinity
Type 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.
- is
Strict Boolean - Whether Linodes must be able to become compliant during assignment. (Default
true
)
- affinity
Type 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.
- is
Strict 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
)
- affinity
Type 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.
- is
Strict 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.
- Is
Compliant bool - Whether this Linode is currently compliant with the group's affinity policy.
- Members
List<Placement
Group Member> - A set of Linodes currently assigned to this Placement Group.
- Id string
- 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
[]Placement
Group Member - A set of Linodes currently assigned to this Placement Group.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Compliant Boolean - Whether this Linode is currently compliant with the group's affinity policy.
- members
List<Placement
Group Member> - A set of Linodes currently assigned to this Placement Group.
- id string
- The provider-assigned unique ID for this managed resource.
- is
Compliant boolean - Whether this Linode is currently compliant with the group's affinity policy.
- members
Placement
Group Member[] - 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[Placement
Group Member] - A set of Linodes currently assigned to this Placement Group.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Compliant 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.
- Affinity
Type string - 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 string
- The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
- Members
List<Placement
Group Member> - A set of Linodes currently assigned to this Placement Group.
- Region string
- The region of the Placement Group.
- Affinity
Type string - 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 string
- The label of the Placement Group. This field can only contain ASCII letters, digits and dashes.
- Members
[]Placement
Group Member Args - A set of Linodes currently assigned to this Placement Group.
- Region string
- The region of the Placement Group.
- affinity
Type String - The affinity policy to use when placing Linodes in this group.
- is
Compliant Boolean - Whether this Linode is currently compliant with the group's affinity policy.
- is
Strict 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<Placement
Group Member> - A set of Linodes currently assigned to this Placement Group.
- region String
- The region of the Placement Group.
- affinity
Type string - The affinity policy to use when placing Linodes in this group.
- is
Compliant boolean - Whether this Linode is currently compliant with the group's affinity policy.
- is
Strict 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
Placement
Group Member[] - 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[Placement
Group Member Args] - A set of Linodes currently assigned to this Placement Group.
- region str
- The region of the Placement Group.
- affinity
Type String - The affinity policy to use when placing Linodes in this group.
- is
Compliant Boolean - Whether this Linode is currently compliant with the group's affinity policy.
- is
Strict 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
- Is
Compliant bool - Whether this Linode is currently compliant with the group's affinity policy.
- Linode
Id int - 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.
- is
Compliant Boolean - Whether this Linode is currently compliant with the group's affinity policy.
- linode
Id Integer - The ID of the Linode.
- is
Compliant boolean - Whether this Linode is currently compliant with the group's affinity policy.
- linode
Id 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.
- is
Compliant Boolean - Whether this Linode is currently compliant with the group's affinity policy.
- linode
Id 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.