1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2
  5. PlacementGroup

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi

aws.ec2.PlacementGroup

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi

    Provides an EC2 placement group. Read more about placement groups in AWS Docs.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var web = new Aws.Ec2.PlacementGroup("web", new()
        {
            Strategy = "cluster",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ec2.NewPlacementGroup(ctx, "web", &ec2.PlacementGroupArgs{
    			Strategy: pulumi.String("cluster"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.PlacementGroup;
    import com.pulumi.aws.ec2.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 web = new PlacementGroup("web", PlacementGroupArgs.builder()        
                .strategy("cluster")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    web = aws.ec2.PlacementGroup("web", strategy="cluster")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const web = new aws.ec2.PlacementGroup("web", {strategy: "cluster"});
    
    resources:
      web:
        type: aws:ec2:PlacementGroup
        properties:
          strategy: cluster
    

    Create PlacementGroup Resource

    new PlacementGroup(name: string, args: PlacementGroupArgs, opts?: CustomResourceOptions);
    @overload
    def PlacementGroup(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       name: Optional[str] = None,
                       partition_count: Optional[int] = None,
                       spread_level: Optional[str] = None,
                       strategy: Optional[Union[str, PlacementStrategy]] = None,
                       tags: Optional[Mapping[str, str]] = None)
    @overload
    def PlacementGroup(resource_name: str,
                       args: PlacementGroupArgs,
                       opts: Optional[ResourceOptions] = 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: aws:ec2:PlacementGroup
    properties: # The arguments to resource properties.
    options: # 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.
    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.

    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:

    Strategy string | Pulumi.Aws.Ec2.PlacementStrategy

    The placement strategy. Can be cluster, partition or spread.

    Name string

    The name of the placement group.

    PartitionCount int

    The number of partitions to create in the placement group. Can only be specified when the strategy is set to partition. Valid values are 1 - 7 (default is 2).

    SpreadLevel string

    Determines how placement groups spread instances. Can only be used when the strategy is set to spread. Can be host or rack. host can only be used for Outpost placement groups. Defaults to rack.

    Tags Dictionary<string, string>

    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Strategy string | PlacementStrategy

    The placement strategy. Can be cluster, partition or spread.

    Name string

    The name of the placement group.

    PartitionCount int

    The number of partitions to create in the placement group. Can only be specified when the strategy is set to partition. Valid values are 1 - 7 (default is 2).

    SpreadLevel string

    Determines how placement groups spread instances. Can only be used when the strategy is set to spread. Can be host or rack. host can only be used for Outpost placement groups. Defaults to rack.

    Tags map[string]string

    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    strategy String | PlacementStrategy

    The placement strategy. Can be cluster, partition or spread.

    name String

    The name of the placement group.

    partitionCount Integer

    The number of partitions to create in the placement group. Can only be specified when the strategy is set to partition. Valid values are 1 - 7 (default is 2).

    spreadLevel String

    Determines how placement groups spread instances. Can only be used when the strategy is set to spread. Can be host or rack. host can only be used for Outpost placement groups. Defaults to rack.

    tags Map<String,String>

    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    strategy string | PlacementStrategy

    The placement strategy. Can be cluster, partition or spread.

    name string

    The name of the placement group.

    partitionCount number

    The number of partitions to create in the placement group. Can only be specified when the strategy is set to partition. Valid values are 1 - 7 (default is 2).

    spreadLevel string

    Determines how placement groups spread instances. Can only be used when the strategy is set to spread. Can be host or rack. host can only be used for Outpost placement groups. Defaults to rack.

    tags {[key: string]: string}

    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    strategy str | PlacementStrategy

    The placement strategy. Can be cluster, partition or spread.

    name str

    The name of the placement group.

    partition_count int

    The number of partitions to create in the placement group. Can only be specified when the strategy is set to partition. Valid values are 1 - 7 (default is 2).

    spread_level str

    Determines how placement groups spread instances. Can only be used when the strategy is set to spread. Can be host or rack. host can only be used for Outpost placement groups. Defaults to rack.

    tags Mapping[str, str]

    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    strategy String | "spread" | "cluster"

    The placement strategy. Can be cluster, partition or spread.

    name String

    The name of the placement group.

    partitionCount Number

    The number of partitions to create in the placement group. Can only be specified when the strategy is set to partition. Valid values are 1 - 7 (default is 2).

    spreadLevel String

    Determines how placement groups spread instances. Can only be used when the strategy is set to spread. Can be host or rack. host can only be used for Outpost placement groups. Defaults to rack.

    tags Map<String>

    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

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

    Arn string

    Amazon Resource Name (ARN) of the placement group.

    Id string

    The provider-assigned unique ID for this managed resource.

    PlacementGroupId string

    The ID of the placement group.

    TagsAll Dictionary<string, string>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    Arn string

    Amazon Resource Name (ARN) of the placement group.

    Id string

    The provider-assigned unique ID for this managed resource.

    PlacementGroupId string

    The ID of the placement group.

    TagsAll map[string]string

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    arn String

    Amazon Resource Name (ARN) of the placement group.

    id String

    The provider-assigned unique ID for this managed resource.

    placementGroupId String

    The ID of the placement group.

    tagsAll Map<String,String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    arn string

    Amazon Resource Name (ARN) of the placement group.

    id string

    The provider-assigned unique ID for this managed resource.

    placementGroupId string

    The ID of the placement group.

    tagsAll {[key: string]: string}

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    arn str

    Amazon Resource Name (ARN) of the placement group.

    id str

    The provider-assigned unique ID for this managed resource.

    placement_group_id str

    The ID of the placement group.

    tags_all Mapping[str, str]

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    arn String

    Amazon Resource Name (ARN) of the placement group.

    id String

    The provider-assigned unique ID for this managed resource.

    placementGroupId String

    The ID of the placement group.

    tagsAll Map<String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    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,
            arn: Optional[str] = None,
            name: Optional[str] = None,
            partition_count: Optional[int] = None,
            placement_group_id: Optional[str] = None,
            spread_level: Optional[str] = None,
            strategy: Optional[Union[str, PlacementStrategy]] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, 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:
    Arn string

    Amazon Resource Name (ARN) of the placement group.

    Name string

    The name of the placement group.

    PartitionCount int

    The number of partitions to create in the placement group. Can only be specified when the strategy is set to partition. Valid values are 1 - 7 (default is 2).

    PlacementGroupId string

    The ID of the placement group.

    SpreadLevel string

    Determines how placement groups spread instances. Can only be used when the strategy is set to spread. Can be host or rack. host can only be used for Outpost placement groups. Defaults to rack.

    Strategy string | Pulumi.Aws.Ec2.PlacementStrategy

    The placement strategy. Can be cluster, partition or spread.

    Tags Dictionary<string, string>

    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    TagsAll Dictionary<string, string>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    Arn string

    Amazon Resource Name (ARN) of the placement group.

    Name string

    The name of the placement group.

    PartitionCount int

    The number of partitions to create in the placement group. Can only be specified when the strategy is set to partition. Valid values are 1 - 7 (default is 2).

    PlacementGroupId string

    The ID of the placement group.

    SpreadLevel string

    Determines how placement groups spread instances. Can only be used when the strategy is set to spread. Can be host or rack. host can only be used for Outpost placement groups. Defaults to rack.

    Strategy string | PlacementStrategy

    The placement strategy. Can be cluster, partition or spread.

    Tags map[string]string

    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    TagsAll map[string]string

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    arn String

    Amazon Resource Name (ARN) of the placement group.

    name String

    The name of the placement group.

    partitionCount Integer

    The number of partitions to create in the placement group. Can only be specified when the strategy is set to partition. Valid values are 1 - 7 (default is 2).

    placementGroupId String

    The ID of the placement group.

    spreadLevel String

    Determines how placement groups spread instances. Can only be used when the strategy is set to spread. Can be host or rack. host can only be used for Outpost placement groups. Defaults to rack.

    strategy String | PlacementStrategy

    The placement strategy. Can be cluster, partition or spread.

    tags Map<String,String>

    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tagsAll Map<String,String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    arn string

    Amazon Resource Name (ARN) of the placement group.

    name string

    The name of the placement group.

    partitionCount number

    The number of partitions to create in the placement group. Can only be specified when the strategy is set to partition. Valid values are 1 - 7 (default is 2).

    placementGroupId string

    The ID of the placement group.

    spreadLevel string

    Determines how placement groups spread instances. Can only be used when the strategy is set to spread. Can be host or rack. host can only be used for Outpost placement groups. Defaults to rack.

    strategy string | PlacementStrategy

    The placement strategy. Can be cluster, partition or spread.

    tags {[key: string]: string}

    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tagsAll {[key: string]: string}

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    arn str

    Amazon Resource Name (ARN) of the placement group.

    name str

    The name of the placement group.

    partition_count int

    The number of partitions to create in the placement group. Can only be specified when the strategy is set to partition. Valid values are 1 - 7 (default is 2).

    placement_group_id str

    The ID of the placement group.

    spread_level str

    Determines how placement groups spread instances. Can only be used when the strategy is set to spread. Can be host or rack. host can only be used for Outpost placement groups. Defaults to rack.

    strategy str | PlacementStrategy

    The placement strategy. Can be cluster, partition or spread.

    tags Mapping[str, str]

    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tags_all Mapping[str, str]

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    arn String

    Amazon Resource Name (ARN) of the placement group.

    name String

    The name of the placement group.

    partitionCount Number

    The number of partitions to create in the placement group. Can only be specified when the strategy is set to partition. Valid values are 1 - 7 (default is 2).

    placementGroupId String

    The ID of the placement group.

    spreadLevel String

    Determines how placement groups spread instances. Can only be used when the strategy is set to spread. Can be host or rack. host can only be used for Outpost placement groups. Defaults to rack.

    strategy String | "spread" | "cluster"

    The placement strategy. Can be cluster, partition or spread.

    tags Map<String>

    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tagsAll Map<String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    Supporting Types

    PlacementStrategy, PlacementStrategyArgs

    Spread
    spread

    A spread placement group places instances on distinct hardware.

    Cluster
    cluster

    A cluster placement group is a logical grouping of instances within a single Availability Zone that benefit from low network latency, high network throughput.

    PlacementStrategySpread
    spread

    A spread placement group places instances on distinct hardware.

    PlacementStrategyCluster
    cluster

    A cluster placement group is a logical grouping of instances within a single Availability Zone that benefit from low network latency, high network throughput.

    Spread
    spread

    A spread placement group places instances on distinct hardware.

    Cluster
    cluster

    A cluster placement group is a logical grouping of instances within a single Availability Zone that benefit from low network latency, high network throughput.

    Spread
    spread

    A spread placement group places instances on distinct hardware.

    Cluster
    cluster

    A cluster placement group is a logical grouping of instances within a single Availability Zone that benefit from low network latency, high network throughput.

    SPREAD
    spread

    A spread placement group places instances on distinct hardware.

    CLUSTER
    cluster

    A cluster placement group is a logical grouping of instances within a single Availability Zone that benefit from low network latency, high network throughput.

    "spread"
    spread

    A spread placement group places instances on distinct hardware.

    "cluster"
    cluster

    A cluster placement group is a logical grouping of instances within a single Availability Zone that benefit from low network latency, high network throughput.

    Import

    Using pulumi import, import placement groups using the name. For example:

     $ pulumi import aws:ec2/placementGroup:PlacementGroup prod_pg production-placement-group
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the aws Terraform Provider.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi