@jaypie/constructs 1.2.37 → 1.2.39
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.
|
@@ -8,6 +8,8 @@ export interface JaypieMigrationProps {
|
|
|
8
8
|
code: lambda.Code | string;
|
|
9
9
|
/** Constructs that must be created before the migration runs */
|
|
10
10
|
dependencies?: Construct[];
|
|
11
|
+
/** Environment variables for the migration Lambda */
|
|
12
|
+
environment?: Record<string, string> | (Record<string, string> | string)[];
|
|
11
13
|
/** Lambda handler entry point */
|
|
12
14
|
handler?: string;
|
|
13
15
|
/** Secrets to make available to the migration Lambda */
|
package/dist/esm/index.js
CHANGED
|
@@ -1557,7 +1557,7 @@ class JaypieQueuedLambda extends Construct {
|
|
|
1557
1557
|
super(scope, id);
|
|
1558
1558
|
const { allowAllOutbound, allowPublicSubnet, architecture, batchSize = 1, code, datadogApiKeyArn, deadLetterQueue, deadLetterQueueEnabled, deadLetterTopic, description, environment = {}, envSecrets = {}, ephemeralStorageSize, fifo = true, filesystem, handler = "index.handler", initialPolicy, layers = [], logGroup, logRetention = CDK$2.LAMBDA.LOG_RETENTION, maxEventAge, memorySize = CDK$2.LAMBDA.MEMORY_SIZE, paramsAndSecrets, paramsAndSecretsOptions, profiling, profilingGroup, provisionedConcurrentExecutions, reservedConcurrentExecutions, retryAttempts, roleTag, runtime = new lambda.Runtime("nodejs24.x", lambda.RuntimeFamily.NODEJS, {
|
|
1559
1559
|
supportsInlineCode: true,
|
|
1560
|
-
}), runtimeManagementMode, secrets = [], securityGroups, timeout = Duration.seconds(CDK$2.DURATION.LAMBDA_WORKER), tracing, vendorTag, visibilityTimeout = Duration.seconds(CDK$2.DURATION.LAMBDA_WORKER), vpc, vpcSubnets, } = props;
|
|
1560
|
+
}), runtimeManagementMode, secrets = [], securityGroups, tables = [], timeout = Duration.seconds(CDK$2.DURATION.LAMBDA_WORKER), tracing, vendorTag, visibilityTimeout = Duration.seconds(CDK$2.DURATION.LAMBDA_WORKER), vpc, vpcSubnets, } = props;
|
|
1561
1561
|
// Create SQS Queue
|
|
1562
1562
|
this._queue = new sqs.Queue(this, "Queue", {
|
|
1563
1563
|
fifo,
|
|
@@ -1605,6 +1605,7 @@ class JaypieQueuedLambda extends Construct {
|
|
|
1605
1605
|
runtimeManagementMode,
|
|
1606
1606
|
secrets,
|
|
1607
1607
|
securityGroups,
|
|
1608
|
+
tables,
|
|
1608
1609
|
timeout,
|
|
1609
1610
|
tracing,
|
|
1610
1611
|
vendorTag,
|
|
@@ -3394,11 +3395,12 @@ class JaypieInfrastructureStack extends JaypieStack {
|
|
|
3394
3395
|
class JaypieMigration extends Construct {
|
|
3395
3396
|
constructor(scope, id, props) {
|
|
3396
3397
|
super(scope, id);
|
|
3397
|
-
const { code, dependencies = [], handler = "index.handler", secrets = [], tables = [], } = props;
|
|
3398
|
+
const { code, dependencies = [], environment, handler = "index.handler", secrets = [], tables = [], } = props;
|
|
3398
3399
|
// Migration Lambda — 5 minute timeout for long-running migrations
|
|
3399
3400
|
this.lambda = new JaypieLambda(this, "MigrationLambda", {
|
|
3400
3401
|
code,
|
|
3401
3402
|
description: "DynamoDB migration custom resource",
|
|
3403
|
+
environment,
|
|
3402
3404
|
handler,
|
|
3403
3405
|
roleTag: CDK$2.ROLE.PROCESSING,
|
|
3404
3406
|
secrets,
|
|
@@ -3409,8 +3411,13 @@ class JaypieMigration extends Construct {
|
|
|
3409
3411
|
const provider = new cr.Provider(this, "MigrationProvider", {
|
|
3410
3412
|
onEventHandler: this.lambda,
|
|
3411
3413
|
});
|
|
3412
|
-
// Custom Resource that triggers on every deploy
|
|
3414
|
+
// Custom Resource that triggers on every deploy.
|
|
3415
|
+
// deployNonce forces CloudFormation to re-invoke the custom resource
|
|
3416
|
+
// even when only Lambda code changes (issue #261).
|
|
3413
3417
|
const resource = new cdk.CustomResource(this, "MigrationResource", {
|
|
3418
|
+
properties: {
|
|
3419
|
+
deployNonce: Date.now().toString(),
|
|
3420
|
+
},
|
|
3414
3421
|
serviceToken: provider.serviceToken,
|
|
3415
3422
|
});
|
|
3416
3423
|
// Ensure dependencies are created before the migration runs
|