@gradientedge/cdk-utils 7.1.0 → 7.3.0
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.
|
@@ -43,6 +43,7 @@ export declare class EcsManager {
|
|
|
43
43
|
* @param {logs.ILogGroup} logGroup
|
|
44
44
|
* @param {ecs.ContainerImage} containerImage
|
|
45
45
|
* @param {Map<string, string>} environment
|
|
46
|
+
* @param {Map<string, string>} secrets
|
|
46
47
|
*/
|
|
47
|
-
createEcsFargateTask(id: string, scope: common.CommonConstruct, props: types.EcsTaskProps, cluster: ecs.ICluster, role: iam.Role, logGroup: logs.ILogGroup, containerImage: ecs.ContainerImage, environment?: any): ecs.TaskDefinition;
|
|
48
|
+
createEcsFargateTask(id: string, scope: common.CommonConstruct, props: types.EcsTaskProps, cluster: ecs.ICluster, role: iam.Role, logGroup: logs.ILogGroup, containerImage: ecs.ContainerImage, environment?: any, secrets?: any): ecs.TaskDefinition;
|
|
48
49
|
}
|
|
@@ -80,8 +80,9 @@ class EcsManager {
|
|
|
80
80
|
* @param {logs.ILogGroup} logGroup
|
|
81
81
|
* @param {ecs.ContainerImage} containerImage
|
|
82
82
|
* @param {Map<string, string>} environment
|
|
83
|
+
* @param {Map<string, string>} secrets
|
|
83
84
|
*/
|
|
84
|
-
createEcsFargateTask(id, scope, props, cluster, role, logGroup, containerImage, environment) {
|
|
85
|
+
createEcsFargateTask(id, scope, props, cluster, role, logGroup, containerImage, environment, secrets) {
|
|
85
86
|
if (!props)
|
|
86
87
|
throw `EcsTask props undefined`;
|
|
87
88
|
const ecsTask = new ecs.TaskDefinition(scope, `${id}`, {
|
|
@@ -104,6 +105,7 @@ class EcsManager {
|
|
|
104
105
|
}),
|
|
105
106
|
memoryLimitMiB: props.memoryMiB ? parseInt(props.memoryMiB) : undefined,
|
|
106
107
|
privileged: false,
|
|
108
|
+
secrets: secrets,
|
|
107
109
|
});
|
|
108
110
|
utils.createCfnOutput(`${id}-taskArn`, scope, ecsTask.taskDefinitionArn);
|
|
109
111
|
return ecsTask;
|
|
@@ -101,6 +101,7 @@ class LambdaManager {
|
|
|
101
101
|
runtime: LambdaManager.NODEJS_RUNTIME,
|
|
102
102
|
code: code,
|
|
103
103
|
deadLetterQueue: deadLetterQueue,
|
|
104
|
+
architecture: props.architecture ?? lambda.Architecture.ARM_64,
|
|
104
105
|
environment: {
|
|
105
106
|
REGION: scope.props.region,
|
|
106
107
|
LAST_MODIFIED_TS: new Date().toISOString(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "Utilities for AWS CDK provisioning",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "rimraf dist/ && npx tsc && npx lerna run build",
|
|
30
30
|
"build:production": "rimraf dist/ && npx tsc -p tsconfig.prd.json && npx lerna run build",
|
|
31
|
+
"cu": "ncu -x lerna",
|
|
31
32
|
"ci": "yarn install --frozen-lockfile && yarn build && yarn validate && yarn docs",
|
|
32
33
|
"cz": "npx cz",
|
|
33
34
|
"docs": "rimraf api-docs && npx jsdoc --pedantic -c jsdoc.json .",
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
"prettier": "npx prettier --check \"**/*.{ts,json,md}\"",
|
|
38
39
|
"prettify": "npx prettier --write \"**/*.{ts,json,md}\"",
|
|
39
40
|
"test": "rimraf coverage && npx jest --ci --runInBand",
|
|
41
|
+
"upgrade": "ncu -u -x lerna",
|
|
40
42
|
"validate": "yarn prettier && yarn test"
|
|
41
43
|
},
|
|
42
44
|
"husky": {
|
|
@@ -45,12 +47,12 @@
|
|
|
45
47
|
}
|
|
46
48
|
},
|
|
47
49
|
"dependencies": {
|
|
48
|
-
"@types/lodash": "^4.14.
|
|
50
|
+
"@types/lodash": "^4.14.190",
|
|
49
51
|
"@types/node": "^18.11.9",
|
|
50
52
|
"app-root-path": "^3.1.0",
|
|
51
|
-
"aws-cdk-lib": "^2.
|
|
52
|
-
"aws-sdk": "^2.
|
|
53
|
-
"constructs": "^10.1.
|
|
53
|
+
"aws-cdk-lib": "^2.52.0",
|
|
54
|
+
"aws-sdk": "^2.1262.0",
|
|
55
|
+
"constructs": "^10.1.173",
|
|
54
56
|
"lodash": "^4.17.21",
|
|
55
57
|
"moment": "^2.29.4",
|
|
56
58
|
"nconf": "^0.12.0",
|
|
@@ -59,34 +61,34 @@
|
|
|
59
61
|
},
|
|
60
62
|
"devDependencies": {
|
|
61
63
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
62
|
-
"@types/jest": "^29.2.
|
|
63
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
64
|
-
"@typescript-eslint/parser": "^5.
|
|
64
|
+
"@types/jest": "^29.2.3",
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^5.44.0",
|
|
66
|
+
"@typescript-eslint/parser": "^5.44.0",
|
|
65
67
|
"aws-cdk": "*",
|
|
66
68
|
"babel-eslint": "^10.1.0",
|
|
67
69
|
"better-docs": "^2.7.2",
|
|
68
70
|
"codecov": "^3.8.3",
|
|
69
71
|
"commitizen": "^4.2.5",
|
|
70
72
|
"dotenv": "^16.0.3",
|
|
71
|
-
"eslint": "^8.
|
|
73
|
+
"eslint": "^8.28.0",
|
|
72
74
|
"eslint-config-prettier": "^8.5.0",
|
|
73
75
|
"eslint-plugin-import": "^2.26.0",
|
|
74
|
-
"husky": "^8.0.
|
|
75
|
-
"jest": "^29.
|
|
76
|
-
"jest-extended": "^3.
|
|
77
|
-
"jest-junit": "^
|
|
76
|
+
"husky": "^8.0.2",
|
|
77
|
+
"jest": "^29.3.1",
|
|
78
|
+
"jest-extended": "^3.2.0",
|
|
79
|
+
"jest-junit": "^15.0.0",
|
|
78
80
|
"jsdoc": "^4.0.0",
|
|
79
81
|
"jsdoc-babel": "^0.5.0",
|
|
80
82
|
"jsdoc-mermaid": "^1.0.0",
|
|
81
83
|
"lerna": "^5.6.2",
|
|
82
|
-
"prettier": "^2.
|
|
83
|
-
"prettier-plugin-organize-imports": "^3.
|
|
84
|
+
"prettier": "^2.8.0",
|
|
85
|
+
"prettier-plugin-organize-imports": "^3.2.1",
|
|
84
86
|
"rimraf": "^3.0.2",
|
|
85
87
|
"semantic-release": "^19.0.5",
|
|
86
88
|
"taffydb": "^2.7.3",
|
|
87
89
|
"ts-jest": "^29.0.3",
|
|
88
90
|
"ts-node": "^10.9.1",
|
|
89
|
-
"typescript": "4.
|
|
91
|
+
"typescript": "4.9.3"
|
|
90
92
|
},
|
|
91
93
|
"optionalDependencies": {
|
|
92
94
|
"@babel/core": "^7.20.2",
|
|
@@ -63,6 +63,7 @@ export class EcsManager {
|
|
|
63
63
|
* @param {logs.ILogGroup} logGroup
|
|
64
64
|
* @param {ecs.ContainerImage} containerImage
|
|
65
65
|
* @param {Map<string, string>} environment
|
|
66
|
+
* @param {Map<string, string>} secrets
|
|
66
67
|
*/
|
|
67
68
|
public createEcsFargateTask(
|
|
68
69
|
id: string,
|
|
@@ -72,7 +73,8 @@ export class EcsManager {
|
|
|
72
73
|
role: iam.Role,
|
|
73
74
|
logGroup: logs.ILogGroup,
|
|
74
75
|
containerImage: ecs.ContainerImage,
|
|
75
|
-
environment?: any
|
|
76
|
+
environment?: any,
|
|
77
|
+
secrets?: any
|
|
76
78
|
) {
|
|
77
79
|
if (!props) throw `EcsTask props undefined`
|
|
78
80
|
|
|
@@ -97,6 +99,7 @@ export class EcsManager {
|
|
|
97
99
|
}),
|
|
98
100
|
memoryLimitMiB: props.memoryMiB ? parseInt(props.memoryMiB) : undefined,
|
|
99
101
|
privileged: false,
|
|
102
|
+
secrets: secrets,
|
|
100
103
|
})
|
|
101
104
|
|
|
102
105
|
utils.createCfnOutput(`${id}-taskArn`, scope, ecsTask.taskDefinitionArn)
|
|
@@ -100,6 +100,7 @@ export class LambdaManager {
|
|
|
100
100
|
runtime: LambdaManager.NODEJS_RUNTIME,
|
|
101
101
|
code: code,
|
|
102
102
|
deadLetterQueue: deadLetterQueue,
|
|
103
|
+
architecture: props.architecture ?? lambda.Architecture.ARM_64,
|
|
103
104
|
environment: {
|
|
104
105
|
REGION: scope.props.region,
|
|
105
106
|
LAST_MODIFIED_TS: new Date().toISOString(),
|