{"id":20625485,"url":"https://github.com/spirius/clon","last_synced_at":"2025-12-08T07:02:37.777Z","repository":{"id":64304147,"uuid":"153013084","full_name":"spirius/clon","owner":"spirius","description":"clon - a tool for managing AWS CloudFormation stacks","archived":false,"fork":false,"pushed_at":"2018-12-17T13:25:27.000Z","size":1840,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T06:09:13.478Z","etag":null,"topics":["automation","aws-cloudformation","ci-cd","cloudformation","golang","stack-management"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spirius.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}},"created_at":"2018-10-14T19:54:33.000Z","updated_at":"2019-11-16T13:00:31.000Z","dependencies_parsed_at":"2023-01-15T10:15:53.643Z","dependency_job_id":null,"html_url":"https://github.com/spirius/clon","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spirius%2Fclon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spirius%2Fclon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spirius%2Fclon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spirius%2Fclon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spirius","download_url":"https://codeload.github.com/spirius/clon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242394442,"owners_count":20120941,"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":["automation","aws-cloudformation","ci-cd","cloudformation","golang","stack-management"],"created_at":"2024-11-16T13:09:44.328Z","updated_at":"2025-12-08T07:02:32.745Z","avatar_url":"https://github.com/spirius.png","language":"Go","readme":"**clon** (**cl**oudformati**on**) is a AWS CloudFormation template and stack management tool.\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/spirius/clon)](https://goreportcard.com/report/github.com/spirius/clon)\n[![Build Status](https://travis-ci.com/spirius/clon.svg?branch=master)](https://travis-ci.com/spirius/clon)\n\n# Table of conent\n\n- [Overview](#overview)\n- [Concepts](#concepts)\n  * [Config](#config)\n  * [Bootstrap Stack](#bootstrap-stack)\n  * [Files](#files)\n  * [Variables](#variables)\n  * [Template Rendering](#template-rendering)\n  * [Strong and week Dependencies](#strong-and-week-dependencies)\n- [Installing](#installing)\n- [Usage](#usage)\n- [Examples](#examples)\n\n# Overview\nclon is a AWS CloudFormation stack management and deployment tool. Multiple stacks and cross-dependencies can be managed from single place.\n\n# Concepts\n\n## Config\nThe list of stacks and their dependencies are defined in config file (default: config.yml).\n\nThe configuration syntax is following\n\n**Top level config options**\n\n`Name` - **required** - _(string)_ \u003cbr\u003e\nName of the deployment. This value is used as a prefix for all stack names.\n\n`AccountID` -  _(string)_ \u003cbr\u003e\nclon will make sure that current AWS account is matching to `AccountID`.\n\n`Bootstrap` - **required** - _(Stack)_ \u003cbr\u003e\nThe bootstrap stack configuration.\n\n`Files` - _(map[string]File)_ \u003cbr\u003e\nMap of files to upload. After files are uploaded (or syned), the information about file is exposed to template rendering.\n\n\n`Stacks` - _(list[Stack])_ \u003cbr\u003e\nList of stacks managed by clon.\n\n`Variables` - _(map[string]string)_ \u003cbr\u003e\nMap of variables. Varables are available in template rendering.\n\n\n**Stack**\n\n* `Name` - **required** \u003cbr\u003e\n  The name of the stack.\n* `Capabilities` - _(list[string])_ \u003cbr\u003e\n  List of stack capabilities. Allowed values are `CAPABILITY_IAM` and `CAPABILITY_NAMED_IAM`\n* `Template` - **required** - _(String)_ \u003cbr\u003e\n  Location of template file\n* `RoleARN` - _(String)_ \u003cbr\u003e\n  Location of template file\n* `Parameters` - _(map[String]String)_ \u003cbr\u003e\n  Map of stack parameters\n* `Tags` - _(map[String]String)_ \u003cbr\u003e\n  Map of stack tags\n\n**File**\n\n* `Src` - **required** - _(String)_\u003cbr\u003e\n  Path of the template file.\n* `Bucket` - _(String)_ - \n   _defaults to_: `bootstrap.Outpus.Bucket`\u003cbr\u003e\n   Destination S3 bucket name.\n* `Key` - _(String)_\u003cbr\u003e\n   _defaults to_: _name of the file_\u003cbr\u003e\n   S3 bucket key.\n\n\n## Bootstrap Stack\nBootstrap stack is a special stack, which is used to prepare AWS environment for cloudformation deployment.\nThis template usually includes some S3 buckets for intermediate file storage and IAM roles and policies for cloudformation stacks.\n\nThis stack **must** contain `Bucket` output, which holds the name of that bucket for temporary storage.\n\n### Example of Bootstrap\n\u003ca href=\"https://asciinema.org/a/H7xdtZRFvRSV6XQMjk21fN9TY?cols=400\" target=\"_blank\"\u003e\u003cimg src=\"https://asciinema.org/a/H7xdtZRFvRSV6XQMjk21fN9TY.png\" width=\"600\"/\u003e\u003c/a\u003e\n\n## Files\nFiles are synced to Dst S3 buckets and location information is available in templates. Files are exposed to template as following structure: \n\n```yaml\nFile:\n  $MapKey:\n    Bucket:       # Name of the bucket\n    Key:          # Key of the file in bucket\n    VersionID:    # Version ID of file\n    Hash:         # MD5 hash of file\n    ContentType:  # Content-type of file (optional)\n    Region:       # Region of the bucket\n    URL:          # URL to file. Can be used for nested-stacks.\n```\n\n### Example of Files\n\n## Variables\nVariables is simple map[string]string structure. They are exposed to templates as following structures:\n\n```yaml\nVar:\n  $MapKey: $Value\n```\n\n## Template Rendering\n`RoleARN`, `Parameters` and `Tags` attributes of stack configuration are rendered using [golang templating](https://golang.org/pkg/text/template/#hdr-Actions) with [sprig](http://masterminds.github.io/sprig/) support.\n\nclon also adds following functions to rendering engine\n\n**file** - read content of file.\n\nExample: `{{ file \"path.txt\" }}`\n\n**stack** - get stack data. Note, that target stack must be deployed before stack data can be used.\n\nExample:\n`{{ (stack \"bootstrap\").Outputs.Bucket }}`\n\n\n## Strong and week Dependencies\nThere are many ways of creating dependency between two stacks, but overall they can be categorized as strong and week dependencies.\n\n### Strong\nStrong dependencies are Nested stack dependencies or dependencies created by `Export` output attribute.\n\n**Nested Stacks**\n\nNested stack dependencies are easy to manage, because CloudFormation will take care for update propagation. But they don't support planning, so it's impossible to identify exactly which resources in nested stacks will be affected.\n\n**Export**\n\nExported outpus can be imported by other stacks. This means, that those can be trated as separate stacks and change plan can be built. But exported outpus cannot be modified, until there is any dependent stack exists. So, in order to update exported output, one should first remove all dependencies, update relevant resources and create dependencies again. This process includes many manual steps and not easy to automate.\n\n### Weak dependencies\nIn order to laverage from both features, change planning and automatic updates (if possible), weak reference can be used. The idea behind, is to store the output of one stack in some intermediate storage (like S3 bucket or directly via clon) and update the dependent stack separately with new value.\n\nNote, that this kind of dependency can be created only if dependent resource will not be affected by temporary outdated value.\n\n### Example of weak dependency with clon\n\n\n# Installation\n\nGet it installed with golang\n\n```\ngo get github.com/spirius/clon/cmd/clon\n```\n\nOr download from [releases](https://github.com/spirius/clon/releases/latest) page.\n\n# Usage\n\n```\nclon is a CLoudFormatiON stack management tool\n\nUsage:\n  clon [command]\n\nAvailable Commands:\n  deploy      Deploy stack\n  destroy     Destroy stack\n  execute     Execute previously planned change\n  help        Help about any command\n  init        Initialize bootstrap stack\n  list        List stacks\n  plan        Plan stack changes\n  status      Show stack status\n  version     show version information\n\nFlags:\n  -c, --config string            Config file (default \"config.yml\")\n  -e, --config-override string   Override config file\n  -d, --debug                    Enable debug mode\n  -h, --help                     help for clon\n  -i, --input                    User input availability. If not specified, value is identified from terminal. (default true)\n  -t, --trace                    Enable error tracing output\n\nUse \"clon [command] --help\" for more information about a command.\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspirius%2Fclon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspirius%2Fclon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspirius%2Fclon/lists"}