@certenza/aws-cdk-infrastructure-commons 2.5.1 → 2.5.2
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/lambda.js +6 -8
- package/package.json +1 -1
package/dist/src/lambda.js
CHANGED
|
@@ -42,7 +42,7 @@ const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
|
|
|
42
42
|
const nodejs = __importStar(require("aws-cdk-lib/aws-lambda-nodejs"));
|
|
43
43
|
const logs = __importStar(require("aws-cdk-lib/aws-logs"));
|
|
44
44
|
const apigateway = __importStar(require("aws-cdk-lib/aws-apigateway"));
|
|
45
|
-
const
|
|
45
|
+
const ssm = __importStar(require("aws-cdk-lib/aws-ssm"));
|
|
46
46
|
/**
|
|
47
47
|
* Creates a lambda function with the given parameters
|
|
48
48
|
* @param scope - The scope of the lambda function
|
|
@@ -60,12 +60,10 @@ const createLambdaFunction = (scope, functionName, environment, props = {}) => {
|
|
|
60
60
|
const environmentVariables = props.environmentVariables ?? {};
|
|
61
61
|
// Define the options of the lambda function
|
|
62
62
|
const options = props.options ?? {};
|
|
63
|
-
// Get the
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
.secretValueFromJson("token")
|
|
68
|
-
.toString();
|
|
63
|
+
// Get the extra enforcement parameter from Parameter Store
|
|
64
|
+
const extraEnforcementParameter = ssm.StringParameter.fromStringParameterName(scope, `${id}-Extra-Enforcement-Parameter`, "Extra-Enforcement-Parameter");
|
|
65
|
+
// Get the extra enforcement parameter value
|
|
66
|
+
const extraEnforcementParameterValue = extraEnforcementParameter.stringValue;
|
|
69
67
|
// Create the lambda function
|
|
70
68
|
const lambdaFunction = new nodejs.NodejsFunction(scope, id, {
|
|
71
69
|
entry: `src/lambdas/${functionName}/handler.ts`,
|
|
@@ -77,7 +75,7 @@ const createLambdaFunction = (scope, functionName, environment, props = {}) => {
|
|
|
77
75
|
timeout: cdk.Duration.seconds(30),
|
|
78
76
|
environment: {
|
|
79
77
|
ENVIRONMENT: environment,
|
|
80
|
-
|
|
78
|
+
EXTRA_ENFORCEMENT_PARAMETER: extraEnforcementParameterValue,
|
|
81
79
|
NODE_ENV: environment === "production" ? "production" : "development",
|
|
82
80
|
...environmentVariables,
|
|
83
81
|
},
|
package/package.json
CHANGED