Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use aws credentials from aws-actions/configure-aws-credentials@v1 #66

Open
nnuguid-locii opened this issue May 31, 2022 · 6 comments
Open

Comments

@nnuguid-locii
Copy link

i need to assume a role in order to deploy. aws-actions has a way to this. is there a way for the serverless/githhub-action to use those credentials?

@Pudding124
Copy link

The issue still open, so we can use the assume role to build serverless ? such as the configure-aws-credentials:

- name: Configure AWS credentials
  uses: aws-actions/configure-aws-credentials@v1
  with:
     role-session-name: assume_role
     role-to-assume: ${{ secrets.IAM_ROLE }}
     aws-region: us-east-1

@dan-newscorp
Copy link

+1

2 similar comments
@gm-mmurillo
Copy link

+1

@dfelsman-ta
Copy link

+1

@nitrocode
Copy link

Has anyone able to get this work using the latest https://github.com/aws-actions/configure-aws-credentials ?

I imagine it's the same setup as @Pudding124 mentioned above #66 (comment)

@ryanlawson
Copy link

The configure-aws-credentials action has the following outputs:

  • aws-access-key-id
  • aws-secret-access-key
  • aws-session-token

You can pass them into the Serverless action as environment variables.

For example:

- name: Configure AWS credentials
  uses: aws-actions/configure-aws-credentials@v1
  id: credentials # note `id` needs to be set
  with:
     role-session-name: assume_role
     role-to-assume: ${{ secrets.IAM_ROLE }}
     aws-region: us-east-1

- name: serverless deploy
  uses: serverless/[email protected]
  with:
    args: deploy --use-local-credentials
  env:
    AWS_ACCESS_KEY_ID: ${{ steps.credentials.outputs.aws-access-key-id }}
    AWS_SECRET_ACCESS_KEY: ${{ steps.credentials.outputs.aws-secret-access-key }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants