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

Couldn't able to delete the Service Policy #2703

Closed
sridharmula opened this issue Jun 2, 2021 · 2 comments · Fixed by #2738
Closed

Couldn't able to delete the Service Policy #2703

sridharmula opened this issue Jun 2, 2021 · 2 comments · Fixed by #2738
Assignees
Labels
service/IAM Issues related to IAM

Comments

@sridharmula
Copy link

sridharmula commented Jun 2, 2021

We are trying to provision in a new cluster and we have deleted the service ID and when we ran terraform destroy it was complains about service policy couldn't found and no way to delete them. IBM cloud UI or CLI because the Service ID no longer exists (CLI params require the ServiceID, and UI does not show individual policies.)

Below is the conversation

Guillermo Cabrera:

The problem I see here is in our IBM Terraform provider. The deletion of the policies did not occur via Terraform but was done automatically as a result of that ServiceId that was deleted. As such, when you did your terraform destroy the IBM Terraform provider is also not aware of soft deleted policies.

return fmt.Errorf("Error deleting service policy: %s", err)

ibm/resource_ibm_iam_service_policy.go:422
return fmt.Errorf("Error deleting service policy: %s", err)

Terraform destroy actually does a soft delete and I believe it should remove the resource from the terraform state file.

@kavya498 kavya498 added the service/IAM Issues related to IAM label Jun 3, 2021
@kavya498
Copy link
Collaborator

kavya498 commented Jun 3, 2021

@guicabr,
As discussed, Can we add a condition to empty the state file on response status = deleted as well?

@guicabr
Copy link
Collaborator

guicabr commented Jun 3, 2021

Looking into this

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
3 participants