Assume a Vultr IAM role from a Cloud Compute instance or Bare Metal server using its identity token, creating a temporary session without stored credentials.
A Vultr Cloud Compute instance or Bare Metal server can assume an IAM role using its own identity token in place of a user's credentials. The identity token itself authenticates the request, so the assume-role call needs no user_id or oidc_issuer_id.
Before assuming a role this way, you must have a role trust configured for the instance or baremetal issuer source. See How to Configure a Role Trust for Instance or Bare Metal.
Follow this guide to assume a role from within an instance or bare metal server using the Vultr API.
Obtain an identity token from the server's metadata service.
Send a POST request to the Create Assumed Role Session endpoint, passing the identity token as the Authorization header instead of a Vultr API key. Replace IDENTITY-TOKEN with the token from the previous step, ROLE-ID with the assumable role id, and SESSION-NAME with a name for the session.
A successful request returns an HTTP 201 Created response with a session_token prefixed ars-. Both user_id and oidc_issuer_id return empty in the response, since the session is tied to the entity's trust rather than a platform user.
Pass session_token as the Authorization: Bearer token in subsequent requests. The session expires after the specified duration.
0 Comments
Be the first to comment and share your perspective with the community.