@guardian/cdk 59.2.0 → 59.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -38,9 +38,9 @@ function addAmiParametersToCloudFormationDeployment(cfnDeployment, autoScalingGr
|
|
|
38
38
|
throw new Error(`Unable to produce a working riff-raff.yaml file; imageRecipe missing from ASG ${app}`);
|
|
39
39
|
}
|
|
40
40
|
const Recipe = typeof imageRecipe === "string" ? imageRecipe : imageRecipe.Recipe;
|
|
41
|
-
const AmigoStage = typeof imageRecipe === "string" ? "PROD" : imageRecipe.AmigoStage ?? "PROD";
|
|
41
|
+
const AmigoStage = typeof imageRecipe === "string" ? "PROD" : (imageRecipe.AmigoStage ?? "PROD");
|
|
42
42
|
// In YAML `true` is a Boolean. Riff-Raff expects a String here, so call `toString` to make it `'true'`.
|
|
43
|
-
const Encrypted = (typeof imageRecipe === "string" ? true : imageRecipe.Encrypted ?? true).toString();
|
|
43
|
+
const Encrypted = (typeof imageRecipe === "string" ? true : (imageRecipe.Encrypted ?? true)).toString();
|
|
44
44
|
return {
|
|
45
45
|
...acc,
|
|
46
46
|
[amiParameter.node.id]: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudformation.js","sourceRoot":"","sources":["../../../src/riff-raff-yaml-file/deployments/cloudformation.ts"],"names":[],"mappings":";;;AAGA,SAAgB,wBAAwB,CACtC,SAAwC,EACxC,YAAkC,EAClC,gBAAwB;IAExB,qHAAqH;IACrH,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;IAE7B,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;KAC1F;IAED,MAAM,EACJ,MAAM,EACN,KAAK,EACL,WAAW,EAAE,EAAE,IAAI,EAAE,GACtB,GAAG,QAAQ,CAAC;IAEb,yFAAyF;IACzF,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,iBA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,WAAW,CAAC,MAAM,CAAC;QAClF,MAAM,UAAU,GAAG,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,IAAI,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"cloudformation.js","sourceRoot":"","sources":["../../../src/riff-raff-yaml-file/deployments/cloudformation.ts"],"names":[],"mappings":";;;AAGA,SAAgB,wBAAwB,CACtC,SAAwC,EACxC,YAAkC,EAClC,gBAAwB;IAExB,qHAAqH;IACrH,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;IAE7B,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;KAC1F;IAED,MAAM,EACJ,MAAM,EACN,KAAK,EACL,WAAW,EAAE,EAAE,IAAI,EAAE,GACtB,GAAG,QAAQ,CAAC;IAEb,yFAAyF;IACzF,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;IAE9E,MAAM,kBAAkB,GAAG,SAAS,CAAC,MAAM,CACzC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;QACjC,GAAG,GAAG;QACN,CAAC,KAAK,CAAC,EAAE,YAAY;KACtB,CAAC,EACF,EAAE,CACH,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QACtD,KAAK,EAAE;YACL,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;YAC1B,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;YACxB,GAAG,EAAE,cAAc;YACnB,gBAAgB;YAChB,UAAU,EAAE;gBACV,kB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EAAE;YACV,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU;YAEjC,gEAAgE;YAChE,GAAG,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,mBAAmB,EAAE,CAAC;SAC7D;KACF,CAAC;AACJ,CAAC;AArCD,gGAqCC","sourcesContent":["import type { GuAutoScalingGroup } from \"../../constructs/autoscaling\";\nimport type { CdkStacksDifferingOnlyByStage, RiffRaffDeployment, RiffRaffDeploymentProps } from \"../types\";\n\nexport function cloudFormationDeployment(\n cdkStacks: CdkStacksDifferingOnlyByStage,\n dependencies: RiffRaffDeployment[],\n contentDirectory: string,\n): RiffRaffDeployment {\n // The stacks in `cdkStacks` only differ by stage, so we can just use the first item in the list for key information.\n const [cdkStack] = cdkStacks;\n\n if (!cdkStack) {\n throw new Error(\"Unable to produce a working riff-raff.yaml file; there are no stacks!\");\n }\n\n const {\n region,\n stack,\n constructor: { name },\n } = cdkStack;\n\n // TODO remove `lodash.kebabcase` dep as it's not that much code to kebab-ise a string...\n const kebabClassName = name.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n\n const templateStagePaths = cdkStacks.reduce(\n (acc, { stage, templateFile }) => ({\n ...acc,\n [stage]: templateFile,\n }),\n {},\n );\n\n return {\n name: [\"cfn\", region, stack, kebabClassName].join(\"-\"),\n props: {\n type: \"cloud-formation\",\n regions: new Set([region]),\n stacks: new Set([stack]),\n app: kebabClassName,\n contentDirectory,\n parameters: {\n templateStagePaths,\n },\n // only add the `dependencies` property if there are some\n ...(dependencies.length > 0 && { dependencies: dependencies.map(({ name }) => name) }),\n },\n };\n}\n\nexport function addAmiParametersToCloudFormationDeployment(\n cfnDeployment: RiffRaffDeployment,\n autoScalingGroups: GuAutoScalingGroup[],\n): RiffRaffDeploymentProps {\n const amiParametersToTags = autoScalingGroups.reduce((acc, asg) => {\n const { imageRecipe, app, amiParameter } = asg;\n\n if (!imageRecipe) {\n throw new Error(`Unable to produce a working riff-raff.yaml file; imageRecipe missing from ASG ${app}`);\n }\n\n const Recipe = typeof imageRecipe === \"string\" ? imageRecipe : imageRecipe.Recipe;\n const AmigoStage = typeof imageRecipe === \"string\" ? \"PROD\" : (imageRecipe.AmigoStage ?? \"PROD\");\n\n // In YAML `true` is a Boolean. Riff-Raff expects a String here, so call `toString` to make it `'true'`.\n const Encrypted = (typeof imageRecipe === \"string\" ? true : (imageRecipe.Encrypted ?? true)).toString();\n\n return {\n ...acc,\n [amiParameter.node.id]: {\n BuiltBy: \"amigo\",\n AmigoStage,\n Recipe,\n Encrypted,\n },\n };\n }, {});\n\n return {\n ...cfnDeployment.props,\n parameters: {\n ...cfnDeployment.props.parameters,\n\n // only add the `amiParametersToTags` property if there are some\n ...(autoScalingGroups.length > 0 && { amiParametersToTags }),\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/cdk",
|
|
3
3
|
"description": "Generic Guardian flavoured AWS CDK components",
|
|
4
|
-
"version": "59.2.
|
|
4
|
+
"version": "59.2.1",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/lodash.camelcase": "^4.3.9",
|
|
39
39
|
"@types/lodash.kebabcase": "^4.1.9",
|
|
40
40
|
"@types/lodash.upperfirst": "^4.3.9",
|
|
41
|
-
"@types/node": "
|
|
41
|
+
"@types/node": "22.0.0",
|
|
42
42
|
"@types/yargs": "^17.0.32",
|
|
43
43
|
"aws-cdk": "2.148.0",
|
|
44
44
|
"aws-cdk-lib": "2.148.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"eslint-plugin-custom-rules": "file:tools/eslint",
|
|
48
48
|
"gh-pages": "^6.1.1",
|
|
49
49
|
"jest": "^29.7.0",
|
|
50
|
-
"prettier": "^3.3.
|
|
50
|
+
"prettier": "^3.3.3",
|
|
51
51
|
"serve": "^14.2.3",
|
|
52
52
|
"ts-jest": "^29.2.2",
|
|
53
53
|
"ts-node": "^10.9.2",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@oclif/core": "3.26.6",
|
|
59
|
-
"aws-sdk": "^2.
|
|
59
|
+
"aws-sdk": "^2.1664.0",
|
|
60
60
|
"chalk": "^4.1.2",
|
|
61
61
|
"codemaker": "^1.101.0",
|
|
62
|
-
"git-url-parse": "^14.
|
|
62
|
+
"git-url-parse": "^14.1.0",
|
|
63
63
|
"js-yaml": "^4.1.0",
|
|
64
64
|
"lodash.camelcase": "^4.3.0",
|
|
65
65
|
"lodash.kebabcase": "^4.1.1",
|