Created
March 24, 2020 05:41
-
-
Save achmat-samsodien/38919d36c06aa303a29d01119287bf85 to your computer and use it in GitHub Desktop.
IAM Roles in Gitlab Runner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export AWS_CREDS=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/<iam-role>) | |
export AWS_SECRET_ACCESS_KEY=$(echo $AWS_CREDS | jq -r ".SecretAccessKey") | |
export AWS_ACCESS_KEY_ID=$(echo $AWS_CREDS | jq -r ".AccessKeyId") | |
export AWS_SESSION_TOKEN=$(echo $AWS_CREDS | jq -r ".Token") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment