Skip to content
v2.275.0

PlacementGroupStrategy Enum ​

Which strategy to use when launching instances.

Example ​

ts
declare const instanceType: ec2.InstanceType;

const pg = new ec2.PlacementGroup(this, 'test-pg', {
  strategy: ec2.PlacementGroupStrategy.SPREAD,
});

new ec2.Instance(this, 'Instance', {
  vpc,
  instanceType,
  machineImage: ec2.MachineImage.latestAmazonLinux2023(),
  placementGroup: pg,
});

Members ​

MemberDescription
CLUSTERPacks instances close together inside an Availability Zone.
PARTITIONSpreads your instances across logical partitions such that groups of instances in one partition do not share the underlying hardware with groups of instances in different partitions.
SPREADStrictly places a small group of instances across distinct underlying hardware to reduce correlated failures.

Referenced by ​