From 3e2164496f1ff539ba221a74f2e5bd0194a56f13 Mon Sep 17 00:00:00 2001 From: Bernardo Guerreiro Date: Tue, 23 Jan 2024 13:59:54 +0000 Subject: [PATCH] refactor: make it manually --- .github/workflows/serverless-deploy.yaml | 14 ++++++++++++-- serverless.yml | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/serverless-deploy.yaml b/.github/workflows/serverless-deploy.yaml index 089759e..8b7a50c 100644 --- a/.github/workflows/serverless-deploy.yaml +++ b/.github/workflows/serverless-deploy.yaml @@ -51,10 +51,20 @@ jobs: uses: aws-actions/configure-aws-credentials@v1 with: aws-region: eu-west-2 - # audience: sts.amazonaws.com + audience: sts.amazonaws.com role-to-assume: ${{ secrets.AWS_DEPLOYER_ROLE }} - # role-session-name: OIDCSession + role-session-name: OIDCSession mask-aws-account-id: true + - name: Serverless OIDC Login #https://github.com/thomasmichaelwallace/serverless-better-credentials?tab=readme-ov-file#troubleshooting + run: | + mkdir -p ~/.aws + rm -rf ~/.aws/credentials + echo "[default]" >> ~/.aws/credentials + echo "aws_access_key_id = ${AWS_ACCESS_KEY_ID}" >> ~/.aws/credentials + echo "aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}" >> ~/.aws/credentials + echo "aws_session_token = ${AWS_SESSION_TOKEN}" >> ~/.aws/credentials + echo "region = eu-west-2" >> ~/.aws/credentials + echo "output = json" >> ~/.aws/credentials # - name: Serverless Authentication # run: npx serverless config credentials --provider aws --key ${{ env.AWS_ACCESS_KEY_ID }} --secret ${{ env.AWS_SECRET_ACCESS_KEY }} - name: serverless_deploy diff --git a/serverless.yml b/serverless.yml index 9582919..f9612be 100644 --- a/serverless.yml +++ b/serverless.yml @@ -25,7 +25,7 @@ custom: plugins: - serverless-deployment-bucket - # - serverless-better-credentials + - serverless-better-credentials functions: getAllMovies: