Skip to content

Commit

Permalink
update cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
ksaifullah committed Apr 24, 2024
1 parent ca07479 commit 7434554
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions list-bucket.sh
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

0 comments on commit 7434554

Please sign in to comment.