@jaypie/constructs 1.1.35 → 1.1.36-beta.1

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.
@@ -37,6 +37,7 @@ export declare class JaypieLambda extends Construct implements lambda.IFunction
37
37
  private readonly _lambda;
38
38
  private readonly _provisioned?;
39
39
  private readonly _code;
40
+ private readonly _reference;
40
41
  constructor(scope: Construct, id: string, props: JaypieLambdaProps);
41
42
  get lambda(): lambda.Function;
42
43
  get provisioned(): lambda.Alias | undefined;
@@ -280,7 +280,6 @@ class JaypieLambda extends constructs.Construct {
280
280
  });
281
281
  // Grant read permissions for JaypieEnvSecrets
282
282
  secrets.forEach((secret) => {
283
- secret.grantRead(this);
284
283
  secret.grantRead(this._lambda);
285
284
  });
286
285
  // Grant Datadog API key read permission if applicable
@@ -307,6 +306,9 @@ class JaypieLambda extends constructs.Construct {
307
306
  if (vendorTag) {
308
307
  cdk$1.Tags.of(this._lambda).add(cdk.CDK.TAG.VENDOR, vendorTag);
309
308
  }
309
+ // Assign _reference based on provisioned state
310
+ this._reference =
311
+ this._provisioned !== undefined ? this._provisioned : this._lambda;
310
312
  }
311
313
  // Public accessors
312
314
  get lambda() {
@@ -320,86 +322,86 @@ class JaypieLambda extends constructs.Construct {
320
322
  }
321
323
  // IFunction implementation
322
324
  get functionArn() {
323
- return this._lambda.functionArn;
325
+ return this._reference.functionArn;
324
326
  }
325
327
  get functionName() {
326
- return this._lambda.functionName;
328
+ return this._reference.functionName;
327
329
  }
328
330
  get grantPrincipal() {
329
- return this._lambda.grantPrincipal;
331
+ return this._reference.grantPrincipal;
330
332
  }
331
333
  get role() {
332
- return this._lambda.role;
334
+ return this._reference.role;
333
335
  }
334
336
  get architecture() {
335
- return this._lambda.architecture;
337
+ return this._reference.architecture;
336
338
  }
337
339
  get connections() {
338
- return this._lambda.connections;
340
+ return this._reference.connections;
339
341
  }
340
342
  get isBoundToVpc() {
341
- return this._lambda.isBoundToVpc;
343
+ return this._reference.isBoundToVpc;
342
344
  }
343
345
  get latestVersion() {
344
- return this._lambda.latestVersion;
346
+ return this._reference.latestVersion;
345
347
  }
346
348
  get permissionsNode() {
347
- return this._lambda.permissionsNode;
349
+ return this._reference.permissionsNode;
348
350
  }
349
351
  get resourceArnsForGrantInvoke() {
350
- return this._lambda.resourceArnsForGrantInvoke;
352
+ return this._reference.resourceArnsForGrantInvoke;
351
353
  }
352
354
  addEventSource(source) {
353
- this._lambda.addEventSource(source);
355
+ this._reference.addEventSource(source);
354
356
  }
355
357
  addEventSourceMapping(id, options) {
356
- return this._lambda.addEventSourceMapping(id, options);
358
+ return this._reference.addEventSourceMapping(id, options);
357
359
  }
358
360
  addFunctionUrl(options) {
359
- return this._lambda.addFunctionUrl(options);
361
+ return this._reference.addFunctionUrl(options);
360
362
  }
361
363
  addPermission(id, permission) {
362
- this._lambda.addPermission(id, permission);
364
+ this._reference.addPermission(id, permission);
363
365
  }
364
366
  addToRolePolicy(statement) {
365
- this._lambda.addToRolePolicy(statement);
367
+ this._reference.addToRolePolicy(statement);
366
368
  }
367
369
  addEnvironment(key, value, options) {
368
370
  return this._lambda.addEnvironment(key, value, options);
369
371
  }
370
372
  configureAsyncInvoke(options) {
371
- this._lambda.configureAsyncInvoke(options);
373
+ this._reference.configureAsyncInvoke(options);
372
374
  }
373
375
  grantInvoke(grantee) {
374
- return this._lambda.grantInvoke(grantee);
376
+ return this._reference.grantInvoke(grantee);
375
377
  }
376
378
  grantInvokeCompositePrincipal(compositePrincipal) {
377
- return this._lambda.grantInvokeCompositePrincipal(compositePrincipal);
379
+ return this._reference.grantInvokeCompositePrincipal(compositePrincipal);
378
380
  }
379
381
  grantInvokeUrl(grantee) {
380
- return this._lambda.grantInvokeUrl(grantee);
382
+ return this._reference.grantInvokeUrl(grantee);
381
383
  }
382
384
  metric(metricName, props) {
383
- return this._lambda.metric(metricName, props);
385
+ return this._reference.metric(metricName, props);
384
386
  }
385
387
  metricDuration(props) {
386
- return this._lambda.metricDuration(props);
388
+ return this._reference.metricDuration(props);
387
389
  }
388
390
  metricErrors(props) {
389
- return this._lambda.metricErrors(props);
391
+ return this._reference.metricErrors(props);
390
392
  }
391
393
  metricInvocations(props) {
392
- return this._lambda.metricInvocations(props);
394
+ return this._reference.metricInvocations(props);
393
395
  }
394
396
  metricThrottles(props) {
395
- return this._lambda.metricThrottles(props);
397
+ return this._reference.metricThrottles(props);
396
398
  }
397
399
  // Additional IFunction implementation
398
400
  grantInvokeLatestVersion(grantee) {
399
- return this._lambda.grantInvokeLatestVersion(grantee);
401
+ return this._reference.grantInvokeLatestVersion(grantee);
400
402
  }
401
403
  grantInvokeVersion(grantee, version) {
402
- return this._lambda.grantInvokeVersion(grantee, version);
404
+ return this._reference.grantInvokeVersion(grantee, version);
403
405
  }
404
406
  get env() {
405
407
  return {
@@ -408,10 +410,10 @@ class JaypieLambda extends constructs.Construct {
408
410
  };
409
411
  }
410
412
  get stack() {
411
- return this._lambda.stack;
413
+ return this._reference.stack;
412
414
  }
413
415
  applyRemovalPolicy(policy) {
414
- this._lambda.applyRemovalPolicy(policy);
416
+ this._reference.applyRemovalPolicy(policy);
415
417
  }
416
418
  }
417
419