aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

Add support for AWS_SESSION_TOKEN

Open dmuth opened this issue 7 years ago • 2 comments

The environment I am currently in uses temporary credentials, which makes use of a third environment variable: AWS_SESSION_TOKEN.

Is there any chance that support for that could be added in? (I would be happy to test :-)

Thanks,

-- Doug

dmuth avatar May 31 '18 18:05 dmuth

Just pass it in to the container with the other variables:

docker run --rm -t $(tty &>/dev/null && echo "-i") -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}" -e "AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}" -v "$(pwd):/project" mesosphere/aws-cli

Full example script is here, if you're trying to run this on an ec2 using the IAM role:

https://gist.github.com/evu/136633f81262bb205d0253fd2c2ff38a

evu avatar Jan 10 '19 14:01 evu

Thanks @evu - confirmed this works for me.

jess-belliveau avatar Nov 04 '20 01:11 jess-belliveau