Resource: awsPlacementGroup
Provides an EC2 placement group. Read more about placement groups in AWS Docs.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.placementGroup.PlacementGroup(this, "web", {
name: "hunky-dory-pg",
strategy: "cluster",
});
Argument Reference
The following arguments are supported:
name
- (Required) The name of the placement group.partitionCount
- (Optional) The number of partitions to create in the placement group. Can only be specified when thestrategy
is set topartition
. Valid values are 1 - 7 (default is2
).spreadLevel
- (Optional) Determines how placement groups spread instances. Can only be used when thestrategy
is set tospread
. Can behost
orrack
.host
can only be used for Outpost placement groups. Defaults torack
.strategy
- (Required) The placement strategy. Can becluster
,partition
orspread
.tags
- (Optional) Key-value map of resource tags. If configured with a providerdefaultTags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
arn
- Amazon Resource Name (ARN) of the placement group.id
- The name of the placement group.placementGroupId
- The ID of the placement group.tagsAll
- A map of tags assigned to the resource, including those inherited from the providerdefaultTags
configuration block.
Import
Placement groups can be imported using the name
, e.g.,