@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;
package/dist/esm/index.js CHANGED
@@ -248,7 +248,6 @@ class JaypieLambda extends Construct {
248
248
  });
249
249
  // Grant read permissions for JaypieEnvSecrets
250
250
  secrets.forEach((secret) => {
251
- secret.grantRead(this);
252
251
  secret.grantRead(this._lambda);
253
252
  });
254
253
  // Grant Datadog API key read permission if applicable
@@ -275,6 +274,9 @@ class JaypieLambda extends Construct {
275
274
  if (vendorTag) {
276
275
  Tags.of(this._lambda).add(CDK$2.TAG.VENDOR, vendorTag);
277
276
  }
277
+ // Assign _reference based on provisioned state
278
+ this._reference =
279
+ this._provisioned !== undefined ? this._provisioned : this._lambda;
278
280
  }
279
281
  // Public accessors
280
282
  get lambda() {
@@ -288,86 +290,86 @@ class JaypieLambda extends Construct {
288
290
  }
289
291
  // IFunction implementation
290
292
  get functionArn() {
291
- return this._lambda.functionArn;
293
+ return this._reference.functionArn;
292
294
  }
293
295
  get functionName() {
294
- return this._lambda.functionName;
296
+ return this._reference.functionName;
295
297
  }
296
298
  get grantPrincipal() {
297
- return this._lambda.grantPrincipal;
299
+ return this._reference.grantPrincipal;
298
300
  }
299
301
  get role() {
300
- return this._lambda.role;
302
+ return this._reference.role;
301
303
  }
302
304
  get architecture() {
303
- return this._lambda.architecture;
305
+ return this._reference.architecture;
304
306
  }
305
307
  get connections() {
306
- return this._lambda.connections;
308
+ return this._reference.connections;
307
309
  }
308
310
  get isBoundToVpc() {
309
- return this._lambda.isBoundToVpc;
311
+ return this._reference.isBoundToVpc;
310
312
  }
311
313
  get latestVersion() {
312
- return this._lambda.latestVersion;
314
+ return this._reference.latestVersion;
313
315
  }
314
316
  get permissionsNode() {
315
- return this._lambda.permissionsNode;
317
+ return this._reference.permissionsNode;
316
318
  }
317
319
  get resourceArnsForGrantInvoke() {
318
- return this._lambda.resourceArnsForGrantInvoke;
320
+ return this._reference.resourceArnsForGrantInvoke;
319
321
  }
320
322
  addEventSource(source) {
321
- this._lambda.addEventSource(source);
323
+ this._reference.addEventSource(source);
322
324
  }
323
325
  addEventSourceMapping(id, options) {
324
- return this._lambda.addEventSourceMapping(id, options);
326
+ return this._reference.addEventSourceMapping(id, options);
325
327
  }
326
328
  addFunctionUrl(options) {
327
- return this._lambda.addFunctionUrl(options);
329
+ return this._reference.addFunctionUrl(options);
328
330
  }
329
331
  addPermission(id, permission) {
330
- this._lambda.addPermission(id, permission);
332
+ this._reference.addPermission(id, permission);
331
333
  }
332
334
  addToRolePolicy(statement) {
333
- this._lambda.addToRolePolicy(statement);
335
+ this._reference.addToRolePolicy(statement);
334
336
  }
335
337
  addEnvironment(key, value, options) {
336
338
  return this._lambda.addEnvironment(key, value, options);
337
339
  }
338
340
  configureAsyncInvoke(options) {
339
- this._lambda.configureAsyncInvoke(options);
341
+ this._reference.configureAsyncInvoke(options);
340
342
  }
341
343
  grantInvoke(grantee) {
342
- return this._lambda.grantInvoke(grantee);
344
+ return this._reference.grantInvoke(grantee);
343
345
  }
344
346
  grantInvokeCompositePrincipal(compositePrincipal) {
345
- return this._lambda.grantInvokeCompositePrincipal(compositePrincipal);
347
+ return this._reference.grantInvokeCompositePrincipal(compositePrincipal);
346
348
  }
347
349
  grantInvokeUrl(grantee) {
348
- return this._lambda.grantInvokeUrl(grantee);
350
+ return this._reference.grantInvokeUrl(grantee);
349
351
  }
350
352
  metric(metricName, props) {
351
- return this._lambda.metric(metricName, props);
353
+ return this._reference.metric(metricName, props);
352
354
  }
353
355
  metricDuration(props) {
354
- return this._lambda.metricDuration(props);
356
+ return this._reference.metricDuration(props);
355
357
  }
356
358
  metricErrors(props) {
357
- return this._lambda.metricErrors(props);
359
+ return this._reference.metricErrors(props);
358
360
  }
359
361
  metricInvocations(props) {
360
- return this._lambda.metricInvocations(props);
362
+ return this._reference.metricInvocations(props);
361
363
  }
362
364
  metricThrottles(props) {
363
- return this._lambda.metricThrottles(props);
365
+ return this._reference.metricThrottles(props);
364
366
  }
365
367
  // Additional IFunction implementation
366
368
  grantInvokeLatestVersion(grantee) {
367
- return this._lambda.grantInvokeLatestVersion(grantee);
369
+ return this._reference.grantInvokeLatestVersion(grantee);
368
370
  }
369
371
  grantInvokeVersion(grantee, version) {
370
- return this._lambda.grantInvokeVersion(grantee, version);
372
+ return this._reference.grantInvokeVersion(grantee, version);
371
373
  }
372
374
  get env() {
373
375
  return {
@@ -376,10 +378,10 @@ class JaypieLambda extends Construct {
376
378
  };
377
379
  }
378
380
  get stack() {
379
- return this._lambda.stack;
381
+ return this._reference.stack;
380
382
  }
381
383
  applyRemovalPolicy(policy) {
382
- this._lambda.applyRemovalPolicy(policy);
384
+ this._reference.applyRemovalPolicy(policy);
383
385
  }
384
386
  }
385
387