Open
Description
Terraform and AWS Provider Version
Terraform v1.12.1
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.99.1
Affected Resource(s) or Data Source(s)
aws_s3_object
aws_s3_bucket
Expected Behavior
Upload an object to S3.
In the following executions, if there are no changes to the object, the resource does not change.
Actual Behavior
Upload an object to S3.
In the following executions, the aws_s3_object
resource is replaced.
Relevant Error/Panic Output
# aws_s3_object.this must be replaced
-/+ resource "aws_s3_object" "this" {
+ acl = (known after apply)
~ arn = "arn:aws:s3:::bucket-name/file.zip" -> (known after apply)
~ bucket = "bucket-name" -> (known after apply) # forces replacement
~ bucket_key_enabled = false -> (known after apply)
+ checksum_crc32 = (known after apply)
+ checksum_crc32c = (known after apply)
+ checksum_crc64nvme = (known after apply)
+ checksum_sha1 = (known after apply)
+ checksum_sha256 = (known after apply)
~ content_type = "application/octet-stream" -> (known after apply)
~ etag = "e123456789abcdef0123456789abcdef0" -> (known after apply)
~ id = "file.zip" -> (known after apply)
+ kms_key_id = (known after apply)
- metadata = {} -> null
~ server_side_encryption = "AES256" -> (known after apply)
~ storage_class = "STANDARD" -> (known after apply)
- tags = {} -> null
~ tags_all = {} -> (known after apply)
~ version_id = "FzVF5i_zc4CCsPjpg3X1PbXX80ktTLB8" -> (known after apply)
# (12 unchanged attributes hidden)
}
Sample Terraform Configuration
Click to expand configuration
data "aws_s3_bucket" "this" {
bucket = "bucket-name"
}
resource "aws_s3_object" "this" {
bucket = data.aws_s3_bucket.this.bucket
key = "file.zip"
}
Steps to Reproduce
- Create a bucket
- Create a S3 object with
aws_s3_object
resource and reference a bucket withaws_s3_bucket
data. - Re-aply Terraform
Debug Logging
Click to expand log output
GenAI / LLM Assisted Development
n/a
Important Facts and References
Similar behavior bug: #32529
Would you like to implement a fix?
No