diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 3dbc0ae..14d531b 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -291,8 +291,10 @@ pipelines: name: Run Snowsql in CICD oidc: true script: - - *aws-context-dev +# - *aws-context-dev + - export STS_OUTPUT=$(aws sts assume-role-with-web-identity --role-arn $AWS_ROLE_ARN --role-session-name BitbucketPipeline --web-identity-token "$BITBUCKET_STEP_OIDC_TOKEN" --duration-seconds 3600) + - export AWS_ACCESS_KEY_ID=$(echo $STS_OUTPUT | jq -r '.Credentials.AccessKeyId') + - export AWS_SECRET_ACCESS_KEY=$(echo $STS_OUTPUT | jq -r '.Credentials.SecretAccessKey') + - export AWS_SESSION_TOKEN=$(echo $STS_OUTPUT | jq -r '.Credentials.SessionToken') - aws sts get-caller-identity --output text - - echo $AWS_ACCESS_KEY_ID - - echo $AWS_SECRET_ACCESS_KEY - bash snowsql-cicd.sh dev \ No newline at end of file