# GitHub: One command to authorize GitHub Actions to deploy to AWS

**URL:** <https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674>\
**Category:** AWS Cloud Talk\
**Created:** [July 11, 2024, 12:42pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674 "2024-07-11T12:42:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnapoli](https://awshq.com/letter_avatar_proxy/v4/letter/m/13edae/32.png) [@mnapoli](https://awshq.com/u/mnapoli)\
**Post date:** [July 11, 2024, 12:42pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/1 "2024-07-11T12:42:07Z")

</div>

GitHub: One command to authorize GitHub Actions to deploy to AWS

[https://github.com/mnapoli/github-to-aws](https://github.com/mnapoli/github-to-aws)

---

<div class="post-metadata">

**Author:** ![ContrarianChris](https://awshq.com/letter_avatar_proxy/v4/letter/c/74df32/32.png) [@ContrarianChris](https://awshq.com/u/ContrarianChris)\
**Post date:** [July 11, 2024, 1:43pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/2 "2024-07-11T13:43:44Z")

</div>

AdministratorAccess policy? Really?

---

<div class="post-metadata">

**Author:** ![farski](https://awshq.com/letter_avatar_proxy/v4/letter/f/f07891/32.png) [@farski](https://awshq.com/u/farski)\
**Post date:** [July 11, 2024, 1:45pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/3 "2024-07-11T13:45:18Z")

</div>

This is neat, but seems to be the same as just running `aws cloudformation deploy` on the included CFN template. Is the script doing something beyond that that I’m missing?

---

<div class="post-metadata">

**Author:** ![haqbar](https://awshq.com/letter_avatar_proxy/v4/letter/h/5f9b8f/32.png) [@haqbar](https://awshq.com/u/haqbar)\
**Post date:** [July 11, 2024, 2:00pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/4 "2024-07-11T14:00:14Z")

</div>

> [@ContrarianChris](#):
>
> AdministratorAccess policy? Really?

Makes you wonder what other shortcuts have been taken..

---

<div class="post-metadata">

**Author:** ![pausethelogic](https://awshq.com/letter_avatar_proxy/v4/letter/p/94ad74/32.png) [@pausethelogic](https://awshq.com/u/pausethelogic)\
**Post date:** [July 11, 2024, 2:36pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/5 "2024-07-11T14:36:12Z")

</div>

It’s already one command to authenticate to AWS via OIDC using the official AWS action

---

<div class="post-metadata">

**Author:** ![hoppersoft](https://awshq.com/letter_avatar_proxy/v4/letter/h/3be4f8/32.png) [@hoppersoft](https://awshq.com/u/hoppersoft)\
**Post date:** [July 11, 2024, 2:40pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/6 "2024-07-11T14:40:56Z")

</div>

> [@pausethelogic](#):
>
> It’s already one command to authenticate to AWS via OIDC using the official AWS action

Yeah, but that requires things such as creating the IAM role to assume and adding the necessary actions to your pipeline. He wrote this tool to automate/boilerplate that part.

---

<div class="post-metadata">

**Author:** ![hoppersoft](https://awshq.com/letter_avatar_proxy/v4/letter/h/3be4f8/32.png) [@hoppersoft](https://awshq.com/u/hoppersoft)\
**Post date:** [July 11, 2024, 2:49pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/7 "2024-07-11T14:49:29Z")

</div>

> [@ContrarianChris](#):
>
> AdministratorAccess policy? Really?

As an ex-AWS employee and having written a bunch of tools for developers targeting AWS, let me tell you that least-privileges security is \_complicated\_. Not conceptually, mind you; it’s the process of knowing exactly what permissions you actually need and adding (and removing!) them as those needs change that’s difficult. I will point out that many of AWS’ own examples (and official docs for some services!!) use AdministratorAccess.

This guy’s tool is trying to simplify something that’s quite complex, so, yeah, he threw God Mode at it. The only notes I have for the author is that he should have called that out and explained that it’s in your best interest to learn how to reduce the permissions.

---

<div class="post-metadata">

**Author:** ![hoppersoft](https://awshq.com/letter_avatar_proxy/v4/letter/h/3be4f8/32.png) [@hoppersoft](https://awshq.com/u/hoppersoft)\
**Post date:** [July 11, 2024, 2:54pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/8 "2024-07-11T14:54:03Z")

</div>

> [@farski](#):
>
> This is neat, but seems to be the same as just running `aws cloudformation deploy` on the included CFN template. Is the script doing something beyond that that I’m missing?

He packaged up a few steps and made it spit out the boilerplate for your pipeline so I think there’s some value added, here. But yes, if you already understand the steps needed to set up OICD in GHA, then this may not be something you care much about.

---

<div class="post-metadata">

**Author:** ![cachemonet0x0cf6619](https://awshq.com/letter_avatar_proxy/v4/letter/c/5f9b8f/32.png) [@cachemonet0x0cf6619](https://awshq.com/u/cachemonet0x0cf6619)\
**Post date:** [July 11, 2024, 3:16pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/9 "2024-07-11T15:16:58Z")

</div>

Great tool, thank you for sharing. I have two questions:

1. is the intent to manage all authorized repos in this single repo or do we create this template once per repo?

2. Is the thumbprint necessary: [https://github.com/aws-actions/configure-aws-credentials?tab=readme-ov-file#configuring-iam-to-trust-github](https://github.com/aws-actions/configure-aws-credentials?tab=readme-ov-file#configuring-iam-to-trust-github)

---

<div class="post-metadata">

**Author:** ![demosdemon](https://awshq.com/letter_avatar_proxy/v4/letter/d/e0b2c6/32.png) [@demosdemon](https://awshq.com/u/demosdemon)\
**Post date:** [July 11, 2024, 3:23pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/10 "2024-07-11T15:23:57Z")

</div>

> [@cachemonet0x0cf6619](#):
>
> Great tool, thank you for sharing. I have two questions: 1. is the intent to manage all authorized repos in this single repo or do we create this template once per repo? 2. Is the thumbprint necessary: …

The thumbprint is used by AWS to automatically trust new certificates signed by the same CA.

[https://docs.aws.amazon.com/IAM/latest/UserGuide/id\_roles\_providers\_create\_oidc\_verify-thumbprint.html](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc_verify-thumbprint.html)

---

<div class="post-metadata">

**Author:** ![cachemonet0x0cf6619](https://awshq.com/letter_avatar_proxy/v4/letter/c/5f9b8f/32.png) [@cachemonet0x0cf6619](https://awshq.com/u/cachemonet0x0cf6619)\
**Post date:** [July 11, 2024, 3:25pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/11 "2024-07-11T15:25:49Z")

</div>

> [@demosdemon](#):
>
> The thumbprint is used by AWS to automatically trust new certificates signed by the same CA. [https://docs.aws.amazon.com/IAM/latest/UserGuide/id\_roles\_providers\_create\_oidc\_verify-thumbprint.html](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc_verify-thumbprint.html)

please read the documentation i provided. In most cases what you say is true but a special case is made for AWS.

the posted documents indicate that we can pass any arbitrary thumbprint

---

<div class="post-metadata">

**Author:** ![BeyondLimits99](https://awshq.com/letter_avatar_proxy/v4/letter/b/54ee81/32.png) [@BeyondLimits99](https://awshq.com/u/BeyondLimits99)\
**Post date:** [July 11, 2024, 3:30pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/12 "2024-07-11T15:30:46Z")

</div>

Really love your work with bref.sh /u/mnapoli \<3

---

<div class="post-metadata">

**Author:** ![mnapoli](https://awshq.com/letter_avatar_proxy/v4/letter/m/13edae/32.png) [@mnapoli](https://awshq.com/u/mnapoli)\
**Post date:** [July 11, 2024, 4:28pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/13 "2024-07-11T16:28:31Z")

</div>

> [@pausethelogic](#):
>
> It’s already one command to authenticate to AWS via OIDC using the official AWS action

Mmh it seems like you missed the point of the repository, it’s about creating the role needed for the official OIDC support.

---

<div class="post-metadata">

**Author:** ![mnapoli](https://awshq.com/letter_avatar_proxy/v4/letter/m/13edae/32.png) [@mnapoli](https://awshq.com/u/mnapoli)\
**Post date:** [July 11, 2024, 4:29pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/14 "2024-07-11T16:29:12Z")

</div>

> [@BeyondLimits99](#):
>
> Really love your work with bref.sh /u/mnapoli \<3

❤

---

<div class="post-metadata">

**Author:** ![demosdemon](https://awshq.com/letter_avatar_proxy/v4/letter/d/e0b2c6/32.png) [@demosdemon](https://awshq.com/u/demosdemon)\
**Post date:** [July 11, 2024, 4:30pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/15 "2024-07-11T16:30:48Z")

</div>

> [@cachemonet0x0cf6619](#):
>
> please read the documentation i provided. In most cases what you say is true but a special case is made for AWS. the posted documents indicate that we can pass any arbitrary thumbprint

The documentation says the fingerprint is not used for `token.actions.githubusercontent.com` because it is a Well-Known Provider. But, 1) still required and 2) not a forever guarauntee.

A special case is made for GitHub, not AWS.

---

<div class="post-metadata">

**Author:** ![mnapoli](https://awshq.com/letter_avatar_proxy/v4/letter/m/13edae/32.png) [@mnapoli](https://awshq.com/u/mnapoli)\
**Post date:** [July 11, 2024, 4:32pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/16 "2024-07-11T16:32:08Z")

</div>

> [@farski](#):
>
> This is neat, but seems to be the same as just running `aws cloudformation deploy` on the included CFN template. Is the script doing something beyond that that I’m missing?

That’s a good point, it’s mostly about DX and hiding the complexity for non-AWS experts. Here’s the CLI output for example, it guides you on setting up GitHub Actions with the right values:

The org/repo GitHub repository will be authorized to access AWS account 123456789 in us-east-1.  
This will be done by deploying an IAM role using CloudFormation (stack name: “github-deploy-org-repo”) using the xxxx profile.

```
Do you want to continue? y

✔ Role deployed

Role ARN: arn:aws:iam::123456789:role/github-deploy-org-repo

You can now add these lines to your GitHub Actions file (for example .github/workflows/deploy.yml):

permissions:
    id-token: write # This is required for requesting the JWT
    contents: read # This is required for actions/checkout
jobs:
    deploy:
        steps:
            # ...
            - name: Configure AWS credentials
                uses: aws-actions/configure-aws-credentials@v4
                with:
                    role-to-assume: arn:aws:iam::123456789:role/github-deploy-org-repo
                    role-session-name: github-deploy
                    aws-region: us-east-1

```

---

<div class="post-metadata">

**Author:** ![mnapoli](https://awshq.com/letter_avatar_proxy/v4/letter/m/13edae/32.png) [@mnapoli](https://awshq.com/u/mnapoli)\
**Post date:** [July 11, 2024, 4:36pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/17 "2024-07-11T16:36:56Z")

</div>

> [@ContrarianChris](#):
>
> AdministratorAccess policy? Really?

Yeah good point! I found it really frustrating to setup OIDC on many repositories so I wanted to simplify the experience. It can 100% be improved (especially adminaccess…), but I wanted to share what I had instead of waiting (forever) for it to be perfect. Now it’s in the open and open to contributions.

Especially since it’s really hard to come up with good permissions. But /u/hoppersoft makes a very good point about adding a big fat warning to the README, I’ll do that now 👍

---

<div class="post-metadata">

**Author:** ![cachemonet0x0cf6619](https://awshq.com/letter_avatar_proxy/v4/letter/c/5f9b8f/32.png) [@cachemonet0x0cf6619](https://awshq.com/u/cachemonet0x0cf6619)\
**Post date:** [July 11, 2024, 4:53pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/18 "2024-07-11T16:53:38Z")

</div>

> [@demosdemon](#):
>
> The documentation says the fingerprint is not used for `token.actions.githubusercontent.com` because it is a Well-Known Provider. But, 1) still required and 2) not a forever guarauntee. A special case is made for …

thanks for the clarification

---

<div class="post-metadata">

**Author:** ![hatchetation](https://awshq.com/letter_avatar_proxy/v4/letter/h/cdc98d/32.png) [@hatchetation](https://awshq.com/u/hatchetation)\
**Post date:** [July 11, 2024, 7:04pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/19 "2024-07-11T19:04:24Z")

</div>

> [@hoppersoft](#):
>
> As an ex-AWS employee and having written a bunch of tools for developers targeting AWS, let me tell you that least-privileges security is \_complicated\_. Not conceptually, mind you; it’s the process of knowing exactly …

As an example of how difficult least-privilege can be, a year or so ago the CDK team gave up on constraining the permissions for CDK’s default lookup role, and just threw ReadOnly at it.

---

<div class="post-metadata">

**Author:** ![water\_bottle\_goggles](https://awshq.com/letter_avatar_proxy/v4/letter/w/8e7dd6/32.png) [@water\_bottle\_goggles](https://awshq.com/u/water_bottle_goggles)\
**Post date:** [July 11, 2024, 7:48pm UTC](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674/20 "2024-07-11T19:48:18Z")

</div>

> [@mnapoli](#):
>
> Yeah good point! I found it really frustrating to setup OIDC on many repositories so I wanted to simplify the experience. It can 100% be improved (especially adminaccess…), but I wanted to share what I had instead of …

Bro fuck the haters yo, you did something good here

[Next page](https://awshq.com/t/github-one-command-to-authorize-github-actions-to-deploy-to-aws/18674.md?page=2)
