Skip to content

Commit

Permalink
Merge pull request #33 from globaldatanet/bugfix/fixdiagramcreation
Browse files Browse the repository at this point in the history
Fix diagram creation
  • Loading branch information
daknhh authored Jun 21, 2022
2 parents 1de837e + a0353b8 commit 80b6fe6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Change Log

## Released
## 2.5.1

### Fixed
- Diagram Creation using template parameter
## 2.5.0

### Added
Expand Down
17 changes: 11 additions & 6 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ version: '3'
env:
SKIP_QUOTA_CHECK: true
WAF_TEST: false
CREATE_DIAGRAM: false
CREATE_DIAGRAM: true
CDK_DIFF: false

vars:
config: # without .json
REGION:
sh: echo $AWS_REGION
CDK_DEFAULT_ACCOUNT:
sh: aws sts get-caller-identity |jq -r .Account

tasks:
deploy:
desc: Deploy Stack
Expand All @@ -32,6 +30,8 @@ tasks:
sh: aws sts get-caller-identity |jq -r .Account
TAGS:
sh: cat tags/tags.json | jq -j '.[]|"--tags " + (.Key)+"="+(.Value)+" "'
env:
PROCESS_PARAMETERS: values/{{.config}}.json
clean:
desc: Clean CDK Out
cmds:
Expand Down Expand Up @@ -73,13 +73,15 @@ tasks:
creatediagram:
desc: Create Diagram
cmds:
- if [[ {{.CREATE_DIAGRAM}} = true ]] ; then echo 🤳🏻 $(cfn-dia draw.io --cdk-output cdk.out --output-file $(sed "s/values/diagrams/g;s/.json/.drawio/g" <<< values/{{.config}}.json) --ci-mode --skip-synth); else echo ⏭ Skipping Diagram generation 🤳🏻 ; fi
- if [[ {{.CREATE_DIAGRAM}} = true ]] ; then echo 🤳🏻 $(cfn-dia draw.io -t cdk.out/"$(cat values/{{.config}}.json | jq -r '.General.Prefix')-WAF-$(cat values/{{.config}}.json | jq -r '.WebAcl.Name')-$(cat values/{{.config}}.json | jq -r '.General.Stage')-$(cat values/{{.config}}.json | jq -r '.General.DeployHash')".template.json --output-file $(sed "s/values/diagrams/g;s/.json/.drawio/g" <<< values/{{.config}}.json) --ci-mode --skip-synth); else echo ⏭ Skipping Diagram generation 🤳🏻 ; fi
silent: true
env:
PROCESS_PARAMETERS: values/{{.config}}.json
testwaf:
desc: Test of your waf using GoTestWAF
cmds:
- echo 🧪 Testing of your new 🔥 WAF using GoTestWAF
- ./gotestwaf/gotestwaf --url=$(cat values/{{.config}}.json | jq -r '.[].SecuredDomain') --wafName="$(cat values/{{.config}}.json | jq -r '.General.Prefix')-$(cat values/{{.config}}.json | jq -r '.WebAcl.Name')-$(cat values/{{.config}}.json | jq -r '.General.Stage')-$(cat values/{{.config}}.json | jq -r '.General.DeployHash')" --configPath=./gotestwaf/config.yaml --testCasesPath=./gotestwaf/testcases --skipWAFBlockCheck
- ./gotestwaf/gotestwaf --url=$(cat values/{{.config}}.json | jq -r '.[].SecuredDomain') --workers 50 --blockConnReset --tlsVerify --wafName="$(cat values/{{.config}}.json | jq -r '.General.Prefix')-$(cat values/{{.config}}.json | jq -r '.WebAcl.Name')-$(cat values/{{.config}}.json | jq -r '.General.Stage')-$(cat values/{{.config}}.json | jq -r '.General.DeployHash')" --configPath=./gotestwaf/config.yaml --testCasesPath=./gotestwaf/testcases --verbose --skipWAFBlockCheck --reportName /waf-evaluation-report-"$(cat values/{{.config}}.json | jq -r '.General.Prefix')-$(cat values/{{.config}}.json | jq -r '.WebAcl.Name')-$(cat values/{{.config}}.json | jq -r '.General.Stage')-$(cat values/{{.config}}.json | jq -r '.General.DeployHash')"
silent: true
preconditions:
- sh: if [[ {{.WAF_TEST}} = true ]] ; then exit 0; else exit 1; fi
Expand All @@ -100,4 +102,7 @@ tasks:
desc: Generate skeleton for a waf configuration file
cmds:
- if [[ "{{.config}}" ]] ; then ts-node lib/tools/generate-skeleton.ts >> values/{{.config}}.json ; else ts-node lib/tools/generate-skeleton.ts ; fi
silent: true
silent: true



2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plattform-wafv2-cdk-automation",
"version": "2.5.0",
"version": "2.5.1",
"bin": {
"plattform-wafv2-cdk-automation": "bin/plattform-wafv2-cdk-automation.js"
},
Expand Down

0 comments on commit 80b6fe6

Please sign in to comment.