Create session token for authenticate with short-term credentials

0

When following instructions to setup the AWS CLI and decided to use authenticate with short-term credentials, then I know how to create the access-key and secret-key for a user but I don't know how to create the aws_session_token?

sedo
asked 5 months ago283 views
1 Answer
1
Accepted Answer

Hello.

For temporary authentication, you must use the credentials issued using the "get-session-token" command.
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sts/get-session-token.html

aws sts get-session-token \
  --duration-seconds 3600

The response looks like this:
Use the access key, secret access key, and session token obtained in this response.

{
    "Credentials": {
        "AccessKeyId": "ASIA...",
        "SecretAccessKey": "...",
        "SessionToken": "...",
        "Expiration": "2024-05-15T23:47:00Z"
    }
}
profile picture
EXPERT
answered 5 months ago
profile pictureAWS
EXPERT
reviewed 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions