@jaypie/constructs 1.1.37 → 1.1.38
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/JaypieLambda.d.ts +41 -1
- package/dist/cjs/index.cjs +62 -18
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/JaypieLambda.d.ts +41 -1
- package/dist/esm/index.js +62 -18
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -7,17 +7,32 @@ import * as ec2 from "aws-cdk-lib/aws-ec2";
|
|
|
7
7
|
import * as secretsmanager from "aws-cdk-lib/aws-secretsmanager";
|
|
8
8
|
import { JaypieEnvSecret } from "./JaypieEnvSecret.js";
|
|
9
9
|
export interface JaypieLambdaProps {
|
|
10
|
+
allowAllOutbound?: boolean;
|
|
11
|
+
allowPublicSubnet?: boolean;
|
|
12
|
+
architecture?: lambda.Architecture;
|
|
10
13
|
code: lambda.Code | string;
|
|
14
|
+
codeSigningConfig?: lambda.ICodeSigningConfig;
|
|
11
15
|
datadogApiKeyArn?: string;
|
|
16
|
+
deadLetterQueue?: import("aws-cdk-lib/aws-sqs").IQueue;
|
|
17
|
+
deadLetterQueueEnabled?: boolean;
|
|
18
|
+
deadLetterTopic?: import("aws-cdk-lib/aws-sns").ITopic;
|
|
19
|
+
description?: string;
|
|
12
20
|
environment?: {
|
|
13
21
|
[key: string]: string;
|
|
14
22
|
};
|
|
23
|
+
environmentEncryption?: import("aws-cdk-lib/aws-kms").IKey;
|
|
15
24
|
envSecrets?: {
|
|
16
25
|
[key: string]: secretsmanager.ISecret;
|
|
17
26
|
};
|
|
27
|
+
ephemeralStorageSize?: import("aws-cdk-lib").Size;
|
|
28
|
+
filesystem?: lambda.FileSystemConfig;
|
|
18
29
|
handler: string;
|
|
30
|
+
initialPolicy?: iam.PolicyStatement[];
|
|
19
31
|
layers?: lambda.ILayerVersion[];
|
|
20
32
|
logRetention?: number;
|
|
33
|
+
logRetentionRole?: iam.IRole;
|
|
34
|
+
logRetentionRetryOptions?: lambda.LogRetentionRetryOptions;
|
|
35
|
+
maxEventAge?: Duration;
|
|
21
36
|
memorySize?: number;
|
|
22
37
|
paramsAndSecrets?: lambda.ParamsAndSecretsLayerVersion | boolean;
|
|
23
38
|
paramsAndSecretsOptions?: {
|
|
@@ -26,13 +41,18 @@ export interface JaypieLambdaProps {
|
|
|
26
41
|
parameterStoreTtl?: number;
|
|
27
42
|
secretsManagerTtl?: number;
|
|
28
43
|
};
|
|
44
|
+
profiling?: boolean;
|
|
45
|
+
profilingGroup?: import("aws-cdk-lib/aws-codeguruprofiler").IProfilingGroup;
|
|
29
46
|
provisionedConcurrentExecutions?: number;
|
|
30
47
|
reservedConcurrentExecutions?: number;
|
|
48
|
+
retryAttempts?: number;
|
|
31
49
|
roleTag?: string;
|
|
32
50
|
runtime?: lambda.Runtime;
|
|
51
|
+
runtimeManagementMode?: lambda.RuntimeManagementMode;
|
|
33
52
|
secrets?: JaypieEnvSecret[];
|
|
34
53
|
securityGroups?: ec2.ISecurityGroup[];
|
|
35
54
|
timeout?: Duration | number;
|
|
55
|
+
tracing?: lambda.Tracing;
|
|
36
56
|
vendorTag?: string;
|
|
37
57
|
vpc?: ec2.IVpc;
|
|
38
58
|
vpcSubnets?: ec2.SubnetSelection;
|
|
@@ -52,6 +72,24 @@ export declare class JaypieLambda extends Construct implements lambda.IFunction
|
|
|
52
72
|
private readonly _securityGroups?;
|
|
53
73
|
private readonly _reservedConcurrentExecutions?;
|
|
54
74
|
private readonly _layers;
|
|
75
|
+
private readonly _architecture;
|
|
76
|
+
private readonly _ephemeralStorageSize?;
|
|
77
|
+
private readonly _codeSigningConfig?;
|
|
78
|
+
private readonly _filesystemConfigs?;
|
|
79
|
+
private readonly _environmentEncryption?;
|
|
80
|
+
private readonly _tracing?;
|
|
81
|
+
private readonly _profiling?;
|
|
82
|
+
private readonly _profilingGroup?;
|
|
83
|
+
private readonly _logRetentionRole?;
|
|
84
|
+
private readonly _logRetentionRetryOptions?;
|
|
85
|
+
private readonly _initialPolicy?;
|
|
86
|
+
private readonly _description?;
|
|
87
|
+
private readonly _maxEventAge?;
|
|
88
|
+
private readonly _retryAttempts?;
|
|
89
|
+
private readonly _runtimeManagementMode?;
|
|
90
|
+
private readonly _allowAllOutbound?;
|
|
91
|
+
private readonly _allowPublicSubnet?;
|
|
92
|
+
private readonly _deadLetterQueueEnabled?;
|
|
55
93
|
constructor(scope: Construct, id: string, props: JaypieLambdaProps);
|
|
56
94
|
get lambda(): lambda.Function;
|
|
57
95
|
get provisioned(): lambda.Alias | undefined;
|
|
@@ -112,7 +150,7 @@ export declare class JaypieLambda extends Construct implements lambda.IFunction
|
|
|
112
150
|
get retryAttempts(): number | undefined;
|
|
113
151
|
get reservedConcurrentExecutions(): number | undefined;
|
|
114
152
|
get description(): string | undefined;
|
|
115
|
-
get initialPolicy(): iam.
|
|
153
|
+
get initialPolicy(): iam.PolicyStatement[] | undefined;
|
|
116
154
|
get logRetentionRole(): iam.IRole | undefined;
|
|
117
155
|
get logRetentionRetryOptions(): lambda.LogRetentionRetryOptions | undefined;
|
|
118
156
|
get tracing(): lambda.Tracing | undefined;
|
|
@@ -131,4 +169,6 @@ export declare class JaypieLambda extends Construct implements lambda.IFunction
|
|
|
131
169
|
get allowAllOutbound(): boolean | undefined;
|
|
132
170
|
get allowPublicSubnet(): boolean | undefined;
|
|
133
171
|
get canCreateLambdaLogGroup(): boolean;
|
|
172
|
+
get canCreatePermissions(): boolean;
|
|
173
|
+
get deadLetterQueueEnabled(): boolean | undefined;
|
|
134
174
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -290,7 +290,7 @@ class JaypieAppStack extends JaypieStack {
|
|
|
290
290
|
class JaypieLambda extends Construct {
|
|
291
291
|
constructor(scope, id, props) {
|
|
292
292
|
super(scope, id);
|
|
293
|
-
const { code, datadogApiKeyArn, environment: initialEnvironment = {}, envSecrets = {}, handler = "index.handler", layers = [], logRetention = CDK$2.LAMBDA.LOG_RETENTION, memorySize = CDK$2.LAMBDA.MEMORY_SIZE, paramsAndSecrets, paramsAndSecretsOptions, provisionedConcurrentExecutions, reservedConcurrentExecutions, roleTag = CDK$2.ROLE.PROCESSING, runtime = lambda.Runtime.NODEJS_22_X, secrets = [], securityGroups, timeout = Duration.seconds(CDK$2.DURATION.LAMBDA_WORKER), vendorTag, vpc, vpcSubnets, } = props;
|
|
293
|
+
const { allowAllOutbound, allowPublicSubnet, architecture = lambda.Architecture.X86_64, code, codeSigningConfig, datadogApiKeyArn, deadLetterQueue, deadLetterQueueEnabled, deadLetterTopic, description, environment: initialEnvironment = {}, environmentEncryption, envSecrets = {}, ephemeralStorageSize, filesystem, handler = "index.handler", initialPolicy, layers = [], logRetention = CDK$2.LAMBDA.LOG_RETENTION, logRetentionRole, logRetentionRetryOptions, maxEventAge, memorySize = CDK$2.LAMBDA.MEMORY_SIZE, paramsAndSecrets, paramsAndSecretsOptions, profiling, profilingGroup, provisionedConcurrentExecutions, reservedConcurrentExecutions, retryAttempts, roleTag = CDK$2.ROLE.PROCESSING, runtime = lambda.Runtime.NODEJS_22_X, runtimeManagementMode, secrets = [], securityGroups, timeout = Duration.seconds(CDK$2.DURATION.LAMBDA_WORKER), tracing, vendorTag, vpc, vpcSubnets, } = props;
|
|
294
294
|
// Create a mutable copy of the environment variables
|
|
295
295
|
let environment = { ...initialEnvironment };
|
|
296
296
|
// Default environment values
|
|
@@ -404,21 +404,41 @@ class JaypieLambda extends Construct {
|
|
|
404
404
|
}, {});
|
|
405
405
|
// Create Lambda Function
|
|
406
406
|
this._lambda = new lambda.Function(this, "Function", {
|
|
407
|
+
allowAllOutbound,
|
|
408
|
+
allowPublicSubnet,
|
|
409
|
+
architecture,
|
|
407
410
|
code: this._code,
|
|
411
|
+
codeSigningConfig,
|
|
412
|
+
deadLetterQueue,
|
|
413
|
+
deadLetterQueueEnabled,
|
|
414
|
+
deadLetterTopic,
|
|
415
|
+
description,
|
|
408
416
|
environment: {
|
|
409
417
|
...environment,
|
|
410
418
|
...secretsEnvironment,
|
|
411
419
|
...jaypieSecretsEnvironment,
|
|
412
420
|
},
|
|
421
|
+
environmentEncryption,
|
|
422
|
+
ephemeralStorageSize,
|
|
423
|
+
filesystem: filesystem ? { config: filesystem } : undefined,
|
|
413
424
|
handler,
|
|
425
|
+
initialPolicy,
|
|
414
426
|
layers: resolvedLayers,
|
|
415
427
|
logRetention,
|
|
428
|
+
logRetentionRole,
|
|
429
|
+
logRetentionRetryOptions,
|
|
430
|
+
maxEventAge,
|
|
416
431
|
memorySize,
|
|
417
432
|
paramsAndSecrets: resolvedParamsAndSecrets,
|
|
433
|
+
profiling,
|
|
434
|
+
profilingGroup,
|
|
418
435
|
reservedConcurrentExecutions,
|
|
436
|
+
retryAttempts,
|
|
419
437
|
runtime,
|
|
438
|
+
runtimeManagementMode,
|
|
420
439
|
securityGroups,
|
|
421
440
|
timeout: typeof timeout === "number" ? Duration.seconds(timeout) : timeout,
|
|
441
|
+
tracing,
|
|
422
442
|
vpc,
|
|
423
443
|
vpcSubnets,
|
|
424
444
|
// Enable auto-publishing of versions when using provisioned concurrency
|
|
@@ -478,6 +498,24 @@ class JaypieLambda extends Construct {
|
|
|
478
498
|
this._securityGroups = securityGroups;
|
|
479
499
|
this._reservedConcurrentExecutions = reservedConcurrentExecutions;
|
|
480
500
|
this._layers = resolvedLayers;
|
|
501
|
+
this._architecture = architecture;
|
|
502
|
+
this._ephemeralStorageSize = ephemeralStorageSize?.toMebibytes();
|
|
503
|
+
this._codeSigningConfig = codeSigningConfig;
|
|
504
|
+
this._filesystemConfigs = filesystem ? [filesystem] : undefined;
|
|
505
|
+
this._environmentEncryption = environmentEncryption;
|
|
506
|
+
this._tracing = tracing;
|
|
507
|
+
this._profiling = profiling;
|
|
508
|
+
this._profilingGroup = profilingGroup;
|
|
509
|
+
this._logRetentionRole = logRetentionRole;
|
|
510
|
+
this._logRetentionRetryOptions = logRetentionRetryOptions;
|
|
511
|
+
this._initialPolicy = initialPolicy;
|
|
512
|
+
this._description = description;
|
|
513
|
+
this._maxEventAge = maxEventAge;
|
|
514
|
+
this._retryAttempts = retryAttempts;
|
|
515
|
+
this._runtimeManagementMode = runtimeManagementMode;
|
|
516
|
+
this._allowAllOutbound = allowAllOutbound;
|
|
517
|
+
this._allowPublicSubnet = allowPublicSubnet;
|
|
518
|
+
this._deadLetterQueueEnabled = deadLetterQueueEnabled;
|
|
481
519
|
// Assign _reference based on provisioned state
|
|
482
520
|
this._reference =
|
|
483
521
|
this._provisioned !== undefined ? this._provisioned : this._lambda;
|
|
@@ -657,52 +695,52 @@ class JaypieLambda extends Construct {
|
|
|
657
695
|
return this._layers;
|
|
658
696
|
}
|
|
659
697
|
get maxEventAge() {
|
|
660
|
-
return
|
|
698
|
+
return this._maxEventAge;
|
|
661
699
|
}
|
|
662
700
|
get retryAttempts() {
|
|
663
|
-
return
|
|
701
|
+
return this._retryAttempts;
|
|
664
702
|
}
|
|
665
703
|
get reservedConcurrentExecutions() {
|
|
666
704
|
return this._reservedConcurrentExecutions;
|
|
667
705
|
}
|
|
668
706
|
get description() {
|
|
669
|
-
return
|
|
707
|
+
return this._description;
|
|
670
708
|
}
|
|
671
709
|
get initialPolicy() {
|
|
672
|
-
return
|
|
710
|
+
return this._initialPolicy;
|
|
673
711
|
}
|
|
674
712
|
get logRetentionRole() {
|
|
675
|
-
return
|
|
713
|
+
return this._logRetentionRole;
|
|
676
714
|
}
|
|
677
715
|
get logRetentionRetryOptions() {
|
|
678
|
-
return
|
|
716
|
+
return this._logRetentionRetryOptions;
|
|
679
717
|
}
|
|
680
718
|
get tracing() {
|
|
681
|
-
return
|
|
719
|
+
return this._tracing;
|
|
682
720
|
}
|
|
683
721
|
get profiling() {
|
|
684
|
-
return
|
|
722
|
+
return this._profiling;
|
|
685
723
|
}
|
|
686
724
|
get profilingGroup() {
|
|
687
|
-
return
|
|
725
|
+
return this._profilingGroup;
|
|
688
726
|
}
|
|
689
727
|
get environmentEncryption() {
|
|
690
|
-
return
|
|
728
|
+
return this._environmentEncryption;
|
|
691
729
|
}
|
|
692
730
|
get codeSigningConfig() {
|
|
693
|
-
return
|
|
731
|
+
return this._codeSigningConfig;
|
|
694
732
|
}
|
|
695
733
|
get filesystemConfig() {
|
|
696
|
-
return
|
|
734
|
+
return this._filesystemConfigs?.[0];
|
|
697
735
|
}
|
|
698
736
|
get filesystemConfigs() {
|
|
699
|
-
return
|
|
737
|
+
return this._filesystemConfigs;
|
|
700
738
|
}
|
|
701
739
|
get ephemeralStorageSize() {
|
|
702
|
-
return
|
|
740
|
+
return this._ephemeralStorageSize;
|
|
703
741
|
}
|
|
704
742
|
get runtimeManagementMode() {
|
|
705
|
-
return
|
|
743
|
+
return this._runtimeManagementMode;
|
|
706
744
|
}
|
|
707
745
|
get architectureLabel() {
|
|
708
746
|
return this._lambda.architecture.name;
|
|
@@ -717,14 +755,20 @@ class JaypieLambda extends Construct {
|
|
|
717
755
|
return this._securityGroups;
|
|
718
756
|
}
|
|
719
757
|
get allowAllOutbound() {
|
|
720
|
-
return
|
|
758
|
+
return this._allowAllOutbound;
|
|
721
759
|
}
|
|
722
760
|
get allowPublicSubnet() {
|
|
723
|
-
return
|
|
761
|
+
return this._allowPublicSubnet;
|
|
724
762
|
}
|
|
725
763
|
get canCreateLambdaLogGroup() {
|
|
726
764
|
return true;
|
|
727
765
|
}
|
|
766
|
+
get canCreatePermissions() {
|
|
767
|
+
return true;
|
|
768
|
+
}
|
|
769
|
+
get deadLetterQueueEnabled() {
|
|
770
|
+
return this._lambda.deadLetterQueue !== undefined || this._lambda.deadLetterTopic !== undefined;
|
|
771
|
+
}
|
|
728
772
|
}
|
|
729
773
|
|
|
730
774
|
class JaypieQueuedLambda extends Construct {
|