@gradientedge/cdk-utils 5.3.0 → 5.5.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.
- package/app/api-destined-function/layers/nodejs/node_modules/.yarn-integrity +2 -2
- package/dist/src/lib/manager/aws/codebuild-manager.js +1 -1
- package/dist/src/lib/manager/aws/s3-manager.d.ts +8 -0
- package/dist/src/lib/manager/aws/s3-manager.js +20 -0
- package/package.json +19 -19
- package/src/lib/manager/aws/codebuild-manager.ts +1 -1
- package/src/lib/manager/aws/s3-manager.ts +22 -0
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"brace-expansion@^1.1.7": "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
|
|
21
21
|
"concat-map@0.0.1": "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b",
|
|
22
22
|
"fs.realpath@^1.0.0": "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f",
|
|
23
|
-
"glob@^7.1.3": "https://registry.yarnpkg.com/glob/-/glob-7.2.
|
|
23
|
+
"glob@^7.1.3": "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b",
|
|
24
24
|
"inflight@^1.0.4": "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9",
|
|
25
25
|
"inherits@2": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
|
|
26
|
-
"minimatch@^3.
|
|
26
|
+
"minimatch@^3.1.1": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b",
|
|
27
27
|
"mkdirp@^1.0.4": "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e",
|
|
28
28
|
"once@^1.3.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
|
|
29
29
|
"path-is-absolute@^1.0.0": "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f",
|
|
@@ -86,7 +86,7 @@ class CodeBuildManager {
|
|
|
86
86
|
logging: {
|
|
87
87
|
cloudWatch: {
|
|
88
88
|
logGroup: scope.logManager.createLogGroup(`${id}-project-log-group`, scope, {
|
|
89
|
-
logGroupName:
|
|
89
|
+
logGroupName: `${id}-cloudfront-invalidation`,
|
|
90
90
|
}),
|
|
91
91
|
enabled: true,
|
|
92
92
|
},
|
|
@@ -70,4 +70,12 @@ export declare class S3Manager {
|
|
|
70
70
|
* @param {boolean} prune
|
|
71
71
|
*/
|
|
72
72
|
doBucketDeployment(id: string, scope: common.CommonConstruct, siteBucket: s3.IBucket, distribution: cloudfront.IDistribution, sources: s3deploy.ISource[], prefix: string, prune?: boolean): void;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @param {string} id scoped id of the resource
|
|
76
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
77
|
+
* @param {s3.IBucket} bucket bucket to create the folders in
|
|
78
|
+
* @param {string[]} folders list of folder names to be created in the bucket
|
|
79
|
+
*/
|
|
80
|
+
createBucketFolders(id: string, scope: common.CommonConstruct, bucket: s3.IBucket, folders: string[]): void;
|
|
73
81
|
}
|
|
@@ -202,5 +202,25 @@ class S3Manager {
|
|
|
202
202
|
sources: sources,
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
*
|
|
207
|
+
* @param {string} id scoped id of the resource
|
|
208
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
209
|
+
* @param {s3.IBucket} bucket bucket to create the folders in
|
|
210
|
+
* @param {string[]} folders list of folder names to be created in the bucket
|
|
211
|
+
*/
|
|
212
|
+
createBucketFolders(id, scope, bucket, folders) {
|
|
213
|
+
if (!folders || folders.length == 0) {
|
|
214
|
+
throw `Folder unspecified for ${id}`;
|
|
215
|
+
}
|
|
216
|
+
folders.forEach(folder => {
|
|
217
|
+
new s3deploy.BucketDeployment(scope, `${id}-${folder}`, {
|
|
218
|
+
destinationBucket: bucket,
|
|
219
|
+
destinationKeyPrefix: folder,
|
|
220
|
+
sources: [s3deploy.Source.data('README.md', `This is the ${folder} folder for ${id}`)],
|
|
221
|
+
prune: false,
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
}
|
|
205
225
|
}
|
|
206
226
|
exports.S3Manager = S3Manager;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "Utilities for AWS CDK provisioning",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -46,49 +46,49 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@types/lodash": "^4.14.182",
|
|
49
|
-
"@types/node": "^17.0.
|
|
49
|
+
"@types/node": "^17.0.42",
|
|
50
50
|
"app-root-path": "^3.0.0",
|
|
51
|
-
"aws-cdk-lib": "^2.
|
|
52
|
-
"aws-sdk": "^2.
|
|
53
|
-
"constructs": "^10.1.
|
|
51
|
+
"aws-cdk-lib": "^2.27.0",
|
|
52
|
+
"aws-sdk": "^2.1153.0",
|
|
53
|
+
"constructs": "^10.1.39",
|
|
54
54
|
"lodash": "^4.17.21",
|
|
55
55
|
"moment": "^2.29.3",
|
|
56
56
|
"nconf": "^0.12.0",
|
|
57
57
|
"pluralize": "^8.0.0",
|
|
58
|
-
"ts-node": "^10.
|
|
58
|
+
"ts-node": "^10.8.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
62
|
-
"@types/jest": "^
|
|
63
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
64
|
-
"@typescript-eslint/parser": "^5.
|
|
61
|
+
"@babel/plugin-proposal-class-properties": "^7.17.12",
|
|
62
|
+
"@types/jest": "^28.1.1",
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^5.28.0",
|
|
64
|
+
"@typescript-eslint/parser": "^5.28.0",
|
|
65
65
|
"aws-cdk": "*",
|
|
66
66
|
"babel-eslint": "^10.1.0",
|
|
67
67
|
"better-docs": "^2.7.2",
|
|
68
68
|
"codecov": "^3.8.3",
|
|
69
69
|
"commitizen": "^4.2.4",
|
|
70
70
|
"dotenv": "^16.0.1",
|
|
71
|
-
"eslint": "^8.
|
|
71
|
+
"eslint": "^8.17.0",
|
|
72
72
|
"eslint-config-prettier": "^8.5.0",
|
|
73
73
|
"eslint-plugin-import": "^2.26.0",
|
|
74
74
|
"husky": "^8.0.1",
|
|
75
|
-
"jest": "^28.1.
|
|
75
|
+
"jest": "^28.1.1",
|
|
76
76
|
"jest-extended": "^2.0.0",
|
|
77
77
|
"jest-junit": "^13.2.0",
|
|
78
78
|
"jsdoc": "^3.6.10",
|
|
79
79
|
"jsdoc-babel": "^0.5.0",
|
|
80
80
|
"jsdoc-mermaid": "^1.0.0",
|
|
81
|
-
"lerna": "^
|
|
82
|
-
"prettier": "^2.
|
|
81
|
+
"lerna": "^5.1.2",
|
|
82
|
+
"prettier": "^2.7.0",
|
|
83
83
|
"prettier-plugin-organize-imports": "^2.3.4",
|
|
84
84
|
"rimraf": "^3.0.2",
|
|
85
|
-
"semantic-release": "^19.0.
|
|
86
|
-
"ts-jest": "^28.0.
|
|
87
|
-
"ts-node": "^10.
|
|
88
|
-
"typescript": "4.
|
|
85
|
+
"semantic-release": "^19.0.3",
|
|
86
|
+
"ts-jest": "^28.0.5",
|
|
87
|
+
"ts-node": "^10.8.1",
|
|
88
|
+
"typescript": "4.7.3"
|
|
89
89
|
},
|
|
90
90
|
"optionalDependencies": {
|
|
91
|
-
"@babel/core": "^7.
|
|
91
|
+
"@babel/core": "^7.18.5",
|
|
92
92
|
"prop-types": "^15.8.1",
|
|
93
93
|
"react": "^18.1.0",
|
|
94
94
|
"react-dom": "^18.1.0"
|
|
@@ -71,7 +71,7 @@ export class CodeBuildManager {
|
|
|
71
71
|
logging: {
|
|
72
72
|
cloudWatch: {
|
|
73
73
|
logGroup: scope.logManager.createLogGroup(`${id}-project-log-group`, scope, {
|
|
74
|
-
logGroupName:
|
|
74
|
+
logGroupName: `${id}-cloudfront-invalidation`,
|
|
75
75
|
}),
|
|
76
76
|
enabled: true,
|
|
77
77
|
},
|
|
@@ -200,4 +200,26 @@ export class S3Manager {
|
|
|
200
200
|
sources: sources,
|
|
201
201
|
})
|
|
202
202
|
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
*
|
|
206
|
+
* @param {string} id scoped id of the resource
|
|
207
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
208
|
+
* @param {s3.IBucket} bucket bucket to create the folders in
|
|
209
|
+
* @param {string[]} folders list of folder names to be created in the bucket
|
|
210
|
+
*/
|
|
211
|
+
public createBucketFolders(id: string, scope: common.CommonConstruct, bucket: s3.IBucket, folders: string[]) {
|
|
212
|
+
if (!folders || folders.length == 0) {
|
|
213
|
+
throw `Folder unspecified for ${id}`
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
folders.forEach(folder => {
|
|
217
|
+
new s3deploy.BucketDeployment(scope, `${id}-${folder}`, {
|
|
218
|
+
destinationBucket: bucket,
|
|
219
|
+
destinationKeyPrefix: folder,
|
|
220
|
+
sources: [s3deploy.Source.data('README.md', `This is the ${folder} folder for ${id}`)],
|
|
221
|
+
prune: false,
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
}
|
|
203
225
|
}
|