Error deploying Beanstalk App with Github action assuming role

205 views Asked by At

Currently trying to deploy my web app to Beanstalk using aws-actions/configure-aws-credentials to assume temporary role with einaregilsson/beanstalk-deploy for the deployment. I'm able to identify my action with AWS but, unable to deploy with einaregilsson/beanstalk-deploy.

Run einaregilsson/beanstalk-deploy@v21
  with:
    application_name: Site
    environment_name: Site-Prod-env
    version_label: 2.0.5
    region: ca-central-1
    deployment_package: site-*.jar
  env:
    AWS_DEFAULT_REGION: ca-central-1
    AWS_REGION: ca-central-1
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
    AWS_SESSION_TOKEN: ***
Beanstalk-Deploy: GitHub Action for deploying to Elastic Beanstalk.
https://github.com/einaregilsson/beanstalk-deploy

Error: Deployment failed: AWS Access Key not specified!

Based on the source code, the configure-aws-credentials set environment variables, secrets and set output variables. But with all of them, I got same result.

Here is my pipeline definition, to validate I can get access, I'm asking for sts identity after configure-aws-credentials and it works as expected:

      - name: Configure AWS Credentials
        id: creds
        uses: aws-actions/[email protected]
        with:
          role-to-assume: ${{ vars.AWS_ROLE_ARN }}
          role-session-name: GitHub_to_AWS_via_FederatedOIDC
          aws-region: ${{ vars.AWS_REGION }}
          output-credentials: true

      - name: get caller identity2
        run: |
          aws sts get-caller-identity

      - name: Deploy to Elastic Beanstalk
        uses: einaregilsson/beanstalk-deploy@v21
        id: deploy
        with:
          aws-access-key-id: ${{ steps.creds.outputs.aws-access-key-id }}
          aws-secret-access-key: ${{ steps.creds.outputs.aws-secret-access-key }}
          aws-session-token: ${{ steps.creds.outputs.aws-session-token }}
          application_name: Site
          environment_name: Site-Prod-env
          version_label: ${{ steps.readversion.outputs.content }}
          region: ${{ vars.AWS_REGION }}
          deployment_package: site-*.jar

I try with secrets and env to retrieve the credentials but get same result.

      - name: Deploy to Elastic Beanstalk
        uses: einaregilsson/beanstalk-deploy@v21
        id: deploy
        with:
          aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
          aws-session-token: ${{ env.AWS_SESSION_TOKEN }}
          application_name: Site
          environment_name: Site-Prod-env
          version_label: ${{ steps.readversion.outputs.content }}
          region: ${{ vars.AWS_REGION }}
          deployment_package: site-*.jar
0

There are 0 answers