---
title: "Discussion on \"Securely Access Your AWS Resources From Github Actions\" | Hashnode"
description: "Discussion on \"Securely Access Your AWS Resources From Github Actions\". Learn how to generate short-lived credentials to access your AWS account from Github Action workflows"
url: "https://hashnode.com/posts/securely-access-your-aws-resources-from-github-actions/61c9d8021de80a7fb22807d0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Securely Access Your AWS Resources From Github Actions](https://benoitboure.com/securely-access-your-aws-resources-from-github-actions?utm_source=hashnode&utm_medium=feed)

Learn how to generate short-lived credentials to access your AWS account from Github Action workflows

Dec 27, 2021 · 6 min read · benoitboure.com  
Updated Jan 13, 2022  
Read the article

-   [#aws](https://hashnode.com/tag/aws)
-   [#github](https://hashnode.com/tag/github)
-   [#github-actions-1](https://hashnode.com/tag/github-actions-1)
-   [#security](https://hashnode.com/tag/security)
-   [#ci-cd](https://hashnode.com/tag/ci-cd)

## Written by

[Benoît Bouré](https://hashnode.com/@bboure)

@bboure · Remote

  
[View profile](https://hashnode.com/@bboure)

Software developer

👨‍💻 Sofware Engineer · 💬 Consultant · 🚀 Indie Maker · ⚡️ Serverless 🔧 serverless-appsync-plugin · serverless-appsync-simulator · middy-appsync 🐈 and 🍵

## Responses 7

Markdown supported · ⌘↵ to post

[Chase Denecke](https://hashnode.com/@peppermintdeveloper)

[Jan 15, 2023](https://hashnode.com/posts/securely-access-your-aws-resources-from-github-actions/61c9d8021de80a7fb22807d0/comment/63c47f9fd72a4e43689db0d5)

It would be nice if you could give a full example main.yml file for deploying via github actions. I spent about half an hour trying to properly indent and organize the various permissions. This is partly because I am dumb, but I bet other dumb people will read this too and also be confused.

[Benoît Bouré](https://hashnode.com/@bboure)

[Jan 16, 2023](https://hashnode.com/posts/securely-access-your-aws-resources-from-github-actions/61c9d8021de80a7fb22807d0/comment/63c47f9fd72a4e43689db0d5#reply-63c53254dbe7ab4342a07c2d)

Thank you for your feedback. I'll try to update the articles and include a full example.

[Kamil](https://hashnode.com/@Kmeal)

[Nov 10, 2022](https://hashnode.com/posts/securely-access-your-aws-resources-from-github-actions/61c9d8021de80a7fb22807d0/comment/636d88154597d909de581aba)

I don't have much experience with CI/CD tools. I work as a software developer and fortunately I haven't had to take care about this devops stuff. I wasn't aware about this OIDC flow and we stored everything in sectet storage. Today I'm running my startup project and I have chosen Github Actions altogether with AWS S3 to host my static web app. This instruction took a few minutes and went without problems. Thank you for explaining this topic in human-readable format. Good job!

[Steve Haney](https://hashnode.com/@steveh)

[Aug 12, 2022](https://hashnode.com/posts/securely-access-your-aws-resources-from-github-actions/61c9d8021de80a7fb22807d0/comment/62f6976269fa1793160c0a8d)

Thanks for this article. So is it truly just the ARN of the Role and the repo name(s) on that Role in AWS that control the security/access b/w the Git Repo and Git Actions ability to generate operations in AWS as that role? I feel like I'm missing some other key or secret. The thumbprint seems like it has to be that specific value due to the 2022 certificate chain issue so thats not unique or a secret. Thanks!

[Benoît Bouré](https://hashnode.com/@bboure)

[Sep 22, 2022](https://hashnode.com/posts/securely-access-your-aws-resources-from-github-actions/61c9d8021de80a7fb22807d0/comment/62f6976269fa1793160c0a8d#reply-632c530e318ff0fa18337468)

Yes. From your AWS account (the "safe" side), you allow GithubActions jobs to assume the given role. For that, you add an identity provider (Github Actions is the id provider) and you allow GA "users" to assume a role.

When a job runs, it uses the ID provider to "authenticate", and assume the role.

It works like "login with Twitter", except it's with Github Actions. The job already has a GA token. It uses it to "log into AWS" and assume the role.

The key part is really `token.actions.githubusercontent.com:sub`. Without that, _ANY_ repo on GitHub would be able to authenticate and assume the role.\*\*

[John Grisham](https://hashnode.com/@NotTheAuthor)

[Apr 5, 2022](https://hashnode.com/posts/securely-access-your-aws-resources-from-github-actions/61c9d8021de80a7fb22807d0/comment/624c906324471c433062c23c)

This is awesome! Thanks for the guide!

[Kevin Mahoney](https://hashnode.com/@kevcube)

[Apr 4, 2022](https://hashnode.com/posts/securely-access-your-aws-resources-from-github-actions/61c9d8021de80a7fb22807d0/comment/624b29f24b4dde0dc0beb004)

This is awesome! Thanks! I'm going to now look if there's an open-source terraform module that sets up the IdP, and if not I might have to write one..

[Reza Maghami](https://hashnode.com/@RezMag)

[Mar 24, 2022](https://hashnode.com/posts/securely-access-your-aws-resources-from-github-actions/61c9d8021de80a7fb22807d0/comment/623be0b07753c274c2ab6155)

If Github action workflow had an entry like aws\_session\_token it would meet my expectations of how to set up a Github action to deploy to our production environment. I like to open a window, using STS, to allow deployment to prod. I want it to be short term so I like to enter temporary credentials in Github settings to open a window for deployment. Using an assumed role is secure but it is an open window which does not suit our current situation.

[Jannik Wempe](https://hashnode.com/@JannikWempe)

[Jan 20, 2022](https://hashnode.com/posts/securely-access-your-aws-resources-from-github-actions/61c9d8021de80a7fb22807d0/comment/61e8f3756f4d6f431978fd65)

Great post, Ben. Thanks! 🙏🏼 I think this is very relevant for a lot of people (including myself).

... and I also learned about quick-create links in CloudFormation.
