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.8k stars 9.15k forks source link

[Bug]: Applies at `aws_s3_bucket_intelligent_tiering_configuration` are not idempotent if neither the filter block nor the prefix parameter are specified #29074

Open dgdelahera opened 1 year ago

dgdelahera commented 1 year ago

Terraform Core Version

1.2.4,1.3.7

AWS Provider Version

4.51.0

Affected Resource(s)

Expected Behavior

The ResourceBucketIntelligentTieringConfiguration should apply the default behaviour as described in the ResourceBucketLifecycleConfiguration.

Actual Behavior

Without the default behaviour, the terraform applies in the resources are not idempotent if neither the filter block nor the prefix parameter are specified

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_s3_bucket" "bucket" {
  bucket        = "bucket"
}

resource "aws_s3_bucket_intelligent_tiering_configuration" "bucket_intelligent_tiering" {
  bucket = aws_s3_bucket.bucket.bucket
  name   = "intelligent-tiering"

  filter {
    prefix = ""
  }

  tiering {
    access_tier = "ARCHIVE_ACCESS"
    days        = 90
  }
}

Steps to Reproduce

  1. Apply the resources listed before.
  2. Apply again and check the output. The aws_s3_bucket_intelligent_tiering_configuration will be updated.

Debug Output

 # module.test_8.aws_s3_bucket_intelligent_tiering_configuration.bucket_intelligent_tiering[0] will be updated in-place
   ~ resource "aws_s3_bucket_intelligent_tiering_configuration" "bucket_intelligent_tiering" {
        id     = "test-8-w4qybq-mp70tb35z80bfr2p:intelligent-tiering"
        name   = "intelligent-tiering"
         # (2 unchanged attributes hidden)

      + filter {}

        # (1 unchanged block hidden)
     }

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

seanturner026 commented 5 months ago

Digging deeper reveals that this has been discussed previously:

https://github.com/hashicorp/terraform-provider-aws/issues/29052