Open ghost opened 4 years ago
We internally call the Softlayer(Classic) API to make delete request ..So when user status is in pending state the API is throwing back the error SoftLayer_Exception_Public: Switching user status from PENDING to DELETED is forbidden. (HTTP 500). I will follow up with Classic API team and update
I added more information about this issue
terraform --version
Terraform v0.11.7
+ provider.ibm v0.22.0
Terraform logs
ibm_compute_user.user-terraform-foobar (destroy)
provider.ibm
provider.ibm
2020/01/15 11:09:59 [DEBUG] ReferenceTransformer: "ibm_compute_user.user-terraform-foobar (destroy)" references: []
2020/01/15 11:09:59 [DEBUG] ReferenceTransformer: "provider.ibm" references: []
2020/01/15 11:09:59 [DEBUG] Starting graph walk: walkApply
2020-01-15T11:09:59.366+0100 [DEBUG] plugin.terraform-provider-ibm_v0.22.0: 2020/01/15 11:09:59 Configuring SoftLayer Session with API key
2020-01-15T11:09:59.366+0100 [DEBUG] plugin.terraform-provider-ibm_v0.22.0: 2020/01/15 11:09:59 Configuring IBM Cloud Session with API key
2020-01-15T11:10:04.163+0100 [DEBUG] plugin.terraform-provider-ibm_v0.22.0: 2020/01/15 11:10:04 the apiendpoint url for power is us-south.power-iaas.cloud.ibm.com
2020-01-15T11:10:04.165+0100 [DEBUG] plugin.terraform-provider-ibm_v0.22.0: 2020/01/15 11:10:04 [INFO] Deleting IBM Cloud user: 7xxxxxx
2020-01-15T11:10:04.166+0100 [DEBUG] plugin.terraform-provider-ibm_v0.22.0: 2020/01/15 11:10:04 [DEBUG] Request URL: PUT https://api.softlayer.com/rest/v3/SoftLayer_User_Customer/7xxxxxx.json
2020-01-15T11:10:04.166+0100 [DEBUG] plugin.terraform-provider-ibm_v0.22.0: 2020/01/15 11:10:04 [DEBUG] Parameters: {"parameters":[{"userStatusId":1021}]}
2020-01-15T11:10:05.188+0100 [DEBUG] plugin.terraform-provider-ibm_v0.22.0: 2020/01/15 11:10:05 [DEBUG] Status Code: 500
2020-01-15T11:10:05.188+0100 [DEBUG] plugin.terraform-provider-ibm_v0.22.0: 2020/01/15 11:10:05 [DEBUG] Response: {"error":"Switching user status from PENDING to DELETED is forbidden.","code":"SoftLayer_Exception_Public"}
2020/01/15 11:10:05 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:
* ibm_compute_user.user-terraform-foobar: Error deleting IBM Cloud user: SoftLayer_Exception_Public: Switching user status from PENDING to DELETED is forbidden. (HTTP 500)
2020/01/15 11:10:05 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:
* ibm_compute_user.user-terraform-foobar: Error deleting IBM Cloud user: SoftLayer_Exception_Public: Switching user status from PENDING to DELETED is forbidden. (HTTP 500)
2020/01/15 11:10:05 [ERROR] root: eval: *terraform.EvalOpFilter, err: 1 error(s) occurred:
* ibm_compute_user.user-terraform-foobar: Error deleting IBM Cloud user: SoftLayer_Exception_Public: Switching user status from PENDING to DELETED is forbidden. (HTTP 500)
2020/01/15 11:10:05 [TRACE] [walkApply] Exiting eval tree: ibm_compute_user.user-terraform-foobar (destroy)
2020/01/15 11:10:05 [DEBUG] plugin: waiting for all plugin processes to complete...
Its working according to classic API infrastructure API. Can you please try with new IBM Cloud API to manage classic Infrastructure API https://ibm-cloud.github.io/tf-ibm-docs/v1.0.0/r/iam_user_invite.html
Hi @hkantare, we tried the new method and it's working, the problem we found with the new method is that we aren't able to import the current users.
Do you know if it will be added?
Hi @djimbel-nr, When we invite a user to an account, there will be an email sent out to the invited user.
The invited user should accept the invitation. If the invited user is not having an account in IBM Cloud, while accepting the invitation invited user will be prompted to new page to create the account in IBM cloud, on completion of this the invited user status will be 'ACTIVE'.
Hi @Anil-CM. Thanks for the response.
Maybe I didn't explain myself correctly, the problem we are having with the new method is that we aren't able to import the current users. Also AFAIK, the method iam_user_invite isn't valid to create/modify/delete users, it's only valid to send invitation.
We would need to be able to administrate users in IBMCloud with IBMid.
Regards,
We are having some issues when deleting users via terraform using the resource
ibm_compute_user
and when the user state is PENDING.Terraform Version
Affected Resource
Terraform Configuration Files
Expected Behavior
The user should be deleted.
Actual Behavior
We know the user's status is PENDING till the user enters for the first time. If the user doesn't active the account and we want to delete it, we are getting this error.
Steps to Reproduce
terraform apply
terraform destroy