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

store_value argument ignored when creating a service api key #4615

Closed
lorepanichi opened this issue Jun 7, 2023 · 0 comments · Fixed by #5408
Closed

store_value argument ignored when creating a service api key #4615

lorepanichi opened this issue Jun 7, 2023 · 0 comments · Fixed by #5408
Labels
service/IAM Issues related to IAM

Comments

@lorepanichi
Copy link
Contributor

lorepanichi commented Jun 7, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

1.53.0

Affected Resource(s)

  • ibm_iam_service_api_key

Terraform Configuration Files

resource "ibm_iam_service_id" "service_id" {
  name        = "test-service-id"
  description = "some service id"
}

resource "ibm_iam_service_api_key" "api_key" {
  name           = "test-api-key"
  description = "some api key"
  iam_service_id = ibm_iam_service_id.service_id.iam_id
  store_value    = false
}

Expected Behavior

As per documentation, a key with an unretrievable apikey attribute should be created if store_value = false argument is specified.

Actual Behavior

While getting the argument value using GetOk method, a bool false value would be compared with the type zero-value, and being it the same it gets "mistaken" for an undefined bool, flagged as non-existent and returned to the caller.
As can be seen following the first link above, the obtained value is then never set on createAPIKeyOptions for ibm sdk client to use it on create api call. Since store_value defaults to true it's not currently possible to specify it as false.

Steps to Reproduce

  1. terraform apply the provided terraform code;
  2. read the apikey value from obtained details about the service api key - eg. using ibmcloud CLI as such:
ibmcloud iam api-key ApiKey-xyz --output json

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/IAM Issues related to IAM
Projects
None yet
1 participant