@gradientedge/cdk-utils 7.10.0 → 7.11.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/dist/src/lib/manager/aws/lambda-manager.js +4 -1
- package/dist/src/lib/manager/aws/ssm-manager.d.ts +1 -0
- package/dist/src/lib/manager/aws/ssm-manager.js +1 -0
- package/dist/src/lib/types/aws/index.d.ts +1 -0
- package/package.json +13 -13
- package/src/lib/manager/aws/lambda-manager.ts +8 -1
- package/src/lib/manager/aws/ssm-manager.ts +1 -0
- package/src/lib/types/aws/index.ts +1 -0
|
@@ -29,6 +29,7 @@ const iam = __importStar(require("aws-cdk-lib/aws-iam"));
|
|
|
29
29
|
const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
|
|
30
30
|
const utils = __importStar(require("../../utils"));
|
|
31
31
|
const cloudfront_manager_1 = require("./cloudfront-manager");
|
|
32
|
+
const ssm_manager_1 = require("./ssm-manager");
|
|
32
33
|
/**
|
|
33
34
|
* @stability stable
|
|
34
35
|
* @category cdk-utils.lambda-manager
|
|
@@ -104,8 +105,10 @@ class LambdaManager {
|
|
|
104
105
|
architecture: props.architecture ?? lambda.Architecture.ARM_64,
|
|
105
106
|
environment: {
|
|
106
107
|
REGION: scope.props.region,
|
|
107
|
-
LAST_MODIFIED_TS: new Date().toISOString(),
|
|
108
108
|
STAGE: scope.props.stage,
|
|
109
|
+
LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
|
|
110
|
+
? ''
|
|
111
|
+
: scope.ssmManager.readStringParameter(`${id}-sm-ts`, scope, `${ssm_manager_1.SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`),
|
|
109
112
|
...environment,
|
|
110
113
|
},
|
|
111
114
|
filesystem: accessPoint
|
|
@@ -23,6 +23,7 @@ import * as types from '../../types';
|
|
|
23
23
|
* @see [CDK Systems Manager Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ssm-readme.html}
|
|
24
24
|
*/
|
|
25
25
|
export declare class SsmManager {
|
|
26
|
+
static SECRETS_MODIFIED_TIMESTAMP_PARAM: string;
|
|
26
27
|
/**
|
|
27
28
|
* Method to write a string parameter to the parameters store
|
|
28
29
|
* @param {string} id scoped id of the resource
|
|
@@ -48,6 +48,7 @@ const utils = __importStar(require("../../utils"));
|
|
|
48
48
|
* @see [CDK Systems Manager Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ssm-readme.html}
|
|
49
49
|
*/
|
|
50
50
|
class SsmManager {
|
|
51
|
+
static SECRETS_MODIFIED_TIMESTAMP_PARAM = 'secrets-last-modified-timestamp';
|
|
51
52
|
/**
|
|
52
53
|
* Method to write a string parameter to the parameters store
|
|
53
54
|
* @param {string} id scoped id of the resource
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.11.0",
|
|
4
4
|
"description": "Utilities for AWS CDK provisioning",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"prettier": "npx prettier --check \"**/*.{ts,json,md}\"",
|
|
39
39
|
"prettify": "npx prettier --write \"**/*.{ts,json,md}\"",
|
|
40
40
|
"test": "rimraf coverage && npx jest --ci --runInBand",
|
|
41
|
-
"
|
|
41
|
+
"update:deps": "ncu -u -x lerna",
|
|
42
42
|
"validate": "yarn prettier && yarn test"
|
|
43
43
|
},
|
|
44
44
|
"husky": {
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@types/lodash": "^4.14.
|
|
51
|
-
"@types/node": "^18.11.
|
|
50
|
+
"@types/lodash": "^4.14.191",
|
|
51
|
+
"@types/node": "^18.11.11",
|
|
52
52
|
"app-root-path": "^3.1.0",
|
|
53
|
-
"aws-cdk-lib": "^2.
|
|
54
|
-
"aws-sdk": "^2.
|
|
55
|
-
"constructs": "^10.1.
|
|
53
|
+
"aws-cdk-lib": "^2.53.0",
|
|
54
|
+
"aws-sdk": "^2.1268.0",
|
|
55
|
+
"constructs": "^10.1.181",
|
|
56
56
|
"lodash": "^4.17.21",
|
|
57
57
|
"moment": "^2.29.4",
|
|
58
58
|
"nconf": "^0.12.0",
|
|
@@ -61,16 +61,16 @@
|
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
64
|
-
"@types/jest": "^29.2.
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
66
|
-
"@typescript-eslint/parser": "^5.
|
|
64
|
+
"@types/jest": "^29.2.4",
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^5.45.1",
|
|
66
|
+
"@typescript-eslint/parser": "^5.45.1",
|
|
67
67
|
"aws-cdk": "*",
|
|
68
68
|
"babel-eslint": "^10.1.0",
|
|
69
69
|
"better-docs": "^2.7.2",
|
|
70
70
|
"codecov": "^3.8.3",
|
|
71
|
-
"commitizen": "^4.2.
|
|
71
|
+
"commitizen": "^4.2.6",
|
|
72
72
|
"dotenv": "^16.0.3",
|
|
73
|
-
"eslint": "^8.
|
|
73
|
+
"eslint": "^8.29.0",
|
|
74
74
|
"eslint-config-prettier": "^8.5.0",
|
|
75
75
|
"eslint-plugin-import": "^2.26.0",
|
|
76
76
|
"husky": "^8.0.2",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"typescript": "4.9.3"
|
|
92
92
|
},
|
|
93
93
|
"optionalDependencies": {
|
|
94
|
-
"@babel/core": "^7.20.
|
|
94
|
+
"@babel/core": "^7.20.5",
|
|
95
95
|
"prop-types": "^15.8.1",
|
|
96
96
|
"react": "^18.2.0",
|
|
97
97
|
"react-dom": "^18.2.0"
|
|
@@ -7,6 +7,7 @@ import * as common from '../../common'
|
|
|
7
7
|
import * as types from '../../types'
|
|
8
8
|
import * as utils from '../../utils'
|
|
9
9
|
import { CloudFrontManager } from './cloudfront-manager'
|
|
10
|
+
import { SsmManager } from './ssm-manager'
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* @stability stable
|
|
@@ -103,8 +104,14 @@ export class LambdaManager {
|
|
|
103
104
|
architecture: props.architecture ?? lambda.Architecture.ARM_64,
|
|
104
105
|
environment: {
|
|
105
106
|
REGION: scope.props.region,
|
|
106
|
-
LAST_MODIFIED_TS: new Date().toISOString(),
|
|
107
107
|
STAGE: scope.props.stage,
|
|
108
|
+
LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
|
|
109
|
+
? ''
|
|
110
|
+
: scope.ssmManager.readStringParameter(
|
|
111
|
+
`${id}-sm-ts`,
|
|
112
|
+
scope,
|
|
113
|
+
`${SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`
|
|
114
|
+
),
|
|
108
115
|
...environment,
|
|
109
116
|
},
|
|
110
117
|
filesystem: accessPoint
|
|
@@ -25,6 +25,7 @@ import * as utils from '../../utils'
|
|
|
25
25
|
* @see [CDK Systems Manager Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ssm-readme.html}
|
|
26
26
|
*/
|
|
27
27
|
export class SsmManager {
|
|
28
|
+
public static SECRETS_MODIFIED_TIMESTAMP_PARAM = 'secrets-last-modified-timestamp'
|
|
28
29
|
/**
|
|
29
30
|
* Method to write a string parameter to the parameters store
|
|
30
31
|
* @param {string} id scoped id of the resource
|