-
Notifications
You must be signed in to change notification settings - Fork 492
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
Ability to log out? #57
Comments
Hi @ofx-cezar-gradinariu, you can re-run the action multiple times in your workflow file, and the action will overwrite the previous credentials each time. jobs:
deploy:
name: Upload to Amazon S3
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure AWS credentials from Test account
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TEST_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Copy files to the test website with the AWS CLI
run: |
aws s3 sync . s3://my-s3-test-website-bucket
- name: Configure AWS credentials from Production account
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Copy files to the production website with the AWS CLI
run: |
aws s3 sync . s3://my-s3-prod-website-bucket |
Thank you @clareliguori . If you have them auth in different regions it probably works. But in my case, the region is the same. |
@ofx-cezar-gradinariu that's fine, it's the same idea that you run the action again with different credential secrets (TEST vs PROD in the example) Are you seeing that re-running the action with different credentials does not work?
|
Hi @clareliguori, ##[error]User: arn:aws:sts::***:assumed-role/TerraformInfrastructureRole/InfrastructureSession is not authorized to perform: sts:TagSession on resource: *** The role, that here is talked about, is the role from our first login. So it seems that the second login is using some information of the first login. This is our example:
|
Ah thank you for the example @pioneer2k ! I'll work on repro'ing this |
I have a scenario where I would like to have the capability to re-run the "configure-aws-credentials" action again using the same account but different roles inside the same job.
Is there a way to log out/reset/forget the credentials of the first run? My current option is to revert to bash and that is pretty verbose.
Thank you
The text was updated successfully, but these errors were encountered: