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

Add GitHub Action #204

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Misterio77
Copy link

One more from me!

Hey, here's a PR for adding a GitHub Action to the repository. It runs using the Docker image you have published, and can be stringed together with aws-actions/configure-aws-credentials to automatically do stuff on AWS through your credentials.

Here's an example on how to use it:

name: Deploy to Coca-Cola AWS
on: [workflow_dispatch]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    # Use aws-azure-login to grab credentials from coca-cola
    - name: Authenticate via Azure
      uses: Misterio77/aws-azure-login@main
      id: azure
      with:
        tenant_id: 12345678-9abc-12d1-34e5-f6g7h86ij90k
        app_id: 12345678-90ab-cdef-ghij-kflmnopqrstu
        username: ${{ secrets.COCA_USERNAME }}
        password: ${{ secrets.COCA_PASSWORD }}
        tfa_secret: ${{ secrets.COCA_TFA }}
        role_arn: arn:aws:iam::123456789012:role123456_Foo_Bar
        duration: 1
    # Configure azure outputs into aws credentials
    - name: Configure AWS Credentials
      uses: aws-actions/configure-aws-credentials@v1
      with:
        aws-access-key-id: ${{ steps.azure.outputs.aws_access_key_id }}
        aws-secret-access-key: ${{ steps.azure.outputs.aws_secret_access_key }}
        aws-session-token: ${{ steps.azure.outputs.aws_session_token }}
        aws-region: us-east-1
    # Test aws access
    - name: Test AWS Credentials
      run: |
        aws sts get-caller-identity

I've kind of built all of my changes together (over the course of one week of work), but decided to split them up to self contained PRs to contribute back to you guys :). This one, however, depends on #201, as i added the TFA as an action input. So you probably will want to merge that one first (i'll rebase this one and the others as needed).

Oh and ATM i haven't write about it on the README, but i'll get to it ASAP.

Probably helps with (or maybe fixes) #148

Thanks again <3

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

Successfully merging this pull request may close these issues.

None yet

2 participants