From f27b4df3c969319825775dcd5c510427eeabcb2d Mon Sep 17 00:00:00 2001 From: daknhh Date: Wed, 2 Mar 2022 16:44:23 +0100 Subject: [PATCH 1/3] Bugfix --- CHANGELOG.md | 6 ++++++ lib/plattform-wafv2-cdk-automation-stack.ts | 20 +++++++++++--------- package.json | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fbcb790..657cdb12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Released +## 2.1.1 + +### Fixed + +- Outputs were not dynamic + ## 2.1.0 ### Added diff --git a/lib/plattform-wafv2-cdk-automation-stack.ts b/lib/plattform-wafv2-cdk-automation-stack.ts index 34f3b5b8..2078d6e1 100644 --- a/lib/plattform-wafv2-cdk-automation-stack.ts +++ b/lib/plattform-wafv2-cdk-automation-stack.ts @@ -279,6 +279,8 @@ function buildServiceDataCustomRGs(scope: Construct, type: "Pre" | "Post", capac "-" + deployHash; let rulegroupidentifier = type + "RuleGroup"; + console.log(processRuntimeProps.DeployedRuleGroupCapacities[0]) + console.log(capacity) if (processRuntimeProps.DeployedRuleGroupCapacities[0]) { if ( processRuntimeProps.DeployedRuleGroupCapacities[0] !== @@ -651,30 +653,30 @@ function buildServiceDataCustomRGs(scope: Construct, type: "Pre" | "Post", capac ); processRuntimeProps.DeployedRuleGroupNames.splice(lenght); - new cdk.CfnOutput(scope, "PreProcessDeployedRuleGroupNames", { + new cdk.CfnOutput(scope, type+"ProcessDeployedRuleGroupNames", { value: processRuntimeProps.DeployedRuleGroupNames.toString(), - description: "PreProcessDeployedRuleGroupNames", + description: type+"ProcessDeployedRuleGroupNames", exportName: - "PreProcessDeployedRuleGroupNames" + + type+"ProcessDeployedRuleGroupNames" + deployHash, }); - new cdk.CfnOutput(scope, "PreProcessDeployedRuleGroupCapacities", { + new cdk.CfnOutput(scope, type+"ProcessDeployedRuleGroupCapacities", { value: processRuntimeProps.DeployedRuleGroupCapacities.toString(), - description: "PreProcessDeployedRuleGroupCapacities", + description: type+"ProcessDeployedRuleGroupCapacities", exportName: - "PreProcessDeployedRuleGroupCapacities" + + type+"ProcessDeployedRuleGroupCapacities" + deployHash, }); - new cdk.CfnOutput(scope, "PreProcessDeployedRuleGroupIdentifier", { + new cdk.CfnOutput(scope, type+"ProcessDeployedRuleGroupIdentifier", { value: processRuntimeProps.DeployedRuleGroupIdentifier.toString(), - description: "PreProcessDeployedRuleGroupIdentifier", + description: type+"ProcessDeployedRuleGroupIdentifier", exportName: - "PreProcessDeployedRuleGroupIdentifier" + + type+"ProcessDeployedRuleGroupIdentifier" + deployHash, }); } diff --git a/package.json b/package.json index 9bf422fa..89716059 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plattform-wafv2-cdk-automation", - "version": "2.1.0", + "version": "2.1.1", "bin": { "plattform-wafv2-cdk-automation": "bin/plattform-wafv2-cdk-automation.js" }, From 427f35b8041ed7b4df56ee0657395d38880eb593 Mon Sep 17 00:00:00 2001 From: daknhh Date: Wed, 2 Mar 2022 16:45:07 +0100 Subject: [PATCH 2/3] remove console.log --- lib/plattform-wafv2-cdk-automation-stack.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/plattform-wafv2-cdk-automation-stack.ts b/lib/plattform-wafv2-cdk-automation-stack.ts index 2078d6e1..8f9d9a2a 100644 --- a/lib/plattform-wafv2-cdk-automation-stack.ts +++ b/lib/plattform-wafv2-cdk-automation-stack.ts @@ -279,8 +279,6 @@ function buildServiceDataCustomRGs(scope: Construct, type: "Pre" | "Post", capac "-" + deployHash; let rulegroupidentifier = type + "RuleGroup"; - console.log(processRuntimeProps.DeployedRuleGroupCapacities[0]) - console.log(capacity) if (processRuntimeProps.DeployedRuleGroupCapacities[0]) { if ( processRuntimeProps.DeployedRuleGroupCapacities[0] !== From 1a2ee510992658cc75ad28f874c975e9071097ac Mon Sep 17 00:00:00 2001 From: daknhh Date: Wed, 2 Mar 2022 16:52:04 +0100 Subject: [PATCH 3/3] bugfix --- lib/plattform-wafv2-cdk-automation-stack.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/plattform-wafv2-cdk-automation-stack.ts b/lib/plattform-wafv2-cdk-automation-stack.ts index 8f9d9a2a..211b2949 100644 --- a/lib/plattform-wafv2-cdk-automation-stack.ts +++ b/lib/plattform-wafv2-cdk-automation-stack.ts @@ -296,7 +296,7 @@ function buildServiceDataCustomRGs(scope: Construct, type: "Pre" | "Post", capac ); if ( processRuntimeProps.DeployedRuleGroupIdentifier[0] === - "RuleGroup" + type+"RuleGroup" ) { rulegroupidentifier = type + "RG"; } @@ -304,6 +304,8 @@ function buildServiceDataCustomRGs(scope: Construct, type: "Pre" | "Post", capac if ( processRuntimeProps.DeployedRuleGroupNames[0] === webaclName + + "-" + + type.toLowerCase() + "-" + stage + "-" +