Delete an IAM role from your Vultr organization. Remove the role and disassociate all attached policies, users, and groups from the role in the IAM system.
Deleting a role removes it from your organization. Users and groups that were assigned the role lose any permissions granted through it. The role can be restored using the Restore Role endpoint if you have its id.
Follow this guide to delete a role using the Vultr Console, the Vultr API, or Terraform.
Send a GET request to the List Roles endpoint to retrieve all roles in your organization.
$ curl "https://api.vultr.com/v2/roles" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Note the id of the role you want to delete.
Send a DELETE request to the Delete Role endpoint to delete the role. Replace {role-id} with the id of the role you want to delete.
$ curl "https://api.vultr.com/v2/roles/{role-id}" \
-X DELETE \
-H "Authorization: Bearer ${VULTR_API_KEY}"
A successful deletion returns an HTTP 204 No Content response with no response body.
Send a GET request to the List Roles endpoint to retrieve all roles.
$ curl "https://api.vultr.com/v2/roles" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that the deleted role no longer appears in the list.
Ensure the Vultr Terraform provider is configured in your Terraform project.
Destroy the role resource. Replace my_role with the resource label used in your configuration.
$ terraform destroy -target=vultr_organization_role.my_role
Alternatively, remove the vultr_organization_role block from your configuration and run:
$ terraform apply
Verify that the output shows vultr_organization_role.my_role: Destruction complete.