How to Terminate an Assumed Role Session

Updated on 01 June, 2026

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.

  • Vultr API
  • Terraform
  1. 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.

    console
    $ curl "https://api.vultr.com/v2/assumed-roles/{session-token}" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  2. Send a DELETE request to the Delete Assumed Role Session endpoint to terminate the session.

    console
    $ 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.

  1. Ensure the Vultr Terraform provider is configured in your Terraform project.

  2. Destroy the role session resource. Replace my_session with the resource label used in your configuration.

    console
    $ terraform destroy -target=vultr_organization_role_session.my_session
    

    Alternatively, remove the vultr_organization_role_session block from your configuration and run:

    console
    $ terraform apply
    

    Verify that the output shows vultr_organization_role_session.my_session: Destruction complete.

Comments