hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.76k stars 9.12k forks source link

[Bug]: perpetual diff when ebs_enabled is set to false, cannot zero values because of validation #39495

Open joelmarty opened 1 day ago

joelmarty commented 1 day ago

Terraform Core Version

1.9.6

AWS Provider Version

5.65.9

Affected Resource(s)

aws_opensearch_domain

Expected Behavior

Setting ebs_options.ebs_enabled to false ignores the rest of EBS arguments for diff and/or validation.

Actual Behavior

Setting ebs_enabled to false produces a perpetual diff as it sets the other ebs arguments to zero values on apply:

image

At the same time, trying to set those arguments to the same zero values in the configuration to avoid the diff fails because the validation requires specific values:

image

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_opensearch_domain" "opensearch" {

  domain_name     = "test"
  ebs_options {
    ebs_enabled = false
    volume_size = 100
    volume_type = "gp3"
    throughput  = 125
    iops        = 3000
  }

}

Steps to Reproduce

  1. Create domain
  2. Trigger a new plan
  3. Plan will show changes from 0 or "" to values in config when the config did not change

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 day ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue