@jaypie/constructs 1.1.38 → 1.1.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.
@@ -25,7 +25,7 @@ export interface JaypieLambdaProps {
25
25
  [key: string]: secretsmanager.ISecret;
26
26
  };
27
27
  ephemeralStorageSize?: import("aws-cdk-lib").Size;
28
- filesystem?: lambda.FileSystemConfig;
28
+ filesystem?: lambda.FileSystem;
29
29
  handler: string;
30
30
  initialPolicy?: iam.PolicyStatement[];
31
31
  layers?: lambda.ILayerVersion[];
@@ -60,40 +60,10 @@ export interface JaypieLambdaProps {
60
60
  export declare class JaypieLambda extends Construct implements lambda.IFunction {
61
61
  private readonly _lambda;
62
62
  private readonly _provisioned?;
63
- private readonly _code;
64
63
  private readonly _reference;
65
- private readonly _handler;
66
- private readonly _memorySize;
67
- private readonly _timeout;
68
- private readonly _runtime;
69
- private readonly _environment;
70
- private readonly _vpc?;
71
- private readonly _vpcSubnets?;
72
- private readonly _securityGroups?;
73
- private readonly _reservedConcurrentExecutions?;
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?;
93
64
  constructor(scope: Construct, id: string, props: JaypieLambdaProps);
94
65
  get lambda(): lambda.Function;
95
66
  get provisioned(): lambda.Alias | undefined;
96
- get code(): lambda.Code;
97
67
  get reference(): lambda.IFunction;
98
68
  get functionArn(): string;
99
69
  get functionName(): string;
@@ -110,65 +80,21 @@ export declare class JaypieLambda extends Construct implements lambda.IFunction
110
80
  addFunctionUrl(options?: lambda.FunctionUrlOptions): lambda.FunctionUrl;
111
81
  addPermission(id: string, permission: lambda.Permission): void;
112
82
  addToRolePolicy(statement: iam.PolicyStatement): void;
113
- addEnvironment(key: string, value: string, options?: lambda.EnvironmentOptions): lambda.Function;
114
83
  configureAsyncInvoke(options: lambda.EventInvokeConfigOptions): void;
115
84
  grantInvoke(grantee: iam.IGrantable): iam.Grant;
116
85
  grantInvokeCompositePrincipal(compositePrincipal: iam.CompositePrincipal): iam.Grant[];
117
86
  grantInvokeUrl(grantee: iam.IGrantable): iam.Grant;
87
+ grantInvokeLatestVersion(grantee: iam.IGrantable): iam.Grant;
88
+ grantInvokeVersion(grantee: iam.IGrantable, version: lambda.IVersion): iam.Grant;
118
89
  metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
119
90
  metricDuration(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
120
91
  metricErrors(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
121
92
  metricInvocations(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
122
93
  metricThrottles(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
123
- grantInvokeLatestVersion(grantee: iam.IGrantable): iam.Grant;
124
- grantInvokeVersion(grantee: iam.IGrantable, version: lambda.Version): iam.Grant;
125
94
  get env(): {
126
95
  account: string;
127
96
  region: string;
128
97
  };
129
98
  get stack(): Stack;
130
99
  applyRemovalPolicy(policy: RemovalPolicy): void;
131
- get currentVersion(): lambda.Version;
132
- get deadLetterQueue(): import("aws-cdk-lib/aws-sqs").IQueue | undefined;
133
- get deadLetterTopic(): import("aws-cdk-lib/aws-sns").ITopic | undefined;
134
- get logGroup(): import("aws-cdk-lib/aws-logs").ILogGroup;
135
- get runtime(): lambda.Runtime;
136
- get timeout(): Duration | undefined;
137
- addAlias(aliasName: string, options?: lambda.AliasOptions): lambda.Alias;
138
- addLayers(...layers: lambda.ILayerVersion[]): void;
139
- invalidateVersionBasedOn(x: string): void;
140
- metricConcurrentExecutions(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
141
- metricUnreservedConcurrentExecutions(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
142
- addVersion(name: string, codeSha256?: string, description?: string, provisionedExecutions?: number, asyncInvokeConfig?: lambda.EventInvokeConfigOptions): lambda.Version;
143
- get memorySize(): number | undefined;
144
- get handler(): string;
145
- get environment(): {
146
- [key: string]: string;
147
- } | undefined;
148
- get layers(): lambda.ILayerVersion[] | undefined;
149
- get maxEventAge(): Duration | undefined;
150
- get retryAttempts(): number | undefined;
151
- get reservedConcurrentExecutions(): number | undefined;
152
- get description(): string | undefined;
153
- get initialPolicy(): iam.PolicyStatement[] | undefined;
154
- get logRetentionRole(): iam.IRole | undefined;
155
- get logRetentionRetryOptions(): lambda.LogRetentionRetryOptions | undefined;
156
- get tracing(): lambda.Tracing | undefined;
157
- get profiling(): boolean | undefined;
158
- get profilingGroup(): import("aws-cdk-lib/aws-codeguruprofiler").IProfilingGroup | undefined;
159
- get environmentEncryption(): import("aws-cdk-lib/aws-kms").IKey | undefined;
160
- get codeSigningConfig(): lambda.ICodeSigningConfig | undefined;
161
- get filesystemConfig(): lambda.FileSystemConfig | undefined;
162
- get filesystemConfigs(): lambda.FileSystemConfig[] | undefined;
163
- get ephemeralStorageSize(): number | undefined;
164
- get runtimeManagementMode(): lambda.RuntimeManagementMode | undefined;
165
- get architectureLabel(): string;
166
- get vpc(): ec2.IVpc | undefined;
167
- get vpcSubnets(): ec2.SubnetSelection | undefined;
168
- get securityGroups(): ec2.ISecurityGroup[] | undefined;
169
- get allowAllOutbound(): boolean | undefined;
170
- get allowPublicSubnet(): boolean | undefined;
171
- get canCreateLambdaLogGroup(): boolean;
172
- get canCreatePermissions(): boolean;
173
- get deadLetterQueueEnabled(): boolean | undefined;
174
100
  }
@@ -12,7 +12,6 @@ var s3n = require('aws-cdk-lib/aws-s3-notifications');
12
12
  var lambda = require('aws-cdk-lib/aws-lambda');
13
13
  var sqs = require('aws-cdk-lib/aws-sqs');
14
14
  var lambdaEventSources = require('aws-cdk-lib/aws-lambda-event-sources');
15
- var cloudwatch = require('aws-cdk-lib/aws-cloudwatch');
16
15
  var secretsmanager = require('aws-cdk-lib/aws-secretsmanager');
17
16
  var awsIam = require('aws-cdk-lib/aws-iam');
18
17
  var awsLogs = require('aws-cdk-lib/aws-logs');
@@ -47,7 +46,6 @@ var s3n__namespace = /*#__PURE__*/_interopNamespaceDefault(s3n);
47
46
  var lambda__namespace = /*#__PURE__*/_interopNamespaceDefault(lambda);
48
47
  var sqs__namespace = /*#__PURE__*/_interopNamespaceDefault(sqs);
49
48
  var lambdaEventSources__namespace = /*#__PURE__*/_interopNamespaceDefault(lambdaEventSources);
50
- var cloudwatch__namespace = /*#__PURE__*/_interopNamespaceDefault(cloudwatch);
51
49
  var secretsmanager__namespace = /*#__PURE__*/_interopNamespaceDefault(secretsmanager);
52
50
  var sso__namespace = /*#__PURE__*/_interopNamespaceDefault(sso);
53
51
  var cloudfront__namespace = /*#__PURE__*/_interopNamespaceDefault(cloudfront);
@@ -369,7 +367,7 @@ class JaypieLambda extends constructs.Construct {
369
367
  environment[envVar] = process.env[envVar];
370
368
  }
371
369
  });
372
- this._code = typeof code === "string" ? lambda__namespace.Code.fromAsset(code) : code;
370
+ const codeAsset = typeof code === "string" ? lambda__namespace.Code.fromAsset(code) : code;
373
371
  // Create a working copy of layers
374
372
  const resolvedLayers = [...layers];
375
373
  // Determine if we should add Datadog integration
@@ -440,7 +438,7 @@ class JaypieLambda extends constructs.Construct {
440
438
  allowAllOutbound,
441
439
  allowPublicSubnet,
442
440
  architecture,
443
- code: this._code,
441
+ code: codeAsset,
444
442
  codeSigningConfig,
445
443
  deadLetterQueue,
446
444
  deadLetterQueueEnabled,
@@ -453,7 +451,7 @@ class JaypieLambda extends constructs.Construct {
453
451
  },
454
452
  environmentEncryption,
455
453
  ephemeralStorageSize,
456
- filesystem: filesystem ? { config: filesystem } : undefined,
454
+ filesystem,
457
455
  handler,
458
456
  initialPolicy,
459
457
  layers: resolvedLayers,
@@ -515,40 +513,6 @@ class JaypieLambda extends constructs.Construct {
515
513
  if (vendorTag) {
516
514
  cdk$1.Tags.of(this._lambda).add(cdk.CDK.TAG.VENDOR, vendorTag);
517
515
  }
518
- // Store constructor props for later access
519
- this._handler = handler;
520
- this._memorySize = memorySize;
521
- this._timeout =
522
- typeof timeout === "number" ? cdk$1.Duration.seconds(timeout) : timeout;
523
- this._runtime = runtime;
524
- this._environment = {
525
- ...environment,
526
- ...secretsEnvironment,
527
- ...jaypieSecretsEnvironment,
528
- };
529
- this._vpc = vpc;
530
- this._vpcSubnets = vpcSubnets;
531
- this._securityGroups = securityGroups;
532
- this._reservedConcurrentExecutions = reservedConcurrentExecutions;
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;
552
516
  // Assign _reference based on provisioned state
553
517
  this._reference =
554
518
  this._provisioned !== undefined ? this._provisioned : this._lambda;
@@ -560,9 +524,6 @@ class JaypieLambda extends constructs.Construct {
560
524
  get provisioned() {
561
525
  return this._provisioned;
562
526
  }
563
- get code() {
564
- return this._code;
565
- }
566
527
  get reference() {
567
528
  return this._reference;
568
529
  }
@@ -612,9 +573,6 @@ class JaypieLambda extends constructs.Construct {
612
573
  addToRolePolicy(statement) {
613
574
  this._reference.addToRolePolicy(statement);
614
575
  }
615
- addEnvironment(key, value, options) {
616
- return this._lambda.addEnvironment(key, value, options);
617
- }
618
576
  configureAsyncInvoke(options) {
619
577
  this._reference.configureAsyncInvoke(options);
620
578
  }
@@ -627,6 +585,12 @@ class JaypieLambda extends constructs.Construct {
627
585
  grantInvokeUrl(grantee) {
628
586
  return this._reference.grantInvokeUrl(grantee);
629
587
  }
588
+ grantInvokeLatestVersion(grantee) {
589
+ return this._reference.grantInvokeLatestVersion(grantee);
590
+ }
591
+ grantInvokeVersion(grantee, version) {
592
+ return this._reference.grantInvokeVersion(grantee, version);
593
+ }
630
594
  metric(metricName, props) {
631
595
  return this._reference.metric(metricName, props);
632
596
  }
@@ -642,13 +606,6 @@ class JaypieLambda extends constructs.Construct {
642
606
  metricThrottles(props) {
643
607
  return this._reference.metricThrottles(props);
644
608
  }
645
- // Additional IFunction implementation
646
- grantInvokeLatestVersion(grantee) {
647
- return this._reference.grantInvokeLatestVersion(grantee);
648
- }
649
- grantInvokeVersion(grantee, version) {
650
- return this._reference.grantInvokeVersion(grantee, version);
651
- }
652
609
  get env() {
653
610
  return {
654
611
  account: cdk$1.Stack.of(this).account,
@@ -661,147 +618,6 @@ class JaypieLambda extends constructs.Construct {
661
618
  applyRemovalPolicy(policy) {
662
619
  this._reference.applyRemovalPolicy(policy);
663
620
  }
664
- // Additional Lambda Function specific methods
665
- get currentVersion() {
666
- return this._lambda.currentVersion;
667
- }
668
- get deadLetterQueue() {
669
- return this._lambda.deadLetterQueue;
670
- }
671
- get deadLetterTopic() {
672
- return this._lambda.deadLetterTopic;
673
- }
674
- get logGroup() {
675
- return this._lambda.logGroup;
676
- }
677
- get runtime() {
678
- return this._runtime;
679
- }
680
- get timeout() {
681
- return this._timeout;
682
- }
683
- addAlias(aliasName, options) {
684
- return this._lambda.addAlias(aliasName, options);
685
- }
686
- addLayers(...layers) {
687
- this._lambda.addLayers(...layers);
688
- }
689
- invalidateVersionBasedOn(x) {
690
- this._lambda.invalidateVersionBasedOn(x);
691
- }
692
- metricConcurrentExecutions(props) {
693
- return new cloudwatch__namespace.Metric({
694
- namespace: "AWS/Lambda",
695
- metricName: "ConcurrentExecutions",
696
- dimensionsMap: {
697
- FunctionName: this.functionName,
698
- },
699
- ...props,
700
- });
701
- }
702
- metricUnreservedConcurrentExecutions(props) {
703
- return new cloudwatch__namespace.Metric({
704
- namespace: "AWS/Lambda",
705
- metricName: "UnreservedConcurrentExecutions",
706
- ...props,
707
- });
708
- }
709
- addVersion(name, codeSha256, description, provisionedExecutions, asyncInvokeConfig) {
710
- return new lambda__namespace.Version(this, name, {
711
- lambda: this._lambda,
712
- codeSha256,
713
- description,
714
- provisionedConcurrentExecutions: provisionedExecutions,
715
- ...asyncInvokeConfig,
716
- });
717
- }
718
- get memorySize() {
719
- return this._memorySize;
720
- }
721
- get handler() {
722
- return this._handler;
723
- }
724
- get environment() {
725
- return this._environment;
726
- }
727
- get layers() {
728
- return this._layers;
729
- }
730
- get maxEventAge() {
731
- return this._maxEventAge;
732
- }
733
- get retryAttempts() {
734
- return this._retryAttempts;
735
- }
736
- get reservedConcurrentExecutions() {
737
- return this._reservedConcurrentExecutions;
738
- }
739
- get description() {
740
- return this._description;
741
- }
742
- get initialPolicy() {
743
- return this._initialPolicy;
744
- }
745
- get logRetentionRole() {
746
- return this._logRetentionRole;
747
- }
748
- get logRetentionRetryOptions() {
749
- return this._logRetentionRetryOptions;
750
- }
751
- get tracing() {
752
- return this._tracing;
753
- }
754
- get profiling() {
755
- return this._profiling;
756
- }
757
- get profilingGroup() {
758
- return this._profilingGroup;
759
- }
760
- get environmentEncryption() {
761
- return this._environmentEncryption;
762
- }
763
- get codeSigningConfig() {
764
- return this._codeSigningConfig;
765
- }
766
- get filesystemConfig() {
767
- return this._filesystemConfigs?.[0];
768
- }
769
- get filesystemConfigs() {
770
- return this._filesystemConfigs;
771
- }
772
- get ephemeralStorageSize() {
773
- return this._ephemeralStorageSize;
774
- }
775
- get runtimeManagementMode() {
776
- return this._runtimeManagementMode;
777
- }
778
- get architectureLabel() {
779
- return this._lambda.architecture.name;
780
- }
781
- get vpc() {
782
- return this._vpc;
783
- }
784
- get vpcSubnets() {
785
- return this._vpcSubnets;
786
- }
787
- get securityGroups() {
788
- return this._securityGroups;
789
- }
790
- get allowAllOutbound() {
791
- return this._allowAllOutbound;
792
- }
793
- get allowPublicSubnet() {
794
- return this._allowPublicSubnet;
795
- }
796
- get canCreateLambdaLogGroup() {
797
- return true;
798
- }
799
- get canCreatePermissions() {
800
- return true;
801
- }
802
- get deadLetterQueueEnabled() {
803
- return this._lambda.deadLetterQueue !== undefined || this._lambda.deadLetterTopic !== undefined;
804
- }
805
621
  }
806
622
 
807
623
  class JaypieQueuedLambda extends constructs.Construct {