@gradientedge/cdk-utils 5.9.0 → 5.10.0

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.
@@ -477,6 +477,10 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
477
477
  this.apiDestinedRestApi.api = apig.RestApi.fromRestApiId(this, `${this.id}-sns-rest-api`, cdk.Fn.importValue(this.props.api.importedRestApiRef));
478
478
  return;
479
479
  }
480
+ const accessLogGroup = this.logManager.createLogGroup(`${this.id}-sns-rest-api-access-log`, this, {
481
+ logGroupName: `/custom/api/${this.id}-destined-rest-api-access-${this.props.stage}`,
482
+ removalPolicy: cdk.RemovalPolicy.DESTROY,
483
+ });
480
484
  this.apiDestinedRestApi.api = new apig.RestApi(this, `${this.id}-sns-rest-api`, {
481
485
  ...{
482
486
  defaultIntegration: this.apiDestinedRestApi.integration,
@@ -489,6 +493,8 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
489
493
  loggingLevel: apig.MethodLoggingLevel.INFO,
490
494
  metricsEnabled: true,
491
495
  stageName: this.props.stage,
496
+ accessLogDestination: new apig.LogGroupLogDestination(accessLogGroup),
497
+ accessLogFormat: apig.AccessLogFormat.jsonWithStandardFields(),
492
498
  },
493
499
  endpointConfiguration: {
494
500
  types: [apig.EndpointType.REGIONAL],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "5.9.0",
3
+ "version": "5.10.0",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -532,6 +532,12 @@ export class ApiToEventBridgeTarget extends CommonConstruct {
532
532
  )
533
533
  return
534
534
  }
535
+
536
+ const accessLogGroup = this.logManager.createLogGroup(`${this.id}-sns-rest-api-access-log`, this, {
537
+ logGroupName: `/custom/api/${this.id}-destined-rest-api-access-${this.props.stage}`,
538
+ removalPolicy: cdk.RemovalPolicy.DESTROY,
539
+ })
540
+
535
541
  this.apiDestinedRestApi.api = new apig.RestApi(this, `${this.id}-sns-rest-api`, {
536
542
  ...{
537
543
  defaultIntegration: this.apiDestinedRestApi.integration,
@@ -544,6 +550,8 @@ export class ApiToEventBridgeTarget extends CommonConstruct {
544
550
  loggingLevel: apig.MethodLoggingLevel.INFO,
545
551
  metricsEnabled: true,
546
552
  stageName: this.props.stage,
553
+ accessLogDestination: new apig.LogGroupLogDestination(accessLogGroup),
554
+ accessLogFormat: apig.AccessLogFormat.jsonWithStandardFields(),
547
555
  },
548
556
  endpointConfiguration: {
549
557
  types: [apig.EndpointType.REGIONAL],