Skip to content

aws_placement_group enforces an incorrect partition_count limitΒ #45034

@gmarkey

Description

@gmarkey

Terraform and AWS Provider Version

Terraform v1.13.4
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v6.20.0
+ provider registry.terraform.io/hashicorp/null v3.2.4
+ provider registry.terraform.io/hashicorp/vault v5.4.0
+ provider registry.terraform.io/mongey/kafka v0.13.1

Affected Resource(s) or Data Source(s)

  • aws_placement_group

Expected Behavior

Placement groups using partition strategy should not enforce an upper limit of 7 and instead allow the AWS API to enforce limits, as this limit is mutable.
https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/ec2/ec2_placement_group.go#L56

Actual Behavior

Provider errors out when the partition count is greater than hard coded limit of 7.

Relevant Error/Panic Output

Error: expected partition_count to be in the range (0 - 7), got 15

Sample Terraform Configuration

Click to expand configuration
resource "aws_placement_group" "partitioned" {
  name            = "partitioned-placement-group"
  strategy        = "partition"
  partition_count = 8
}

Steps to Reproduce

  1. Attempt to create an aws_placement_group with strategy = "partition" and partition_count greater than 7.

Debug Logging

n/a

GenAI / LLM Assisted Development

n/a

Important Facts and References

https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/ec2/ec2_placement_group.go#L56

AWS allow modifying this limit, although it does not seem to be very publicly advertised, nor is it actually listed under service quotas - modification requires opening a support case (this functionality may be limited to enterprise support customers).

Would you like to implement a fix?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.good first issueCall to action for new contributors looking for a place to start. Smaller or straightforward issues.service/ec2Issues and PRs that pertain to the ec2 service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions