@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/cjs/index.cjs
CHANGED
|
@@ -323,7 +323,7 @@ class JaypieAppStack extends JaypieStack {
|
|
|
323
323
|
class JaypieLambda extends constructs.Construct {
|
|
324
324
|
constructor(scope, id, props) {
|
|
325
325
|
super(scope, id);
|
|
326
|
-
const { code, datadogApiKeyArn, environment: initialEnvironment = {}, envSecrets = {}, handler = "index.handler", layers = [], logRetention = cdk.CDK.LAMBDA.LOG_RETENTION, memorySize = cdk.CDK.LAMBDA.MEMORY_SIZE, paramsAndSecrets, paramsAndSecretsOptions, provisionedConcurrentExecutions, reservedConcurrentExecutions, roleTag = cdk.CDK.ROLE.PROCESSING, runtime = lambda__namespace.Runtime.NODEJS_22_X, secrets = [], securityGroups, timeout = cdk$1.Duration.seconds(cdk.CDK.DURATION.LAMBDA_WORKER), vendorTag, vpc, vpcSubnets, } = props;
|
|
326
|
+
const { allowAllOutbound, allowPublicSubnet, architecture = lambda__namespace.Architecture.X86_64, code, codeSigningConfig, datadogApiKeyArn, deadLetterQueue, deadLetterQueueEnabled, deadLetterTopic, description, environment: initialEnvironment = {}, environmentEncryption, envSecrets = {}, ephemeralStorageSize, filesystem, handler = "index.handler", initialPolicy, layers = [], logRetention = cdk.CDK.LAMBDA.LOG_RETENTION, logRetentionRole, logRetentionRetryOptions, maxEventAge, memorySize = cdk.CDK.LAMBDA.MEMORY_SIZE, paramsAndSecrets, paramsAndSecretsOptions, profiling, profilingGroup, provisionedConcurrentExecutions, reservedConcurrentExecutions, retryAttempts, roleTag = cdk.CDK.ROLE.PROCESSING, runtime = lambda__namespace.Runtime.NODEJS_22_X, runtimeManagementMode, secrets = [], securityGroups, timeout = cdk$1.Duration.seconds(cdk.CDK.DURATION.LAMBDA_WORKER), tracing, vendorTag, vpc, vpcSubnets, } = props;
|
|
327
327
|
// Create a mutable copy of the environment variables
|
|
328
328
|
let environment = { ...initialEnvironment };
|
|
329
329
|
// Default environment values
|
|
@@ -437,21 +437,41 @@ class JaypieLambda extends constructs.Construct {
|
|
|
437
437
|
}, {});
|
|
438
438
|
// Create Lambda Function
|
|
439
439
|
this._lambda = new lambda__namespace.Function(this, "Function", {
|
|
440
|
+
allowAllOutbound,
|
|
441
|
+
allowPublicSubnet,
|
|
442
|
+
architecture,
|
|
440
443
|
code: this._code,
|
|
444
|
+
codeSigningConfig,
|
|
445
|
+
deadLetterQueue,
|
|
446
|
+
deadLetterQueueEnabled,
|
|
447
|
+
deadLetterTopic,
|
|
448
|
+
description,
|
|
441
449
|
environment: {
|
|
442
450
|
...environment,
|
|
443
451
|
...secretsEnvironment,
|
|
444
452
|
...jaypieSecretsEnvironment,
|
|
445
453
|
},
|
|
454
|
+
environmentEncryption,
|
|
455
|
+
ephemeralStorageSize,
|
|
456
|
+
filesystem: filesystem ? { config: filesystem } : undefined,
|
|
446
457
|
handler,
|
|
458
|
+
initialPolicy,
|
|
447
459
|
layers: resolvedLayers,
|
|
448
460
|
logRetention,
|
|
461
|
+
logRetentionRole,
|
|
462
|
+
logRetentionRetryOptions,
|
|
463
|
+
maxEventAge,
|
|
449
464
|
memorySize,
|
|
450
465
|
paramsAndSecrets: resolvedParamsAndSecrets,
|
|
466
|
+
profiling,
|
|
467
|
+
profilingGroup,
|
|
451
468
|
reservedConcurrentExecutions,
|
|
469
|
+
retryAttempts,
|
|
452
470
|
runtime,
|
|
471
|
+
runtimeManagementMode,
|
|
453
472
|
securityGroups,
|
|
454
473
|
timeout: typeof timeout === "number" ? cdk$1.Duration.seconds(timeout) : timeout,
|
|
474
|
+
tracing,
|
|
455
475
|
vpc,
|
|
456
476
|
vpcSubnets,
|
|
457
477
|
// Enable auto-publishing of versions when using provisioned concurrency
|
|
@@ -511,6 +531,24 @@ class JaypieLambda extends constructs.Construct {
|
|
|
511
531
|
this._securityGroups = securityGroups;
|
|
512
532
|
this._reservedConcurrentExecutions = reservedConcurrentExecutions;
|
|
513
533
|
this._layers = resolvedLayers;
|
|
534
|
+
this._architecture = architecture;
|
|
535
|
+
this._ephemeralStorageSize = ephemeralStorageSize?.toMebibytes();
|
|
536
|
+
this._codeSigningConfig = codeSigningConfig;
|
|
537
|
+
this._filesystemConfigs = filesystem ? [filesystem] : undefined;
|
|
538
|
+
this._environmentEncryption = environmentEncryption;
|
|
539
|
+
this._tracing = tracing;
|
|
540
|
+
this._profiling = profiling;
|
|
541
|
+
this._profilingGroup = profilingGroup;
|
|
542
|
+
this._logRetentionRole = logRetentionRole;
|
|
543
|
+
this._logRetentionRetryOptions = logRetentionRetryOptions;
|
|
544
|
+
this._initialPolicy = initialPolicy;
|
|
545
|
+
this._description = description;
|
|
546
|
+
this._maxEventAge = maxEventAge;
|
|
547
|
+
this._retryAttempts = retryAttempts;
|
|
548
|
+
this._runtimeManagementMode = runtimeManagementMode;
|
|
549
|
+
this._allowAllOutbound = allowAllOutbound;
|
|
550
|
+
this._allowPublicSubnet = allowPublicSubnet;
|
|
551
|
+
this._deadLetterQueueEnabled = deadLetterQueueEnabled;
|
|
514
552
|
// Assign _reference based on provisioned state
|
|
515
553
|
this._reference =
|
|
516
554
|
this._provisioned !== undefined ? this._provisioned : this._lambda;
|
|
@@ -690,52 +728,52 @@ class JaypieLambda extends constructs.Construct {
|
|
|
690
728
|
return this._layers;
|
|
691
729
|
}
|
|
692
730
|
get maxEventAge() {
|
|
693
|
-
return
|
|
731
|
+
return this._maxEventAge;
|
|
694
732
|
}
|
|
695
733
|
get retryAttempts() {
|
|
696
|
-
return
|
|
734
|
+
return this._retryAttempts;
|
|
697
735
|
}
|
|
698
736
|
get reservedConcurrentExecutions() {
|
|
699
737
|
return this._reservedConcurrentExecutions;
|
|
700
738
|
}
|
|
701
739
|
get description() {
|
|
702
|
-
return
|
|
740
|
+
return this._description;
|
|
703
741
|
}
|
|
704
742
|
get initialPolicy() {
|
|
705
|
-
return
|
|
743
|
+
return this._initialPolicy;
|
|
706
744
|
}
|
|
707
745
|
get logRetentionRole() {
|
|
708
|
-
return
|
|
746
|
+
return this._logRetentionRole;
|
|
709
747
|
}
|
|
710
748
|
get logRetentionRetryOptions() {
|
|
711
|
-
return
|
|
749
|
+
return this._logRetentionRetryOptions;
|
|
712
750
|
}
|
|
713
751
|
get tracing() {
|
|
714
|
-
return
|
|
752
|
+
return this._tracing;
|
|
715
753
|
}
|
|
716
754
|
get profiling() {
|
|
717
|
-
return
|
|
755
|
+
return this._profiling;
|
|
718
756
|
}
|
|
719
757
|
get profilingGroup() {
|
|
720
|
-
return
|
|
758
|
+
return this._profilingGroup;
|
|
721
759
|
}
|
|
722
760
|
get environmentEncryption() {
|
|
723
|
-
return
|
|
761
|
+
return this._environmentEncryption;
|
|
724
762
|
}
|
|
725
763
|
get codeSigningConfig() {
|
|
726
|
-
return
|
|
764
|
+
return this._codeSigningConfig;
|
|
727
765
|
}
|
|
728
766
|
get filesystemConfig() {
|
|
729
|
-
return
|
|
767
|
+
return this._filesystemConfigs?.[0];
|
|
730
768
|
}
|
|
731
769
|
get filesystemConfigs() {
|
|
732
|
-
return
|
|
770
|
+
return this._filesystemConfigs;
|
|
733
771
|
}
|
|
734
772
|
get ephemeralStorageSize() {
|
|
735
|
-
return
|
|
773
|
+
return this._ephemeralStorageSize;
|
|
736
774
|
}
|
|
737
775
|
get runtimeManagementMode() {
|
|
738
|
-
return
|
|
776
|
+
return this._runtimeManagementMode;
|
|
739
777
|
}
|
|
740
778
|
get architectureLabel() {
|
|
741
779
|
return this._lambda.architecture.name;
|
|
@@ -750,14 +788,20 @@ class JaypieLambda extends constructs.Construct {
|
|
|
750
788
|
return this._securityGroups;
|
|
751
789
|
}
|
|
752
790
|
get allowAllOutbound() {
|
|
753
|
-
return
|
|
791
|
+
return this._allowAllOutbound;
|
|
754
792
|
}
|
|
755
793
|
get allowPublicSubnet() {
|
|
756
|
-
return
|
|
794
|
+
return this._allowPublicSubnet;
|
|
757
795
|
}
|
|
758
796
|
get canCreateLambdaLogGroup() {
|
|
759
797
|
return true;
|
|
760
798
|
}
|
|
799
|
+
get canCreatePermissions() {
|
|
800
|
+
return true;
|
|
801
|
+
}
|
|
802
|
+
get deadLetterQueueEnabled() {
|
|
803
|
+
return this._lambda.deadLetterQueue !== undefined || this._lambda.deadLetterTopic !== undefined;
|
|
804
|
+
}
|
|
761
805
|
}
|
|
762
806
|
|
|
763
807
|
class JaypieQueuedLambda extends constructs.Construct {
|