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

key_protect_key parameter in ibm_database is silently ignored if changed #1622

Closed
l2fprod opened this issue Jul 1, 2020 · 2 comments
Closed

Comments

@l2fprod
Copy link
Member

l2fprod commented Jul 1, 2020

At first I created a Redis instance with no encryption:

resource ibm_database redis {
  name              = "${var.basename}-redis"
  resource_group_id = ibm_resource_group.group.id
  plan              = "standard"
  service           = "databases-for-redis"
  location          = var.region

  service_endpoints = "private"
  tags              = concat(var.tags, ["service"])
}

then I decided to add the encryption

resource ibm_database redis {
  name              = "${var.basename}-redis"
  resource_group_id = ibm_resource_group.group.id
  plan              = "standard"
  service           = "databases-for-redis"
  location          = var.region

  key_protect_key = ibm_kp_key.key.crn
  key_protect_instance = ibm_resource_instance.kms.crn

  service_endpoints = "private"
  tags              = concat(var.tags, ["service"])
}

Running apply does not detect any changes, which got me confused as the doc does not say anything. It seems key protect parameters are ignored after creation.

I'd rather have a message telling me that the instance will be replaced and let me decide whether I want this or want to abort my changes.

"key_protect_instance": {

@hkantare
Copy link
Collaborator

hkantare commented Jul 2, 2020

@l2fprod Can you validate same from UI ..I don't think so we can change the key-protect after creating a instance.

@l2fprod
Copy link
Member Author

l2fprod commented Jul 2, 2020

@hkantare

from the UI, we can't change the key-protect after creating the instance... and this is fine but ignoring the field is misleading.

I ran apply and thought my change was applied whereas it was just ignored. Instead we should just show a replace and let the user decide whether they want this. This applyOnce diff function looks dangerous.

kavya498 added a commit to kavya498/terraform-provider-ibm that referenced this issue Jul 8, 2020
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

No branches or pull requests

2 participants