linode.PlacementGroup
Explore with Pulumi AI
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.
- Placement
Group stringType - The placement group type to use when placing Linodes in this group.
- Region string
- The region of the Placement Group.
- Placement
Group stringPolicy - 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.
- Placement
Group stringType - The placement group type to use when placing Linodes in this group.
- Region string
- The region of the Placement Group.
- Placement
Group stringPolicy - 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.
- placement
Group StringType - The placement group type to use when placing Linodes in this group.
- region String
- The region of the Placement Group.
- placement
Group StringPolicy - 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.
- placement
Group stringType - The placement group type to use when placing Linodes in this group.
- region string
- The region of the Placement Group.
- placement
Group stringPolicy - 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_ strtype - The placement group type to use when placing Linodes in this group.
- region str
- The region of the Placement Group.
- placement_
group_ strpolicy - 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.
- placement
Group StringType - The placement group type to use when placing Linodes in this group.
- region String
- The region of the Placement Group.
- placement
Group StringPolicy - 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.
- Is
Compliant bool - Whether this Linode is currently compliant with the group's placement group type.
- 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 placement group type.
- 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 placement group type.
- 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 placement group type.
- 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 placement group type.
- 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 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.
- 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<Placement
Group Member> - A set of Linodes currently assigned to this Placement Group.
- Placement
Group stringPolicy - Whether Linodes must be able to become compliant during assignment. (Default
strict
) - Placement
Group stringType - 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 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.
- Placement
Group stringPolicy - Whether Linodes must be able to become compliant during assignment. (Default
strict
) - Placement
Group stringType - The placement group type to use when placing Linodes in this group.
- Region string
- The region of the Placement Group.
- is
Compliant 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<Placement
Group Member> - A set of Linodes currently assigned to this Placement Group.
- placement
Group StringPolicy - Whether Linodes must be able to become compliant during assignment. (Default
strict
) - placement
Group StringType - The placement group type to use when placing Linodes in this group.
- region String
- The region of the Placement Group.
- is
Compliant 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
Placement
Group Member[] - A set of Linodes currently assigned to this Placement Group.
- placement
Group stringPolicy - Whether Linodes must be able to become compliant during assignment. (Default
strict
) - placement
Group stringType - 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[Placement
Group Member Args] - A set of Linodes currently assigned to this Placement Group.
- placement_
group_ strpolicy - Whether Linodes must be able to become compliant during assignment. (Default
strict
) - placement_
group_ strtype - The placement group type to use when placing Linodes in this group.
- region str
- The region of the Placement Group.
- is
Compliant 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.
- placement
Group StringPolicy - Whether Linodes must be able to become compliant during assignment. (Default
strict
) - placement
Group StringType - The placement group type to use when placing Linodes in this 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 placement group type.
- Linode
Id int - 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.
- is
Compliant Boolean - Whether this Linode is currently compliant with the group's placement group type.
- linode
Id Integer - The ID of the Linode.
- is
Compliant boolean - Whether this Linode is currently compliant with the group's placement group type.
- linode
Id 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.
- is
Compliant Boolean - Whether this Linode is currently compliant with the group's placement group type.
- 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.