@gradientedge/cdk-utils-azure 2.46.0 → 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
  }
@@ -219,7 +219,7 @@ export class AzureRestApiFunction extends AzureFunctionApp {
219
219
  displayName: operation.displayName,
220
220
  urlTemplate: operation.urlTemplate,
221
221
  templateParameters: operation.templateParameters,
222
- });
222
+ }, { dependsOn: [this.api.managementApi] });
223
223
  }
224
224
  /**
225
225
  * @summary Method to create a cache policy for an API Management API operation
@@ -250,7 +250,7 @@ export class AzureRestApiFunction extends AzureFunctionApp {
250
250
  <base />
251
251
  </on-error>
252
252
  </policies>`.replace(/\n[ \t]*\n/g, '\n'),
253
- });
253
+ }, { dependsOn: [this.api.managementApi] });
254
254
  }
255
255
  /**
256
256
  * @summary Method to create the CORS policy for API Management
@@ -100,7 +100,7 @@ export class AzureFunctionManager {
100
100
  };
101
101
  const scaleAndConcurrency = {
102
102
  ...props.scaleAndConcurrency,
103
- instanceMemoryMB: props.scaleAndConcurrency?.instanceMemoryMB ?? 4096,
103
+ instanceMemoryMB: props.scaleAndConcurrency?.instanceMemoryMB ?? 2048,
104
104
  maximumInstanceCount: props.scaleAndConcurrency?.maximumInstanceCount ?? 40,
105
105
  };
106
106
  const tags = {
@@ -202,7 +202,7 @@ export class AzureFunctionManager {
202
202
  },
203
203
  scaleAndConcurrency: {
204
204
  ...props.scaleAndConcurrency,
205
- instanceMemoryMB: props.scaleAndConcurrency?.instanceMemoryMB ?? 4096,
205
+ instanceMemoryMB: props.scaleAndConcurrency?.instanceMemoryMB ?? 2048,
206
206
  maximumInstanceCount: props.scaleAndConcurrency?.maximumInstanceCount ?? 40,
207
207
  },
208
208
  siteUpdateStrategy: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils-azure",
3
- "version": "2.46.0",
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",