-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca07479
commit 7434554
Showing
1 changed file
with
10 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
AccessToken=$(gcloud auth print-identity-token) | ||
Response=$(aws sts assume-role-with-web-identity --role-arn "${AWS_ROLE_ARN}" --role-session "cloud-guild" --web-identity-token "$AccessToken") | ||
export AWS_ACCESS_KEY_ID=$(echo $Response | jq -r .Credentials.AccessKeyId) | ||
export AWS_SECRET_ACCESS_KEY=$(echo $Response | jq -r .Credentials.SecretAccessKey) | ||
export AWS_SESSION_TOKEN=$(echo $Response | jq -r .Credentials.SessionToken) | ||
set -euo pipefail | ||
|
||
aws s3 ls | ||
echo $AWS_ROLE_ARN | ||
gcloud auth print-identity-token | ||
# AccessToken=$(gcloud auth print-identity-token) | ||
# Response=$(aws sts assume-role-with-web-identity --role-arn "${AWS_ROLE_ARN}" --role-session "cloud-guild" --web-identity-token "$AccessToken") | ||
# export AWS_ACCESS_KEY_ID=$(echo $Response | jq -r .Credentials.AccessKeyId) | ||
# export AWS_SECRET_ACCESS_KEY=$(echo $Response | jq -r .Credentials.SecretAccessKey) | ||
# export AWS_SESSION_TOKEN=$(echo $Response | jq -r .Credentials.SessionToken) | ||
|
||
# aws s3 ls |