Skip to content

Commit

Permalink
Fix spread_level in aws_placement_group to avoid resource force repla…
Browse files Browse the repository at this point in the history
…cement

Requires terraform 1.2 and AWS provider 4.22
  • Loading branch information
zhiguangwang committed Aug 25, 2022
1 parent ca873ad commit 77fe129
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions modules/nomad-cluster/main.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# ---------------------------------------------------------------------------------------------------------------------
# THESE TEMPLATES REQUIRE TERRAFORM VERSION 0.12 AND ABOVE
# THESE TEMPLATES REQUIRE TERRAFORM VERSION 1.2 AND ABOVE
# ---------------------------------------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12"
required_version = "~> 1.2"
required_providers {
aws = {
source = "hashicorp/aws"
# resource/aws_placement_group: Add spread_level argument
# https://github.com/hashicorp/terraform-provider-aws/blob/main/CHANGELOG.md#4220-july--8-2022
version = "~> 4.22"
}
}
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -144,6 +152,10 @@ resource "aws_placement_group" "spread" {
name = var.cluster_name
strategy = "spread"
tags = var.tags

# https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreatePlacementGroup.html
# https://aws.amazon.com/about-aws/whats-new/2022/06/amazon-ec2-placement-groups-support-host-level-spread-aws-outposts-rack/
spread_level = "rack"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 77fe129

Please sign in to comment.