Skip to content

encryption_configuration keeps getting re-added #243

@stephan242

Description

@stephan242

Describe the Bug

I've got the module configured with this:

  s3_replication_rules = [
    {
      id                               = "replication-bucket"
      status                           = "Enabled"
      prefix                           = "/"
      priority                         = 5
      destination_bucket               = module.replication_bucket.bucket_arn
      delete_marker_replication_status = "Enabled"
      destination = {
        account_id = data.aws_caller_identity.current.account_id
        metrics = {                                                           
          status = "Enabled",
          event_threshold = {
            minutes = 15
          }
        },       
        replication_time = {
          status = "Enabled",
          event_threshold = {
            minutes = 15
          }
        }        
      }        
    }        
  ]        

Every time I apply it I get this:

OpenTofu will perform the following actions:

  # module.backup_bucket.aws_s3_bucket_replication_configuration.default[0] will be updated in-place
  ~ resource "aws_s3_bucket_replication_configuration" "default" {
        id     = "jdx-stg1-backup"
        # (2 unchanged attributes hidden)

      ~ rule {
            id       = "replication-bucket"
            # (2 unchanged attributes hidden)

          ~ destination {
                # (3 unchanged attributes hidden)

              + encryption_configuration {}

                # (2 unchanged blocks hidden)
            }

            # (2 unchanged blocks hidden)
        }
    }

Expected Behavior

To not re-add the empty encryption_configuration at every apply

Steps to Reproduce

Apply s3_replication_rules without setting the encryption_configuration

Screenshots

No response

Environment

OpenTofu v1.6.2
+ provider registry.opentofu.org/hashicorp/aws v5.40.0

Additional Context

No response

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