@certenza/aws-cdk-infrastructure-commons 2.5.1 → 2.5.3

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.
@@ -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 secretsmanager_1 = require("./secretsmanager");
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 internal api token from secrets manager
64
- // Use function name in the construct ID to ensure uniqueness when multiple functions are created
65
- const internalApiToken = (0, secretsmanager_1.getSecret)(scope, `${id}-Internal-API-Token`, "Internal-API-Token");
66
- const internalApiTokenValue = internalApiToken
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
- INTERNAL_API_TOKEN: internalApiTokenValue,
78
+ EXTRA_ENFORCEMENT_PARAMETER: extraEnforcementParameterValue,
81
79
  NODE_ENV: environment === "production" ? "production" : "development",
82
80
  ...environmentVariables,
83
81
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certenza/aws-cdk-infrastructure-commons",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "description": "Common infrastructure reusable utilities and resources for Certenza projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "homepage": "https://github.com/certenza/aws-cdk-infrastructure-commons#readme",
42
42
  "dependencies": {
43
- "aws-cdk-lib": "^2.235.0"
43
+ "aws-cdk-lib": "^2.235.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^24.0.0",