-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
S3 Versioning set to false and object_lock_configuration set to Enabled = bucket creation fail #90
Comments
Hi, @TomGudman ! This one is hard. There is a dedicated note about Terragrunt in README. There was a similar issue with We can make similar changes to this module for all other arguments with What do you think? Can you verify that such a solution would work for you? |
Hi Anton
The issue you are referencing is a terragrunt syntax issue. Whereas it seems my problem is more an ordering issue or incompatibility issue; As per AWS error message (and not terragrunt/terraform). BUT I will try, I will be surprised if that work
That said, thanks for the reply and reference to the jsonencode() trick because I am pretty sure I met this problem on a different topic 2 months ago.
… On 30 Apr 2021, at 17:51, Anton Babenko ***@***.***> wrote:
Hi, @TomGudman !
This one is hard. There is a dedicated note about Terragrunt in README.
There was a similar issue with cors_rule argument - #79
We can make similar changes to this module for all other arguments with type = any if necessary.
What do you think? Can you verify that such a solution would work for you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
For reference the error is :
That's AWS telling terraform (terragrunt in my case) that Versioning (despite being set to false) cannot be changed because of the Object Lock state. Again, happy to try the JSON thing but I am skeptical. |
As expected jsonencode() does not fix the AWS error. Terragrunt inputs
Terragrunt module calling the
|
Actually versioning is a REQUIREMENT for Object Lock... Therefore you cannot disable it. The documentation isn't clear. But the AWS console helped me confirm the behaviour. Before enabling object lock, versioning was set to disable. Once enabled, versioning is set to enabled and the option is greyed out. I have not tested yet but once confirmed, I will update the ticket. |
I am also having this exact same error even with the main.tf having versioning enabled `Terraform v1.0.1
resource "aws_s3_bucket" "enabled_via_object" { terraform init it fails to create the plan ╷ |
This issue has been automatically marked as stale because it has been open 30 days |
This issue was automatically closed because of stale in 10 days |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
If versioning is false and object_lock is enabled, terraform/aws will complain that it cannot change the versioning status because the lock is in place. Commenting the versioning block fixes the issue.
Versions
Terraform: v0.14.7 and Terraform 0.15.1
Terragrunt v0.28.7 and Terragrunt 0.29.1
AMD64 arch
provider registry.terraform.io/hashicorp/aws v3.37.0
terraform-aws-modules/s3-bucket/aws 2.1.0
Reproduction
Code Snippet to Reproduce
We use terragrunt as an interface to terraform but I am mainly only passing on the variables from terragrunt to terraform so that would be :
However the below is how I called the s3 module with
var.versioning = false
var.object_lock_configuration
like the aboveExpected behavior
I expect the bucket to be created successfully with versioning set to false (instead of being absent) and obviously the lock enabled.
Actual behavior
Impossible to create a bucket with object_lock_configuration and versioning set to false without an error.
Workaround
Comment the
versioning {}
block but unfortunately we use terragrunt to reuse this s3 module and feed it variables. We don't want to create separate terragrunt modules one with versioning variable and no object_lock for and one without versioning but with object_lock. It's possible but annoying.Additional context
My terragrunt output showing
The text was updated successfully, but these errors were encountered: