@jaypie/constructs 1.1.31 → 1.1.32

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.
@@ -35,9 +35,11 @@ export interface JaypieLambdaProps {
35
35
  }
36
36
  export declare class JaypieLambda extends Construct implements lambda.IFunction {
37
37
  private readonly _lambda;
38
+ private readonly _alias?;
38
39
  private readonly _code;
39
40
  constructor(scope: Construct, id: string, props: JaypieLambdaProps);
40
41
  get lambda(): lambda.Function;
42
+ get alias(): lambda.Alias | undefined;
41
43
  get code(): lambda.Code;
42
44
  get functionArn(): string;
43
45
  get functionName(): string;
@@ -439,7 +439,7 @@ class JaypieLambda extends constructs.Construct {
439
439
  }
440
440
  // Configure provisioned concurrency if specified
441
441
  if (provisionedConcurrentExecutions !== undefined) {
442
- new lambda__namespace.Alias(this, "ProvisionedAlias", {
442
+ this._alias = new lambda__namespace.Alias(this, "ProvisionedAlias", {
443
443
  aliasName: "provisioned",
444
444
  version: this._lambda.currentVersion,
445
445
  provisionedConcurrentExecutions,
@@ -456,15 +456,18 @@ class JaypieLambda extends constructs.Construct {
456
456
  get lambda() {
457
457
  return this._lambda;
458
458
  }
459
+ get alias() {
460
+ return this._alias;
461
+ }
459
462
  get code() {
460
463
  return this._code;
461
464
  }
462
465
  // IFunction implementation
463
466
  get functionArn() {
464
- return this._lambda.functionArn;
467
+ return this._alias?.functionArn ?? this._lambda.functionArn;
465
468
  }
466
469
  get functionName() {
467
- return this._lambda.functionName;
470
+ return this._alias?.functionName ?? this._lambda.functionName;
468
471
  }
469
472
  get grantPrincipal() {
470
473
  return this._lambda.grantPrincipal;
@@ -488,7 +491,8 @@ class JaypieLambda extends constructs.Construct {
488
491
  return this._lambda.permissionsNode;
489
492
  }
490
493
  get resourceArnsForGrantInvoke() {
491
- return this._lambda.resourceArnsForGrantInvoke;
494
+ return (this._alias?.resourceArnsForGrantInvoke ??
495
+ this._lambda.resourceArnsForGrantInvoke);
492
496
  }
493
497
  addEventSource(source) {
494
498
  this._lambda.addEventSource(source);
@@ -512,7 +516,7 @@ class JaypieLambda extends constructs.Construct {
512
516
  this._lambda.configureAsyncInvoke(options);
513
517
  }
514
518
  grantInvoke(grantee) {
515
- return this._lambda.grantInvoke(grantee);
519
+ return (this._alias?.grantInvoke(grantee) ?? this._lambda.grantInvoke(grantee));
516
520
  }
517
521
  grantInvokeCompositePrincipal(compositePrincipal) {
518
522
  return this._lambda.grantInvokeCompositePrincipal(compositePrincipal);