-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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_versioning cannot disable versioning #23718
Comments
Hi @skeggse , thank you for raising this issue. From what I've gathered from the AWS documentation (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Versioning.html#versioning-states) , versioning cannot be disabled but MfaDelete for example can.
Perhaps versioning can be disabled via a request to AWS Support though. |
@anGie44 Thanks for clarifying. I see the problem, though I think I perhaps mis-stated my need. I'm less concerned about actually disabling bucket versioning, and more concerned about detecting that drift: sure, if we have to make the change manually, we'll do that, but if we don't even know that a drift has occurred, then we don't know that an action needs to be taken. Can we add a disabled state anyway, even though we know it won't work? That way, Terraform's core functionality - the diff - still works. As an aside, I'm also seeing that we can't import a versioning resource if the bucket is unversioned, which is a related problem - I'd like to be able to import these resources for unversioned buckets. |
I see what you mean now, thanks for the additional info @skeggse . So the
I wonder though, if we can better represent the "disabled" state of bucket versioning by using a data source instead? that way you could detect a change and not worry about the singular data source erroring out. Because the change described above would affect the UX for create/update vs. import, e.g.
, I'd like wait and see more community interest before working on potential code changes within the |
I'm not familiar with this pattern of tracking resource changes - if the data source has changed, Terraform will still say that there are no changes, because it's a data source instead of a If I'm not mistaken, this is a regression from the aws provider v3, because we used to be able to see this change:
I'm not sure I understand why we overhauled the buckets in v4, and it seems weird that we would have done that while also taking steps backwards. In light of this being a regression, I'd like to consider a quicker fix. We're trying to upgrade from v3 to v4, and this is a blocker. It's odd to me that we shipped this regression. |
Not to worry @skeggse , please refer to #23106. We're currently working on moving the In the meantime, I'll keep this open as a bug . do you mind updating the description to better reflect the problem around drift detection/import? Update: Fix ready for review after looking more into the previous versions of the s3 bucket and changes made in #4494. @skeggse , if you have any feedback on the documentation changes as well , reach out 👍 |
This functionality has been released in v4.6.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
aws_s3_bucket_versioning
Terraform Configuration Files
There is no valid Terraform configuration corresponding to
Debug Output
N/A
Panic Output
N/A
Expected Behavior
The resource should support a disabled state for bucket versioning. The only way to handle such buckets in v4 appears to be to omit the resource entirely, which results in the versioning being unmanaged rather than actively disabled. Despite the fact that the action operation to transition a bucket from versioned to unversioned isn't supported by AWS, it's still important to track these changes using the standardized tooling that Terraform provides. Moreover, this blocks
import
s of existing buckets during the migration process lazily forced upon Terraform users in #23106, and makes it impossible to check for drift in that portion of a bucket's configuration.Actual Behavior
Steps to Reproduce
terraform apply
Important Factoids
N/A
References
The text was updated successfully, but these errors were encountered: