Skip to content

v0.48.0 (Action Needed) Update to AWS provider v4.x

Pre-release
Pre-release
Compare
Choose a tag to compare
@Nuru Nuru released this 22 Feb 04:10
03a9738

This release is an early release in order to unblock people who are blocked because v0.47.0 does not work with AWS Provider v4. However, the newly introduced lifecycle_configuration_rules will be replaced in the next release with a more flexible (and completely incompatible) structure that supports the evolving variety of storage options AWS provides. For this reason, we recommend users continue to use the Deprecated lifecycle_rules input for now, and anticipate it will be supported for a considerable length of time going forward.

See Upgrading to v0.48.0 and AWS provider version 4.x for details about actions you will need to take when updating to this version.

🚀 Enhancements

Upgrade to v4 aws provider @nitrocode (#131)

what

  • Upgrade to v4 aws provider
  • Deprecated policy in favor of source_policy_documents, closes #124
  • Deprecated grants in favor of acl_grants
  • Deprecated lifecycle_rules in favor of lifecycle_configuration_rules
  • All tests pass
    • Current tests pass
    • Tests do not check website inputs. The website_inputs is unavailable in the tests.
    • Tests do not check cors. The cors_rule_inputs is available but unused.
  • Backwards compatible - Is it possible to make it backwards compatible ?
    • Generate the lifecycle rule ids ?
    • Translate the grant.permissions into separate grant.permission blocks ?
  • Migration document in this repo's Wiki

why

  • Current version incompatible with AWS provider v4.x
│ Error: Unsupported attribute
│ 
│   on .terraform-mdev/modules/s3_bucket/main.tf line 166, in resource "aws_s3_bucket" "default":
│  166:         for_each = local.s3_replication_rules == null ? [] : local.s3_replication_rules
│ 
│ This object does not have an attribute named "s3_replication_rules".
  • One upgraded to version 4.x, module no longer works with AWS provider 3.x
  • Pin to >= 4.2.0 because of relevant bug fixes needed by this module

references

notes

  • grants is now deprecated, but still supported. New input replacing it is acl_grants. The only difference is that grants takes a list of permissions and acl_grants takes a single permission. The only reason we are making grants deprecated is so that our inputs track the AWS resource inputs.
  • lifecycle_rules is now deprecated but still supported, replaced with lifecycle_configuration_rules, which is identical except that lifecycle_configuration_rules has an id for each rule, which is now required by the AWS resource (doc). This module supplies an id for lifecycle_rules.
  • aws_s3_bucket_lifecycle_configuration requires a static rules.filter element due to hashicorp/terraform-provider-aws#23299