diff --git a/list-bucket.sh b/list-bucket.sh index 63ba30d..dc0f376 100755 --- a/list-bucket.sh +++ b/list-bucket.sh @@ -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