Skip to content

Conversation

@MatthewLemmond
Copy link
Member

Description

remove requirement for a kms key to be provided when using an existing instance of elasticsearch

resolves #276

Release required?

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (X.x.x)
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

  • If relevant, a test for the change is included or updated with this PR.
  • If relevant, documentation for the change is included or updated with this PR.

For mergers

  • Use a conventional commit message to set the release level. Follow the guidelines.
  • Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
  • Use the Squash and merge option.

Copy link
Contributor

@ocofaigh ocofaigh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we have a test gap here. I don’t want to hold up the PR to plug the test, so I created a new issue: #282

@MatthewLemmond I'll merge as soon as you confirm you did a test manually using existing ES instance? Perhaps include a screenshot

@ocofaigh
Copy link
Contributor

/run pipeline

@MatthewLemmond
Copy link
Member Author

Output from a run

tf apply -var "region=us-south" -var "existing_db_instance_crn=crn:v1:bluemix:public:databases-for-elasticsearch:us-south:a/abac0df06b644a9cabc6e44f55b3880e:64d2516c-0956-4f7a-ac2a-1448904f7c5d::" -var "resource_group_name=tmp-ml" -var "use_existing_resource_group=true"
module.resource_group.data.ibm_resource_group.existing_resource_group[0]: Reading...
data.ibm_resource_instance.existing_instance_resource[0]: Reading...
module.resource_group.data.ibm_resource_group.existing_resource_group[0]: Read complete after 1s [id=3361147dbac547fb85658bb268f16165]
data.ibm_resource_instance.existing_instance_resource[0]: Read complete after 2s [id=crn:v1:bluemix:public:databases-for-elasticsearch:us-south:a/abac0df06b644a9cabc6e44f55b3880e:64d2516c-0956-4f7a-ac2a-1448904f7c5d::]
data.ibm_database.existing_db_instance[0]: Reading...
data.ibm_database.existing_db_instance[0]: Read complete after 4s [id=crn:v1:bluemix:public:databases-for-elasticsearch:us-south:a/abac0df06b644a9cabc6e44f55b3880e:64d2516c-0956-4f7a-ac2a-1448904f7c5d::]
data.ibm_database_connection.existing_connection[0]: Reading...
data.ibm_database_connection.existing_connection[0]: Read complete after 1s [id=2024-09-10 14:22:36.148002 +0000 UTC]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # time_sleep.wait_for_authorization_policy will be created
  + resource "time_sleep" "wait_for_authorization_policy" {
      + create_duration = "30s"
      + id              = (known after apply)
    }

  # time_sleep.wait_for_es_authorization_policy will be created
  + resource "time_sleep" "wait_for_es_authorization_policy" {
      + create_duration = "30s"
      + id              = (known after apply)
    }

Plan: 2 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

time_sleep.wait_for_authorization_policy: Creating...
time_sleep.wait_for_authorization_policy: Still creating... [10s elapsed]
time_sleep.wait_for_authorization_policy: Still creating... [20s elapsed]
time_sleep.wait_for_authorization_policy: Still creating... [30s elapsed]
time_sleep.wait_for_authorization_policy: Creation complete after 30s [id=2024-09-10T14:23:27Z]
time_sleep.wait_for_es_authorization_policy: Creating...
time_sleep.wait_for_es_authorization_policy: Still creating... [10s elapsed]
time_sleep.wait_for_es_authorization_policy: Still creating... [20s elapsed]
time_sleep.wait_for_es_authorization_policy: Still creating... [30s elapsed]
time_sleep.wait_for_es_authorization_policy: Creation complete after 30s [id=2024-09-10T14:23:57Z]

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Outputs:

crn = "crn:v1:bluemix:public:databases-for-elasticsearch:us-south:a/abac0df06b644a9cabc6e44f55b3880e:64d2516c-0956-4f7a-ac2a-1448904f7c5d::"
...

Should we also add counts to these wait blocks so they match the resource that they're waiting on so we don't have this minute of time spent for no resource being created?

@ocofaigh ocofaigh merged commit f1721e7 into main Sep 10, 2024
@ocofaigh ocofaigh deleted the existing-kms-validation-fix branch September 10, 2024 15:04
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This PR is included in version 1.19.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KMS key should be ignored when existing DB instance is used

3 participants