User Tools

Site Tools


cloud:aws:codebuild

This is an old revision of the document!


CodeBuild

Switching Roles

To switch role use the sts asume role

Those are commands which can be used

      - ASSUME_ROLE_OUTPUT=$(aws sts assume-role --role-arn "arn:aws:iam::$TARGET_ACCOUNT:role/${PROJECT_NAME}-YOURTARGETCodeBuildRole" --role-session-name "session1" --query "Credentials" --output text)
      - export AWS_ACCESS_KEY_ID=$(echo $ASSUME_ROLE_OUTPUT | awk '{print $1}')
      - export AWS_SECRET_ACCESS_KEY=$(echo $ASSUME_ROLE_OUTPUT | awk '{print $3}')
      - export AWS_SESSION_TOKEN=$(echo $ASSUME_ROLE_OUTPUT | awk '{print $4}')
      - export AWS_DEFAULT_REGION=$REGION

Syntax validation

cloud/aws/codebuild.1552989236.txt.gz · Last modified: (external edit)