{"id":16293540,"url":"https://github.com/badsyntax/github-action-aws-cloudformation","last_synced_at":"2025-03-20T03:31:08.678Z","repository":{"id":37073560,"uuid":"437105979","full_name":"badsyntax/github-action-aws-cloudformation","owner":"badsyntax","description":"GitHub Action to create/update your CloudFormation stack","archived":false,"fork":false,"pushed_at":"2023-05-11T21:00:46.000Z","size":3200,"stargazers_count":7,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T22:55:06.626Z","etag":null,"topics":["aws","aws-cloudformation","cloudformation","github-actions"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/aws-cloudformation-update","language":"TypeScript","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/badsyntax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-10T20:30:10.000Z","updated_at":"2023-04-19T18:32:32.000Z","dependencies_parsed_at":"2024-10-27T21:44:37.359Z","dependency_job_id":"bbfa56b4-f892-48d4-8654-0eb2afba4aa2","html_url":"https://github.com/badsyntax/github-action-aws-cloudformation","commit_stats":{"total_commits":67,"total_committers":2,"mean_commits":33.5,"dds":"0.35820895522388063","last_synced_commit":"ec2119b1b58a34bdc5a9d731c9c56051447c04e4"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Fgithub-action-aws-cloudformation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Fgithub-action-aws-cloudformation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Fgithub-action-aws-cloudformation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Fgithub-action-aws-cloudformation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badsyntax","download_url":"https://codeload.github.com/badsyntax/github-action-aws-cloudformation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244047647,"owners_count":20389206,"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","aws-cloudformation","cloudformation","github-actions"],"created_at":"2024-10-10T20:11:40.998Z","updated_at":"2025-03-20T03:31:08.004Z","avatar_url":"https://github.com/badsyntax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS CloudFormation GitHub Action\n\n[![Build, Test \u0026 Deploy](https://github.com/badsyntax/github-action-aws-cloudformation/actions/workflows/test-build-deploy.yml/badge.svg?branch=master)](https://github.com/badsyntax/github-action-aws-cloudformation/actions/workflows/test-build-deploy.yml)\n[![CodeQL](https://github.com/badsyntax/github-action-aws-cloudformation/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/badsyntax/github-action-aws-cloudformation/actions/workflows/codeql-analysis.yml)\n\nA GitHub Action to create/update your CloudFormation stack to support Infrastructure as Code.\n\n## Motivation\n\nThe [official CloudFormation action](https://github.com/aws-actions/aws-cloudformation-github-deploy) is archived with no explanation why.\n\nThis Action is actively maintained and includes additional features.\n\n## Features\n\n- Apply or Preview ChangeSet with Pull Request comments\n- Log intervals to show constant feedback\n- CloudFormation outputs set as Action Outputs (which can be used in subsequent steps)\n- Template validation\n\n## Getting Started\n\nPlease read \u003chttps://github.com/aws-actions/configure-aws-credentials#credentials\u003e\n\n```yaml\nname: 'deploy'\n\nconcurrency:\n  group: prod_deploy\n  cancel-in-progress: false\n\non:\n  repository_dispatch:\n  pull_request:\n  push:\n    branches:\n      - main\n      - 'releases/*'\n\njobs:\n  deploy-stack:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v1\n        with:\n          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          aws-region: us-east-1\n\n      - name: Update CloudFormation Stack\n        id: update-stack\n        uses: badsyntax/github-action-aws-cloudformation@master\n        with:\n          stack-name: 'example-cloudformation-stack'\n          template: './cloudformation/s3bucket-example.yml'\n          # Only apply the changeset on pushes to main/release\n          apply-change-set: ${{ github.event_name != 'pull_request' \u0026\u0026 github.event_name != 'repository_dispatch' }}\n          aws-region: 'us-east-1'\n          parameters: 'S3BucketName=example-bucket-us-east-1\u0026S3AllowedOrigins=https://example.com'\n\n      - name: Deploy Website\n        run: |\n          # Now that the stack is created we can deploy our\n          # website to the S3 bucket.\n          echo \"Deploy to S3 Bucket: $S3BucketName\"\n        env:\n          # Use outputs from the CloudFormation Stack\n          S3BucketName: ${{ steps.update-stack.outputs.S3BucketName }}\n```\n\n## Action Inputs\n\n| key                       | description                                                                                                                                                                                                                                         | example                                         |\n| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |\n| `stack-name`              | The name of the Cloudformation stack to be created                                                                                                                                                                                                  | `example-com-static-cloudformation-stack`       |\n| `template`                | The relative path to the CloudFormation stack template                                                                                                                                                                                              | `./cloudformation/s3bucket_with_cloudfront.yml` |\n| `aws-region`              | The AWS region in which to create the stack                                                                                                                                                                                                         | `us-east-1`                                     |\n| `parameters` (optional)   | The parameters to override in the stack inputs, in query string format. Whitespace will be stripped                                                                                                                                                 | `Param1=foo\u0026Param2=http://example.com`          |\n| `apply-change-set`        | Whether to apply the ChangeSet, or provide a summary of the ChangeSet                                                                                                                                                                               | `true`                                          |\n| `capabilities` (optional) | A comma-delimited list of stack template [capabilities](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cloudformation/interfaces/createchangesetcommandinput.html#capabilities) to acknowledge. Defaults to `CAPABILITY_IAM` | `CAPABILITY_IAM`                                |\n\n## Action Outputs\n\n| Name              | Description                                                                                                                                             | Example                                                                                  |\n| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |\n| `[cf-output-key]` | Outputs correspond to the CloudFormation outputs. For example if you've set an output to be `S3BucketName` then this key will exist as an Action output | `anything, depending on the CF output definition`                                        |\n| `outputs`         | JSON string array of CloudFormation outputs                                                                                                             | `[{\"OutputKey\":\"S3BucketName\",\"OutputValue\":\"bucket-name\",\"Description\":\"Bucket name\"}]` |\n| `changes`         | JSON string array of CloudFormation changes                                                                                                             | `[{\"OutputKey\":\"S3BucketName\",\"OutputValue\":\"bucket-name\",\"Description\":\"Bucket name\"}]` |\n\n## Pull Request Comments\n\nFirst you need to define the comment template. Download [pr-comment-template.hbs](https://github.com/badsyntax/github-action-aws-cloudformation/blob/master/.github/pr-comment-template.hbs) to your repo and update as appropriate.\n\nNext add the [badsyntax/github-action-issue-comment](https://github.com/badsyntax/github-action-issue-comment) action to create Pull Request comments with an overview of the CloudFormation changes and outputs.\n\n```yaml\nname: 'deploy'\n\nconcurrency:\n  group: prod_deploy\n  cancel-in-progress: false\n\non:\n  repository_dispatch:\n  pull_request:\n  push:\n    branches:\n      - main\n      - 'releases/*'\n\njobs:\n  deploy-stack:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v1\n        with:\n          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          aws-region: us-east-1\n\n      - name: Update CloudFormation Stack\n        id: update-stack\n        uses: badsyntax/github-action-aws-cloudformation@master\n        with:\n          stack-name: 'example-cloudformation-stack'\n          template: './cloudformation/s3bucket-example.yml'\n          # Only apply the changeset on pushes to main/release\n          apply-change-set: ${{ github.event_name != 'pull_request' \u0026\u0026 github.event_name != 'repository_dispatch' }}\n          aws-region: 'us-east-1'\n          parameters: 'S3BucketName=example-bucket-us-east-1\u0026S3AllowedOrigins=https://example.com'\n\n      - uses: badsyntax/github-action-issue-comment@master\n        name: Comment on Pull Request\n        if: github.event_name == 'pull_request'\n        with:\n          action: 'create-clean'\n          template: '.github/pr-comment-template.hbs'\n          id: cloudformation\n          token: ${{ secrets.GITHUB_TOKEN }}\n          issue-number: ${{ github.event.pull_request.number }}\n          template-inputs: |\n            {\n              \"changes\": ${{ steps.update-stack.outputs.changes }},\n              \"outputs\": ${{ steps.update-stack.outputs.outputs }},\n              \"applyChangeSet\": ${{ github.event_name != 'pull_request' \u0026\u0026 github.event_name != 'repository_dispatch' }}\n            }\n\n      - name: Deploy Website\n        run: |\n          # Now that the stack is created we can deploy our\n          # website to the S3 bucket.\n          echo \"Deploy to S3 Bucket: $S3BucketName\"\n        env:\n          # Use outputs from the CloudFormation Stack\n          S3BucketName: ${{ steps.update-stack.outputs.S3BucketName }}\n```\n\n### ScreenShots\n\nPull request created and `apply-change-set` is `false`:\n\n\u003cimg src=\"./images/changeset-changes-comment.png\" style=\"max-width: 700px\" alt=\"Pull Request Comment\" /\u003e\n\nPull request created and `apply-change-set` is `true`:\n\n\u003cimg src=\"./images/changeset-apply-comment.png\" style=\"max-width: 700px\" alt=\"Pull Request Comment\" /\u003e\n\nNo stack changes:\n\n\u003cimg src=\"./images/changeset-no-changes.png\" style=\"max-width: 700px\" alt=\"Pull Request Comment\" /\u003e\n\n## Related Projects\n\n- [badsyntax/github-action-aws-cloudfront](https://github.com/badsyntax/github-action-aws-cloudfront)\n- [badsyntax/github-action-aws-s3](https://github.com/badsyntax/github-action-aws-s3)\n- [badsyntax/github-action-issue-comment](https://github.com/badsyntax/github-action-issue-comment)\n- [badsyntax/github-action-render-template](https://github.com/badsyntax/github-action-render-template)\n\n## Debugging\n\nCheck the Action output for logs.\n\nIf you need to see more verbose logs you can set `ACTIONS_STEP_DEBUG` to `true` as an Action Secret.\n\n## Support\n\n- 👉 [Submit a bug report](https://github.com/badsyntax/github-action-aws-cloudformation/issues/new?assignees=badsyntax\u0026labels=bug\u0026template=bug_report.md\u0026title=)\n- 👉 [Submit a feature request](https://github.com/badsyntax/github-action-aws-cloudformation/issues/new?assignees=badsyntax\u0026labels=enhancement\u0026template=feature_request.md\u0026title=)\n\n## License\n\nSee [LICENSE.md](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadsyntax%2Fgithub-action-aws-cloudformation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadsyntax%2Fgithub-action-aws-cloudformation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadsyntax%2Fgithub-action-aws-cloudformation/lists"}