@gradientedge/cdk-utils-azure 2.46.1 → 2.47.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.
@@ -204,7 +204,7 @@ export class AzureRestApi extends CommonAzureConstruct {
204
204
  * @summary Method to create the API Management logger with Application Insights integration
205
205
  */
206
206
  createApiManagementLogger() {
207
- if (this.props.apiManagement.useExistingApiManagement)
207
+ if (this.props.apiManagement.useExistingApiManagement && !this.props.apiManagementDiagnosticAppInsights)
208
208
  return;
209
209
  const apiAppNamedValue = this.apiManagementManager.createNamedValue(`${this.id}-am-nv`, this, {
210
210
  displayName: this.applicationInsights.name,
@@ -233,13 +233,26 @@ export class AzureRestApi extends CommonAzureConstruct {
233
233
  createApiDiagnostic() {
234
234
  if (this.props.apiManagement.useExistingApiManagement)
235
235
  return;
236
- this.apiManagementManager.createApiDiagnostic(`${this.id}-all-apis`, this, {
237
- ...this.props.apiManagementDiagnostic,
238
- apiId: this.api.apim.id,
239
- resourceGroupName: this.resourceGroup.name,
240
- serviceName: this.api.apim.name,
241
- loggerId: this.api.logger.id,
242
- });
236
+ if (this.props.apiManagementDiagnosticAppInsights) {
237
+ this.apiManagementManager.createApiDiagnostic(`${this.id}-all-apis-app-insights`, this, {
238
+ ...this.props.apiManagementDiagnosticAppInsights,
239
+ diagnosticId: 'applicationinsights',
240
+ apiId: this.api.apim.id,
241
+ resourceGroupName: this.resourceGroup.name,
242
+ serviceName: this.api.apim.name,
243
+ loggerId: this.api.logger.id,
244
+ });
245
+ }
246
+ if (this.props.apiManagementDiagnosticAzMonitor) {
247
+ this.apiManagementManager.createApiDiagnostic(`${this.id}-all-apis-az-monitor`, this, {
248
+ ...this.props.apiManagementDiagnosticAzMonitor,
249
+ diagnosticId: 'azuremonitor',
250
+ apiId: this.api.apim.id,
251
+ resourceGroupName: this.resourceGroup.name,
252
+ serviceName: this.api.apim.name,
253
+ loggerId: pulumi.interpolate `${this.api.apim.id}/loggers/azuremonitor`,
254
+ });
255
+ }
243
256
  }
244
257
  /**
245
258
  * @summary Method to create the Monitor diagnostic log settings for API Management
@@ -23,7 +23,8 @@ export interface AzureRestApiProps extends CommonAzureStackProps {
23
23
  /** API Management service properties */
24
24
  apiManagement: ApiManagementProps;
25
25
  /** API diagnostic properties for logging */
26
- apiManagementDiagnostic: ApiDiagnosticProps;
26
+ apiManagementDiagnosticAppInsights: ApiDiagnosticProps;
27
+ apiManagementDiagnosticAzMonitor: ApiDiagnosticProps;
27
28
  /** Monitor diagnostic settings for the API Management service */
28
29
  apiManagementDiagnosticSettings: MonitorDiagnosticSettingProps;
29
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils-azure",
3
- "version": "2.46.1",
3
+ "version": "2.47.0",
4
4
  "description": "Azure Pulumi utilities for @gradientedge/cdk-utils",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",