terraform-ibm-modules / terraform-ibm-cos

Configures an IBM Cloud Object Storage instance and bucket
Apache License 2.0
7 stars 23 forks source link

feat: Enable object locking #593

Closed shemau closed 3 months ago

shemau commented 3 months ago

Description

592

Initial implementation enables object locking on the bucket and creates a ibm_cos_bucket_object_lock_configuration resource.

A bucket with object_versioning_enabled can now also have object_versioning_enabled. When doing this exactly one of object_lock_duration_days or object_lock_duration_years must be set.

Release required?

Release notes content

There will be an upgrade in place of COS buckets created.

object_lock will be added to value specified (default false). object_versioning.enable will be added if it was previously false (default false).

Run the pipeline

If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.

Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:

/run pipeline

Checklist for reviewers

For mergers

shemau commented 3 months ago

/run pipeline

shemau commented 3 months ago

An upgrade in place will be seen by all consumers, something like:

TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: Terraform used the selected providers to generate the following execution
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: plan. Resource actions are indicated with the following symbols:
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:   ~ update in-place
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: 
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: Terraform will perform the following actions:
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: 
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:   # module.cos_bucket1.ibm_cos_bucket.cos_bucket[0] will be updated in-place
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:   ~ resource "ibm_cos_bucket" "cos_bucket" {
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:         id                   = "crn:v1:bluemix:public:cloud-object-storage:global:a/abac0df06b644a9cabc6e44f55b3880e:3410fc67-1a93-4f70-b211-b51396ded2dc:bucket:cos-upgrade-zxztq5-bucket-1:meta:rl:us-south:public"
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:       + object_lock          = false
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:         # (13 unchanged attributes hidden)
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: 
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:       + object_versioning {
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:           + enable = false
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:         }
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: 
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:         # (4 unchanged blocks hidden)
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:     }

Consumers that set object_versioning to true will only see the object_lock being added. Consumers that set object_versioning to false will see both being added.

shemau commented 3 months ago

/run pipeline

shemau commented 3 months ago

The full set of upgrade issues is

TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: Terraform used the selected providers to generate the following execution
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: plan. Resource actions are indicated with the following symbols:
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   ~ update in-place
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: Terraform will perform the following actions:
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   # module.cos_bucket1.ibm_cos_bucket.cos_bucket[0] will be updated in-place
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   ~ resource "ibm_cos_bucket" "cos_bucket" {
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         id                   = "crn:v1:bluemix:public:cloud-object-storage:global:a/abac0df06b644a9cabc6e44f55b3880e:39d7f8d0-4654-4966-986c-017492ae4f79:bucket:cos-upgrade-ibk9lj-bucket-1:meta:rl:us-south:public"
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:       + object_lock          = false
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         # (13 unchanged attributes hidden)
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:       + object_versioning {
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:           + enable = false
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         }
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         # (4 unchanged blocks hidden)
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:     }
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   # module.cos_bucket2.ibm_cos_bucket.cos_bucket[0] will be updated in-place
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   ~ resource "ibm_cos_bucket" "cos_bucket" {
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         id                    = "crn:v1:bluemix:public:cloud-object-storage:global:a/abac0df06b644a9cabc6e44f55b3880e:39d7f8d0-4654-4966-986c-017492ae4f79:bucket:cos-upgrade-ibk9lj-bucket-2-gl9x:meta:crl:us:public"
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:       + object_lock           = false
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         # (13 unchanged attributes hidden)
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:       + object_versioning {
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:           + enable = false
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         }
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         # (3 unchanged blocks hidden)
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:     }
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   # module.cos_bucket3.ibm_cos_bucket.cos_bucket1[0] will be updated in-place
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   ~ resource "ibm_cos_bucket" "cos_bucket1" {
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         id                   = "crn:v1:bluemix:public:cloud-object-storage:global:a/abac0df06b644a9cabc6e44f55b3880e:39d7f8d0-4654-4966-986c-017492ae4f79:bucket:cos-upgrade-ibk9lj-bucket-3-cttf:meta:ssl:ams03:public"
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:       + object_lock          = false
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         # (12 unchanged attributes hidden)
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:       + object_versioning {
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:           + enable = false
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         }
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         # (3 unchanged blocks hidden)
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:     }
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: Plan: 0 to add, 3 to change, 0 to destroy.

This is only the expected changes, so skipping upgrade tests

shemau commented 3 months ago

/run pipeline

shemau commented 3 months ago

/run pipeline

terraform-ibm-modules-ops commented 3 months ago

:tada: This PR is included in version 8.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: