Terminate an active assumed role session in Vultr IAM. Revoke temporary elevated permissions and end the session before its scheduled expiration timestamp.
Terminating an assumed role session immediately revokes the temporary permissions granted by the session. This is useful when a session is no longer needed or when you need to revoke elevated access for security reasons.
Follow this guide to terminate an assumed role session using the Vultr API or Terraform.
Send a GET request to the Read Assumed Role Session endpoint to retrieve the session details. Replace {session-token} with the session token. Verify that the remaining_duration is greater than 0.
$ curl "https://api.vultr.com/v2/assumed-roles/{session-token}" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a DELETE request to the Delete Assumed Role Session endpoint to terminate the session.
$ curl "https://api.vultr.com/v2/assumed-roles/{session-token}" \
-X DELETE \
-H "Authorization: Bearer ${VULTR_API_KEY}"
A successful termination returns an HTTP 204 No Content response with no response body. The session's permissions are immediately revoked.
Ensure the Vultr Terraform provider is configured in your Terraform project.
Destroy the role session resource. Replace my_session with the resource label used in your configuration.
$ terraform destroy -target=vultr_organization_role_session.my_session
Alternatively, remove the vultr_organization_role_session block from your configuration and run:
$ terraform apply
Verify that the output shows vultr_organization_role_session.my_session: Destruction complete.