@jaypie/constructs 1.1.32 → 1.1.33
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/cjs/index.cjs +14 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +14 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -390,6 +390,14 @@ class JaypieLambda extends Construct {
|
|
|
390
390
|
reservedConcurrentExecutions,
|
|
391
391
|
runtime,
|
|
392
392
|
timeout: typeof timeout === "number" ? Duration.seconds(timeout) : timeout,
|
|
393
|
+
// Enable auto-publishing of versions when using provisioned concurrency
|
|
394
|
+
currentVersionOptions: provisionedConcurrentExecutions !== undefined
|
|
395
|
+
? {
|
|
396
|
+
removalPolicy: RemovalPolicy.RETAIN,
|
|
397
|
+
description: "Auto-published version for provisioned concurrency",
|
|
398
|
+
// Don't set provisioned concurrency here - it will be set on the alias
|
|
399
|
+
}
|
|
400
|
+
: undefined,
|
|
393
401
|
});
|
|
394
402
|
// Grant secret read permissions
|
|
395
403
|
Object.values(envSecrets).forEach((secret) => {
|
|
@@ -407,11 +415,16 @@ class JaypieLambda extends Construct {
|
|
|
407
415
|
}
|
|
408
416
|
// Configure provisioned concurrency if specified
|
|
409
417
|
if (provisionedConcurrentExecutions !== undefined) {
|
|
418
|
+
// Use currentVersion which is auto-published with proper configuration
|
|
419
|
+
const version = this._lambda.currentVersion;
|
|
420
|
+
// Create alias for provisioned concurrency
|
|
410
421
|
this._alias = new lambda.Alias(this, "ProvisionedAlias", {
|
|
411
422
|
aliasName: "provisioned",
|
|
412
|
-
version
|
|
423
|
+
version,
|
|
413
424
|
provisionedConcurrentExecutions,
|
|
414
425
|
});
|
|
426
|
+
// Add explicit dependencies to ensure proper creation order
|
|
427
|
+
this._alias.node.addDependency(version);
|
|
415
428
|
}
|
|
416
429
|
if (roleTag) {
|
|
417
430
|
Tags.of(this._lambda).add(CDK$2.TAG.ROLE, roleTag);
|