{"id":15529360,"url":"https://github.com/mnapoli/github-to-aws","last_synced_at":"2025-04-16T02:54:47.127Z","repository":{"id":219628937,"uuid":"749501708","full_name":"mnapoli/github-to-aws","owner":"mnapoli","description":"Set up GitHub Actions to deploy to AWS","archived":false,"fork":false,"pushed_at":"2024-07-11T16:38:49.000Z","size":10,"stargazers_count":80,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T04:31:40.090Z","etag":null,"topics":["aws","github-actions"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnapoli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-28T19:00:55.000Z","updated_at":"2025-01-20T18:20:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba228459-c040-4df6-9800-2516b566a1d9","html_url":"https://github.com/mnapoli/github-to-aws","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"26bd3a0abf4419fa9ab20d7112505a9a6cf9fea2"},"previous_names":["mnapoli/github-to-aws"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnapoli%2Fgithub-to-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnapoli%2Fgithub-to-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnapoli%2Fgithub-to-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnapoli%2Fgithub-to-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnapoli","download_url":"https://codeload.github.com/mnapoli/github-to-aws/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249187738,"owners_count":21226967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","github-actions"],"created_at":"2024-10-02T11:17:27.731Z","updated_at":"2025-04-16T02:54:47.068Z","avatar_url":"https://github.com/mnapoli.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Set up GitHub Actions to deploy to AWS\n\nTo deploy to AWS from GitHub Actions (using _any_ tool), you need to provide AWS credentials.\n\nInstead of creating AWS access keys, it's simpler and more secure to use [OpenID Connect between GitHub and AWS](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services). This is a simple way to say \"Repository X is allowed to deploy to AWS account Y\".\n\nGreat! But setting this up is a bit of a pain.\n\nThis CLI makes it extremely easy:\n\n```sh\nnpx github-to-aws --repo=your-org/your-repo\n```\n\nThe command above will allow the GitHub Actions in `your-org/your-repo` to deploy to AWS in the default region.\n\n\u003e [!TIP]\n\u003e The CLI will ask you to confirm everything before making any changes, so feel free to run the command and see.\n\n## How it works\n\nThe CLI will create an IAM role in your AWS account that GitHub Actions will be authorized to assume. The role will be created using CloudFormation (you can review the template in the [`cloudformation.yml` file](./cloudformation.yml)).\n\nNote that **only** GitHub Actions from the specified repository will be able to assume this role.\n\n\u003e [!Note]\n\u003e GitHub Actions will be granted the AdministratorAccess role (because it's nearly impossible to design tight permissions that fit everyone's use case). Feel free to fork and adjust the permissions to your liking (or even better, send a pull request to make them configurable).\n\n## Usage in GitHub Actions\n\nOnce the CLI has created the role, it will show you the role ARN to use.\n\nYou can then use the `aws-actions/configure-aws-credentials` action to configure AWS credentials. For example:\n\n```yaml\nname: Deploy\non:\n    push:\n        branches: [ 'main' ]\n# Necessary to deploy to AWS using OIDC\n# https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services\npermissions:\n    id-token: write # This is required for requesting the JWT\n    contents: read  # This is required for actions/checkout\njobs:\n    deploy:\n        runs-on: ubuntu-22.04\n        concurrency: production_environment # Avoid deploying concurrently\n        steps:\n            -   uses: actions/checkout@v4\n            # ...\n            -   name: Configure AWS credentials\n                uses: aws-actions/configure-aws-credentials@v4\n                with:\n                    # REPLACE WITH THE OUTPUT OF THE CLI\n                    role-to-assume: arn:aws:iam::123456789:role/GitHubDeploymentRole\n                    role-session-name: github-deployment\n                    aws-region: us-east-1\n            # now you can use the AWS CLI or any other tool to deploy to AWS\n            # ...\n```\n\n## Options\n\nYou can specify an AWS profile and a region:\n\n```sh\nnpx github-to-aws --profile=bref-cloud --region=us-east-1 --repo=your-org/your-repo\n```\n\n## Deletion\n\nTo delete the role (and the related GitHub access), delete the CloudFormation stack, for example in the AWS console.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnapoli%2Fgithub-to-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnapoli%2Fgithub-to-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnapoli%2Fgithub-to-aws/lists"}