@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/cjs/index.cjs
CHANGED
|
@@ -1593,7 +1593,7 @@ class JaypieQueuedLambda extends constructs.Construct {
|
|
|
1593
1593
|
super(scope, id);
|
|
1594
1594
|
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__namespace.Runtime("nodejs24.x", lambda__namespace.RuntimeFamily.NODEJS, {
|
|
1595
1595
|
supportsInlineCode: true,
|
|
1596
|
-
}), runtimeManagementMode, secrets = [], securityGroups, timeout = cdk.Duration.seconds(CDK$2.DURATION.LAMBDA_WORKER), tracing, vendorTag, visibilityTimeout = cdk.Duration.seconds(CDK$2.DURATION.LAMBDA_WORKER), vpc, vpcSubnets, } = props;
|
|
1596
|
+
}), runtimeManagementMode, secrets = [], securityGroups, tables = [], timeout = cdk.Duration.seconds(CDK$2.DURATION.LAMBDA_WORKER), tracing, vendorTag, visibilityTimeout = cdk.Duration.seconds(CDK$2.DURATION.LAMBDA_WORKER), vpc, vpcSubnets, } = props;
|
|
1597
1597
|
// Create SQS Queue
|
|
1598
1598
|
this._queue = new sqs__namespace.Queue(this, "Queue", {
|
|
1599
1599
|
fifo,
|
|
@@ -1641,6 +1641,7 @@ class JaypieQueuedLambda extends constructs.Construct {
|
|
|
1641
1641
|
runtimeManagementMode,
|
|
1642
1642
|
secrets,
|
|
1643
1643
|
securityGroups,
|
|
1644
|
+
tables,
|
|
1644
1645
|
timeout,
|
|
1645
1646
|
tracing,
|
|
1646
1647
|
vendorTag,
|
|
@@ -3430,11 +3431,12 @@ class JaypieInfrastructureStack extends JaypieStack {
|
|
|
3430
3431
|
class JaypieMigration extends constructs.Construct {
|
|
3431
3432
|
constructor(scope, id, props) {
|
|
3432
3433
|
super(scope, id);
|
|
3433
|
-
const { code, dependencies = [], handler = "index.handler", secrets = [], tables = [], } = props;
|
|
3434
|
+
const { code, dependencies = [], environment, handler = "index.handler", secrets = [], tables = [], } = props;
|
|
3434
3435
|
// Migration Lambda — 5 minute timeout for long-running migrations
|
|
3435
3436
|
this.lambda = new JaypieLambda(this, "MigrationLambda", {
|
|
3436
3437
|
code,
|
|
3437
3438
|
description: "DynamoDB migration custom resource",
|
|
3439
|
+
environment,
|
|
3438
3440
|
handler,
|
|
3439
3441
|
roleTag: CDK$2.ROLE.PROCESSING,
|
|
3440
3442
|
secrets,
|
|
@@ -3445,8 +3447,13 @@ class JaypieMigration extends constructs.Construct {
|
|
|
3445
3447
|
const provider = new cr__namespace.Provider(this, "MigrationProvider", {
|
|
3446
3448
|
onEventHandler: this.lambda,
|
|
3447
3449
|
});
|
|
3448
|
-
// Custom Resource that triggers on every deploy
|
|
3450
|
+
// Custom Resource that triggers on every deploy.
|
|
3451
|
+
// deployNonce forces CloudFormation to re-invoke the custom resource
|
|
3452
|
+
// even when only Lambda code changes (issue #261).
|
|
3449
3453
|
const resource = new cdk__namespace.CustomResource(this, "MigrationResource", {
|
|
3454
|
+
properties: {
|
|
3455
|
+
deployNonce: Date.now().toString(),
|
|
3456
|
+
},
|
|
3450
3457
|
serviceToken: provider.serviceToken,
|
|
3451
3458
|
});
|
|
3452
3459
|
// Ensure dependencies are created before the migration runs
|