trek10inc / trek10-ci

MIT License
2 stars 7 forks source link

Add role assumption utils in path #2

Open shortjared opened 7 years ago

shortjared commented 7 years ago

This is a script we have to use currently in a CI script. Gross.

    if [ -n "${MFA_TOKEN}" ]
    then
      AWS_ACCESS_KEY_ID='${PROD_DEPLOY_ACCESS_KEY_ID}'
      AWS_SECRET_ACCESS_KEY='${PROD_DEPLOY_SECRET_ACCESS_KEY}'

      CREDS=(`aws sts assume-role --role-arn "$ARN" --role-session-name "ci-role-assumption" --duration-seconds 1800 --serial-number $PROD_DEPLOY_TOKEN_SERIAL --token-code $MFA_TOKEN --query '[Credentials.AccessKeyId,Credentials.SecretAccessKey,Credentials.SessionToken]' --output text`)

      AWS_DEFAULT_REGION='us-east-1'
      AWS_ACCESS_KEY_ID='${CREDS[0]}'
      AWS_SECRET_ACCESS_KEY='${CREDS[1]}'
      AWS_SESSION_TOKEN='${CREDS[2]}'  
    fi
hauboldj commented 6 years ago

So I'm thinking that we update awsume to include this functionality and then include awsume