Resource: aws_placement_group

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

Example Usage

resource "aws_placement_group" "web" {
  name     = "hunky-dory-pg"
  strategy = "cluster"
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import placement groups using the name. For example:

import {
  to = aws_placement_group.prod_pg
  id = "production-placement-group"
}

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

% terraform import aws_placement_group.prod_pg production-placement-group