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.85k stars 9.2k forks source link

[Bug]: Changing ebs_block_device.throughput is ignored on aws_instance #39866

Open t0yv0 opened 1 month ago

t0yv0 commented 1 month ago

Terraform Core Version

1.8.3

AWS Provider Version

5.72.1

Affected Resource(s)

Expected Behavior

Changes not detected

Actual Behavior

Changes detected and applied

Relevant Error/Panic Output Snippet

N/A

Terraform Configuration Files


data "aws_ami" "this" {
  most_recent = true
  owners      = ["amazon"]
  filter {
    name   = "architecture"
    values = ["arm64"]
  }
  filter {
    name   = "name"
    values = ["al2023-ami-2023*"]
  }
}

resource "aws_instance" "this" {
  ami = data.aws_ami.this.id
  ebs_block_device {
          device_name = "/dev/sdb"
          volume_size = 1024
          volume_type = "gp3"
          iops = 5000
          # throughput = 250
  }
  instance_type = "t4g.nano"
} 

Steps to Reproduce

Run terraform apply.

Edit the code to change throughput.

Run terraform preview.

Expected a plan to update the instance, getting a no-change plan.

Debug Output

N/A

Panic Output

There is a DiffSuppress configuration on this field that was introduced couple of years ago:

https://github.com/hashicorp/terraform-provider-aws/commit/3b9f715a3ab1e8b3af1beca4d28db33d7df4c717 https://github.com/hashicorp/terraform-provider-aws/blob/master/internal/service/ec2/ec2_instance.go#L948 https://github.com/hashicorp/terraform-provider-aws/blob/master/internal/service/ec2/ec2_instance.go#L261

This might have made sense at the time but makes less sense with recent changes in AWS.

Important Factoids

N/A

References

N/A

Would you like to implement a fix?

No

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 3 weeks ago

Similar #34167