Skip to content

Commit

Permalink
Fixes + more readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacobsson committed Mar 5, 2021
1 parent 1f77634 commit 43143bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@

Extract a subset of a CloudFromation template for quick deployments for i.e integration testing in a parallel stack

**This is a PoC and is very much work in progress**
**This is work in progress and may contain bugs**

![flow](images/flow.gif)

### Usage

When working on large CloudFormation templates it's likely that you will only be interested in a small subset of resources. This tool will extract these into a smaller deployable template which you can work on and, when happy, merge back in to the main template.

### SAM integration
If your project has a samconfig.toml file, a copy of that will be created with the stack_name parameter chnaged to `sub--<stackname>-<random adjective>-<random noun>`. This is so you can deploy your substack alongside the original stack without interfering with what's already deployed. A prerequisite is that you don't implicitly name any resources as there will be naming clash
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mhlabs/cfn-subset",
"version": "0.0.4",
"version": "0.0.5",
"description": "Extract a subset of a CloudFormation template for quick deploys when integration testing parallel stacks",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ program
let tomlFile = fs.readFileSync("samconfig.toml").toString();
tomlFile = tomlFile.replace(
/stack_name = "(.+?)"/g,
'stack_name = "sub_$1_' + sentencer.make("{{ adjective }}-{{ noun }}") +'"'
'stack_name = "sub--$1-' + sentencer.make("{{ adjective }}-{{ noun }}") +'"'
);
fs.writeFileSync("samconfig.sub.toml", tomlFile);
}
Expand Down

0 comments on commit 43143bf

Please sign in to comment.