mineiros-io / terraform-aws-s3-bucket

A Terraform module to create a Simple Storage Service (S3) Bucket on Amazon Web Services (AWS). https://aws.amazon.com/s3/
Apache License 2.0
61 stars 40 forks source link

Support for AWS module 4.0+ #57

Open phillipuniverse opened 2 years ago

phillipuniverse commented 2 years ago

Current Version

0.6.0

Use-cases

Wanting to use version 4 of the AWS terraform module but cannot because of the hard < 4.0 version requirement

https://github.com/mineiros-io/terraform-aws-s3-bucket/blob/65c9c498b4f1146b00a25ebe00fe8a41b761dbc9/versions.tf#L8-L10

╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints >= 2.51.0, ~> 4.0, < 4.0.0
╵

Attempted Solutions

Attempted upgraded to AWS module 4.0

Proposal

Add support for version 4 of the AWS module. The biggest changes are making some properties readonly in the 4.0 version, for instance cors_rule.

References

AWS 4.0 release notes

mariux commented 2 years ago

hi @phillipuniverse,

thank you for your request, the resource is a breaking change in the new provider version and needs a complete refactoring.

We will schedule an update asap.

phillipuniverse commented 2 years ago

@mariux i figured, it looked pretty impactful to this plugin.

Thanks for putting this on your backlog!

Limess commented 2 years ago

It looks like this module would now be supported in its current form by Terraform >=4.9.x https://github.com/hashicorp/terraform-provider-aws/issues/23106#issuecomment-1087794241 with breaking changes not necessary until 5.x.x.

Limess commented 1 year ago

So this is definitely supported by 4.9, however removing attributes from the bucket won't be detected (https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-4-upgrade#changes-to-s3-bucket-drift-detection):

Thus, if one of these parameters was once configured and then is entirely removed from an aws_s3_bucket resource configuration, Terraform will not pick up on these changes on a subsequent terraform plan or terraform apply.

As such it looks like this module should make the breaking changes and break semver versioning, dropping support for providers earlier than 4.9.