-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Description
In the documentation it mentions the following :
AWSCLI - Interact with the AWSCLI (Windows hosts only)
Im using linux build host and it works fine, i just want to know why this line has been included in the documentation:
Reference:
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.aws-vsts-tools
I export the Credentials to use in later bash tasks
My task :
-
task: AWSShellScript@1
displayName: "Assume AWS Role"
inputs:
awsCredentials: "ado-connection"
regionName: "eu-west-1"
failOnStderr: true
workingDirectory: "$(System.DefaultWorkingDirectory)"
scriptType: 'inline'
inlineScript: |
# Set AWS Credentials and Assume Role
echo "Current Identity"
aws sts get-caller-identityrole_arn="${{ parameters.assume_role }}" echo "Assuming role $role_arn" temp_role=$(aws sts assume-role --role-arn $role_arn --role-session-name Azure-Dev-Ops) AWS_ACCESS_KEY_ID=$(echo $temp_role | jq -r .Credentials.AccessKeyId) AWS_SECRET_ACCESS_KEY=$(echo $temp_role | jq -r .Credentials.SecretAccessKey) AWS_SESSION_TOKEN=$(echo $temp_role | jq -r .Credentials.SessionToken) echo "AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID" # Set environment variables for future tasks echo "##vso[task.setvariable variable=AWS_ACCESS_KEY_ID;isSecret=true]$AWS_ACCESS_KEY_ID" echo "##vso[task.setvariable variable=AWS_SECRET_ACCESS_KEY;isSecret=true]$AWS_SECRET_ACCESS_KEY" echo "##vso[task.setvariable variable=AWS_SESSION_TOKEN;isSecret=true]$AWS_SESSION_TOKEN"
Metadata
Metadata
Assignees
Labels
No labels