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

How to pass AWS role instead of Access Keys #110

Open
h2oearth opened this issue Mar 16, 2024 · 2 comments
Open

How to pass AWS role instead of Access Keys #110

h2oearth opened this issue Mar 16, 2024 · 2 comments

Comments

@h2oearth
Copy link

I am trying to use AWS roles with your action by using aws_session_token. This seems to be the best way to go, according to your documentation. I am confused as to why aws_access_key and aws_secret_key are mandatory if aws_session_token is provided.

Could you please clarify?

aws_session_token: If you are running the action with temporary security credentials using the AWS Security Token Service API. For example, you may be assuming a role in AWS to execute the deploy through something like AWS's [configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) action.

@vitalykarasik
Copy link

Here is my example - I'm using OIDC:

- name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v4
        id: aws_creds
        with:
          role-to-assume: arn:aws:iam::1234567:role/github-actions-oidc-role
          role-session-name: gharolesession
          aws-region: eu-west-2
          output-credentials: true
.......
- name: Deploy to EB
        uses: einaregilsson/beanstalk-deploy@v22
        with:
          aws_access_key: ${{ steps.aws_creds.outputs.aws-access-key-id }}
          aws_secret_key: ${{ steps.aws_creds.outputs.aws-secret-access-key }}
          aws_session_token : ${{ steps.aws_creds.outputs.aws-session-token }}
........          
          

@fjcero
Copy link

fjcero commented May 23, 2024

That is the solution @vitalykarasik thanks

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

3 participants