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

fix: support dynamic resource key names #604

Closed shemau closed 2 months ago

shemau commented 2 months ago

Description

601 support for dynamic resource key names

Release required?

Release notes content

A new optional key_name has been added to var.resource_keys objects. When specified this will be used as the resource key name and can be a dynamic reference.

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 2 months ago

/run pipeline

shemau commented 2 months ago

The upgrade test fails because the test changes the static reference name of the key to a dynamic reference to demonstrate the new feature. Skipping upgrade.

This is the line:

TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ name                  = "cos-upgrade-crujbk-writer-key" -> "iam-ServiceId-9bc62260-22db-4c31-834d-c137673f1928" # forces replacement

From:

TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185: Terraform will perform the following actions:
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185: 
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:   # module.cos_bucket1.ibm_resource_key.resource_keys["cos-upgrade-crujbk-writer-key"] must be replaced
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185: -/+ resource "ibm_resource_key" "resource_keys" {
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ account_id            = "abac0df06b644a9cabc6e44f55b3880e" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ created_at            = "2024-05-04T20:32:05.006Z" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ created_by            = "IBMid-666000KAO3" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ credentials           = (sensitive value)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ credentials_json      = (sensitive value)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ crn                   = "crn:v1:bluemix:public:cloud-object-storage:global:a/abac0df06b644a9cabc6e44f55b3880e:3da653a6-355c-42a3-ae97-941fbf4919f5:resource-key:220a4dce-b780-47da-ac9f-67334856ef9b" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       + deleted_at            = (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       + deleted_by            = (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ guid                  = "220a4dce-b780-47da-ac9f-67334856ef9b" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ iam_compatible        = true -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ id                    = "crn:v1:bluemix:public:cloud-object-storage:global:a/abac0df06b644a9cabc6e44f55b3880e:3da653a6-355c-42a3-ae97-941fbf4919f5:resource-key:220a4dce-b780-47da-ac9f-67334856ef9b" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ name                  = "cos-upgrade-crujbk-writer-key" -> "iam-ServiceId-9bc62260-22db-4c31-834d-c137673f1928" # forces replacement
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ resource_group_id     = "644e45febd4d45168e6f557e8d661caf" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ resource_instance_url = "/v2/resource_instances/3da653a6-355c-42a3-ae97-941fbf4919f5" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ source_crn            = "crn:v1:bluemix:public:cloud-object-storage:global:a/abac0df06b644a9cabc6e44f55b3880e:3da653a6-355c-42a3-ae97-941fbf4919f5::" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ state                 = "active" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ status                = "active" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ updated_at            = "2024-05-04T20:32:05.006Z" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       + updated_by            = (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:       ~ url                   = "/v2/resource_keys/220a4dce-b780-47da-ac9f-67334856ef9b" -> (known after apply)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:         # (3 unchanged attributes hidden)
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185:     }
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185: 
TestRunUpgradeExample 2024-05-04T20:33:36Z command.go:185: Plan: 1 to add, 0 to change, 1 to destroy.
shemau commented 2 months ago

/run pipeline

shemau commented 2 months ago

/run pipeline

shemau commented 2 months ago

/run pipeline

terraform-ibm-modules-ops commented 2 months ago

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

The release is available on:

Your semantic-release bot :package::rocket: