Try AWS Native preview for resources not in the classic version.
aws.ec2.PlacementGroup
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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. Placement Strategy The placement strategy. Can be
cluster
,partition
orspread
.- Name string
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 topartition
. Valid values are 1 - 7 (default is2
).- Spread
Level string Determines how placement groups spread instances. Can only be used when the
strategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.- 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 | Placement
Strategy The placement strategy. Can be
cluster
,partition
orspread
.- Name string
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 topartition
. Valid values are 1 - 7 (default is2
).- Spread
Level string Determines how placement groups spread instances. Can only be used when the
strategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.- 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 | Placement
Strategy The placement strategy. Can be
cluster
,partition
orspread
.- name String
The name of the placement group.
- partition
Count Integer The number of partitions to create in the placement group. Can only be specified when the
strategy
is set topartition
. Valid values are 1 - 7 (default is2
).- spread
Level String Determines how placement groups spread instances. Can only be used when the
strategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.- 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 | Placement
Strategy The placement strategy. Can be
cluster
,partition
orspread
.- name string
The name of the placement group.
- partition
Count number The number of partitions to create in the placement group. Can only be specified when the
strategy
is set topartition
. Valid values are 1 - 7 (default is2
).- spread
Level string Determines how placement groups spread instances. Can only be used when the
strategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.- {[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 | Placement
Strategy The placement strategy. Can be
cluster
,partition
orspread
.- 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 topartition
. Valid values are 1 - 7 (default is2
).- spread_
level str Determines how placement groups spread instances. Can only be used when the
strategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.- 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
orspread
.- name String
The name of the placement group.
- partition
Count Number The number of partitions to create in the placement group. Can only be specified when the
strategy
is set topartition
. Valid values are 1 - 7 (default is2
).- spread
Level String Determines how placement groups spread instances. Can only be used when the
strategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.- 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.
- Placement
Group stringId The ID of the placement group.
- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.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.
- Placement
Group stringId The ID of the placement group.
- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.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.
- placement
Group StringId The ID of the placement group.
- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.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.
- placement
Group stringId The ID of the placement group.
- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.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_ strid The ID of the placement group.
- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.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.
- placement
Group StringId The ID of the placement group.
- Map<String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.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.
- Arn string
Amazon Resource Name (ARN) of the placement group.
- Name string
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 topartition
. Valid values are 1 - 7 (default is2
).- Placement
Group stringId The ID of the placement group.
- Spread
Level string Determines how placement groups spread instances. Can only be used when the
strategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.- Strategy
string | Pulumi.
Aws. Ec2. Placement Strategy The placement strategy. Can be
cluster
,partition
orspread
.- 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.- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- Arn string
Amazon Resource Name (ARN) of the placement group.
- Name string
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 topartition
. Valid values are 1 - 7 (default is2
).- Placement
Group stringId The ID of the placement group.
- Spread
Level string Determines how placement groups spread instances. Can only be used when the
strategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.- Strategy
string | Placement
Strategy The placement strategy. Can be
cluster
,partition
orspread
.- 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.- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
Amazon Resource Name (ARN) of the placement group.
- name String
The name of the placement group.
- partition
Count Integer The number of partitions to create in the placement group. Can only be specified when the
strategy
is set topartition
. Valid values are 1 - 7 (default is2
).- placement
Group StringId The ID of the placement group.
- spread
Level String Determines how placement groups spread instances. Can only be used when the
strategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.- strategy
String | Placement
Strategy The placement strategy. Can be
cluster
,partition
orspread
.- 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.- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn string
Amazon Resource Name (ARN) of the placement group.
- name string
The name of the placement group.
- partition
Count number The number of partitions to create in the placement group. Can only be specified when the
strategy
is set topartition
. Valid values are 1 - 7 (default is2
).- placement
Group stringId The ID of the placement group.
- spread
Level string Determines how placement groups spread instances. Can only be used when the
strategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.- strategy
string | Placement
Strategy The placement strategy. Can be
cluster
,partition
orspread
.- {[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.- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.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 topartition
. Valid values are 1 - 7 (default is2
).- placement_
group_ strid The ID of the placement group.
- spread_
level str Determines how placement groups spread instances. Can only be used when the
strategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.- strategy
str | Placement
Strategy The placement strategy. Can be
cluster
,partition
orspread
.- 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.- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
Amazon Resource Name (ARN) of the placement group.
- name String
The name of the placement group.
- partition
Count Number The number of partitions to create in the placement group. Can only be specified when the
strategy
is set topartition
. Valid values are 1 - 7 (default is2
).- placement
Group StringId The ID of the placement group.
- spread
Level String Determines how placement groups spread instances. Can only be used when the
strategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.- strategy String | "spread" | "cluster"
The placement strategy. Can be
cluster
,partition
orspread
.- 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.- Map<String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.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.
- Placement
Strategy Spread - spread
A
spread
placement group places instances on distinct hardware. - Placement
Strategy 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.
- "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.
Try AWS Native preview for resources not in the classic version.