terraform-ibm-modules / terraform-ibm-icd-elasticsearch

Implements an instance of the IBM Cloud Databases for Elasticsearch service.
Apache License 2.0
0 stars 1 forks source link

fix: add count to wait #299

Closed MatthewLemmond closed 1 month ago

MatthewLemmond commented 1 month ago

Description

If the auth policy creation is skipped, the wait will now also be skipped. resolves https://github.com/terraform-ibm-modules/terraform-ibm-icd-elasticsearch/issues/283

Release required?

Release notes content

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

MatthewLemmond commented 1 month ago

/run pipeline

shemau commented 1 month ago

It looks like changes are required in both. It seems the DA only creates the policy IF it is cross account. The main module creates the policy if it is the same account.

MatthewLemmond commented 1 month ago

/run pipeline

MatthewLemmond commented 1 month ago

The upgrade test fails due to the wait not being provisioned in the latest version: https://github.com/terraform-ibm-modules/terraform-ibm-icd-elasticsearch/actions/runs/11056038146/job/30716846899#step:7:2206

This is expected because we are now skipping these when an auth policy is not created and the upgrade test uses the standard solution, here is the output doing the upgrade test manually and allowing it to destroy the wait blocks

random_password.admin_password[0]: Refreshing state... [id=none]
module.kms[0].data.ibm_resource_instance.existing_kms_instance[0]: Reading...
module.kms[0].module.kms_key_rings["elasticsearch-key-ring"].ibm_kms_key_rings.key_ring: Refreshing state... [id=elasticsearch-key-ring:keyRing:crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9::]
module.resource_group.data.ibm_resource_group.existing_resource_group[0]: Reading...
module.kms[0].module.kms_keys["elasticsearch-key-ring.elasticsearch-key"].ibm_kms_key.key: Refreshing state... [id=crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9:key:cc0005b9-ef98-4ddb-820c-b74275f30d83]
module.resource_group.data.ibm_resource_group.existing_resource_group[0]: Read complete after 1s [id=c91b01c9dbfa48c3bc5d0571e06d392f]
module.kms[0].data.ibm_resource_instance.existing_kms_instance[0]: Read complete after 2s [id=crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9::]
module.kms[0].module.kms_keys["elasticsearch-key-ring.elasticsearch-key"].ibm_kms_key_policies.root_key_policy[0]: Refreshing state... [id=crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9:key:cc0005b9-ef98-4ddb-820c-b74275f30d83]
module.elasticsearch[0].module.elasticsearch.ibm_iam_authorization_policy.policy[0]: Refreshing state... [id=5e445979-5977-4a8d-a487-02f06a339eef]
module.elasticsearch[0].module.elasticsearch.time_sleep.wait_for_authorization_policy[0]: Refreshing state... [id=2024-09-26T18:45:24Z]
module.elasticsearch[0].module.elasticsearch.ibm_database.elasticsearch: Refreshing state... [id=crn:v1:bluemix:public:databases-for-elasticsearch:us-south:a/abac0df06b644a9cabc6e44f55b3880e:b87fc39a-e6f6-4a57-ab73-09af57be3117::]
module.elasticsearch[0].module.elasticsearch.data.ibm_database_connection.database_connection: Reading...
module.elasticsearch[0].module.elasticsearch.data.ibm_database_connection.database_connection: Read complete after 1s [id=2024-09-26 19:02:27.675321 +0000 UTC]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

The one authorization policy that is still present has its wait still, but the two waits which were not needed have been destroyed. Going to skip the upgrade test for this PR as this all seems to be following the expected behavior of these changes.

MatthewLemmond commented 1 month ago

/run pipeline

terraform-ibm-modules-ops commented 1 month ago

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

The release is available on:

Your semantic-release bot :package::rocket: