{"id":18400927,"url":"https://github.com/magicmark/cf-merge","last_synced_at":"2025-04-12T16:59:28.972Z","repository":{"id":69481307,"uuid":"240670547","full_name":"magicmark/cf-merge","owner":"magicmark","description":"💥A tool to split up \u0026 merge CloudFormation templates together with import syntax","archived":false,"fork":false,"pushed_at":"2020-02-16T22:49:59.000Z","size":45,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T03:24:48.305Z","etag":null,"topics":[],"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/magicmark.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":"2020-02-15T08:32:04.000Z","updated_at":"2021-05-10T21:55:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc23b77f-4662-406e-9688-e81cfd1d40d5","html_url":"https://github.com/magicmark/cf-merge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicmark%2Fcf-merge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicmark%2Fcf-merge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicmark%2Fcf-merge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicmark%2Fcf-merge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magicmark","download_url":"https://codeload.github.com/magicmark/cf-merge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248602233,"owners_count":21131613,"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":[],"created_at":"2024-11-06T02:37:16.859Z","updated_at":"2025-04-12T16:59:28.953Z","avatar_url":"https://github.com/magicmark.png","language":"JavaScript","readme":"# 💥 cf-merge\n\ncf-merge brings import syntax to [CloudFormation templates](https://aws.amazon.com/cloudformation/). Split up and modularize your stacks!\n\n## Example\n\nUse top-level imports to merge in other templates:\n\n```yaml\n# @import ./networking.yml\n# @import ./security.yml\n\nAWSTemplateFormatVersion: 2010-09-09\nParameters:\n    - foo\nResources:\n    - bar\n```\n\nUse inline imports to merge in sections of other templates:\n\n```yaml\nAWSTemplateFormatVersion: 2010-09-09\nParameters:\n    - foo\n    # @import ./ec2_instances.yml#Parameters\nResources:\n    - bar\n    # @import ./ec2_instances.yml#Resources\n```\n\n[See the tests](./tests/test.js) to see examples of this in action.\n\n## Usage\n\ncf-merge is distributed as a nodejs package. You can install it via npm or yarn:\n\n```sh\nyarn add @magicmark/cf-merge\n```\n\nYou can then call `cf-merge` in your bash script when calling `aws cloudformation deploy`:\n\n```sh\naws cloudformation deploy \\\n  --region $REGION \\\n  --profile $CLI_PROFILE \\\n  --stack-name $STACK_NAME \\\n  --template-file \"$(yarn cf-merge main.yml --tmpfile)\" \\\n```\n\n### CLI API Docs\n\n```\ncf-merge \u003cfile\u003e\n\nPositionals:\n  file  path to a CloudFormation template file                          [string]\n\nOptions:\n  --version      Show version number                                   [boolean]\n  --help         Show help                                             [boolean]\n  --path, -p     output file path (will print output to stdout if not specified)\n                                                                        [string]\n  --tmpfile, -t  print template to a tmpfile. prints the filepath to stdout.\n                                                      [boolean] [default: false]\n```\n\n## FAQs\n\n#### Why not use [nested stacks](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html)?\n\ncf-merge runs \"outside\" of CloudFormation, so it lets you arbitrarily import whole sections of yaml from other templates on disk.\n\n#### Why not use \\\u003cinsert some other tool here\u003e?\n\nI googled and didn't find any other lightweight solutions that that did this. But maybe I missed something! I figure if it does exist, the best way to find out is to publish this and have people let me know about it :)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicmark%2Fcf-merge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagicmark%2Fcf-merge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicmark%2Fcf-merge/lists"}