From 43143bff1ed8be49fc5fe696f9863b04441e281e Mon Sep 17 00:00:00 2001 From: ljacobsson Date: Fri, 5 Mar 2021 15:04:14 +0100 Subject: [PATCH] Fixes + more readme --- README.md | 11 ++++++++++- package.json | 2 +- src/commands/extract.js | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3dcfdc2..b6f571f 100644 --- a/README.md +++ b/README.md @@ -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** \ No newline at end of file +**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----`. 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 \ No newline at end of file diff --git a/package.json b/package.json index adc7417..c3a968a 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/commands/extract.js b/src/commands/extract.js index e783769..299e1d2 100644 --- a/src/commands/extract.js +++ b/src/commands/extract.js @@ -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); }