Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import a resource provisioned with key_protect_id and key_protect_instance attributes set #5798

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

lornakelly
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Ticket: https://github.ibm.com/compose/App/issues/1600

Summary:
When importing an ibm_database terraform resource with key_protect_key and key_protect_instance attributes set, these values are not read or persisted from the remote state. This causes the resource to be marked for deletion.

Fix:

  • Add disk_encryption_instance_crn and disk_encryption_key_crn to resourceIBMDatabaseInstanceRead
  • Update import tests to ignore deletion_protection

Output from acceptance testing:

$ make testacc TEST=./ibm/service/database TESTARGS='-run=TestAccIBMDatabaseInstanceRedisImport'
...
=== RUN   TestAccIBMDatabaseInstanceRedisImport
=== PAUSE TestAccIBMDatabaseInstanceRedisImport
=== CONT  TestAccIBMDatabaseInstanceRedisImport
--- PASS: TestAccIBMDatabaseInstanceRedisImport (357.97s)
PASS
...

@lornakelly lornakelly changed the title Lk/1600/key protect Import a resource provisioned with key_protect_id and key_protect_instance attributes set Nov 18, 2024
Copy link
Collaborator

@omaraibrahim omaraibrahim left a comment

Choose a reason for hiding this comment

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

LGTM 🥳

@omaraibrahim omaraibrahim merged commit 2af014a into IBM-Cloud:master Nov 18, 2024
1 check passed
ismirlia pushed a commit to powervs-ibm/terraform-provider-ibm that referenced this pull request Dec 4, 2024
lornakelly pushed a commit to lornakelly/terraform-provider-ibm that referenced this pull request Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants