Skip to content

can't set storage_class to inherit the source object in replication rules #207

@NoaBM

Description

@NoaBM

Describe the Bug

When creating s3 bucket with s3_replication_rules, the storage_class inside destination is always enabled as "STANDARD" and can't be set to null, when the null should use the source replication bucket.

Expected Behavior

storage_class for replication should not be set, and should be taken from the source replication bucket.

Steps to Reproduce

call the module with all relevant fields including the replication fields -

module "s3_bucket" {
    source                  = "cloudposse/s3-bucket/aws"
    version                 = "4.0.1"
    s3_replication_rules = [{
         destination = {
              storage_class = null
          }
     }]
}

see in aws console that the "Destination storage class" is set to Standard and not as it should be unmarked.
Screenshot 2023-11-27 at 14 07 31

Screenshots

No response

Environment

  • Terraform version - 1.5
  • module version - 4.0.1

Additional Context

I tested a fix to the module in variables.tf line 267 and changed it to - storage_class = optional(string, null), and it seems to work either if :

  • we don't send "storage_class" to the module at all, the result is inherited from the source bucket

  • we do send "storage_class = STANDARD" it's sets it to standard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions