-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws_s3_bucket resource causes unexpected drift #24254
Comments
I'm uncertain if this is related but I find that |
Same issue here. resource "aws_s3_bucket" "test" {
bucket = "test-sse-bucket-drift"
}
resource "aws_s3_bucket_server_side_encryption_configuration" "test" {
bucket = aws_s3_bucket.test.id
rule {
bucket_key_enabled = false
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
} After applied if I run again Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# aws_s3_bucket.test will be updated in-place
~ resource "aws_s3_bucket" "test" {
id = "test-sse-bucket-drift"
tags = {}
# (11 unchanged attributes hidden)
+ server_side_encryption_configuration {
+ rule {
+ bucket_key_enabled = false -> null
+ apply_server_side_encryption_by_default {
+ sse_algorithm = "AES256" -> null
}
}
}
# (1 unchanged block hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy. I apply again (second time) and now Terraform wants to remove it when I run Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# aws_s3_bucket.test will be updated in-place
~ resource "aws_s3_bucket" "test" {
id = "test-sse-bucket-drift"
tags = {}
# (11 unchanged attributes hidden)
- server_side_encryption_configuration {
- rule {
- bucket_key_enabled = false -> null
- apply_server_side_encryption_by_default {
- sse_algorithm = "AES256" -> null
}
}
}
# (1 unchanged block hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy. To fix it, I need to add lifecycle |
I'm using aws terraform provider 3.56 and all of sudden I see drift changes on s3 bucket policies , bucket encryption settings like the one mentioned above , in addition to that policies that report changes to removed ( while my code base and terraform state seems to match ) |
Same! To work around this, I must add the |
Quick update: I just ran |
@lordgordon Can you share which version you are using? |
Unfortunately, I no longer have access to the repo with that configuration. I think the module's version was up-to-date with the |
After updating my module adding the $ tf version
Terraform v1.4.4
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v4.58.0 $ tf validate
╷
│ Warning: Deprecated attribute
│
│ on .terraform/modules/example/main.tf line 34, in resource "aws_s3_bucket" "bucket":
│ 34: acl,
│
│ The attribute "acl" is deprecated. Refer to the provider documentation for details.
│
│ (and one more similar warning elsewhere)
╵
Success! The configuration is valid, but there were some validation warnings as shown above. The same warning happens for |
@thiagolsfortunato I think yours is due to #28353. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v1.1.8
on darwin_amd64
Affected Resource(s)
In conjunction with
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Debug Output GIST
Expected Behavior
With the
aws_s3_bucket
bucket resource solely managing the name, we would expect the auxiliary resources to manage the state of the other bucket attributes.Actual Behavior
Steps to Reproduce
terraform init
terraform apply
terraform plan
Important Factoids
References
The text was updated successfully, but these errors were encountered: