From 7a487e2d9fa864236521b445044f278281407d61 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Thu, 31 Oct 2024 09:23:43 +0100 Subject: [PATCH] Made module type singular --- .../api-management/service/logger/README.md | 35 ++++++++++--------- .../api-management/service/logger/main.bicep | 28 +++++++-------- .../api-management/service/logger/main.json | 11 +++--- avm/res/api-management/service/main.bicep | 6 ++-- avm/res/api-management/service/main.json | 21 +++++------ 5 files changed, 52 insertions(+), 49 deletions(-) diff --git a/avm/res/api-management/service/logger/README.md b/avm/res/api-management/service/logger/README.md index c0fabec510..769f788fe5 100644 --- a/avm/res/api-management/service/logger/README.md +++ b/avm/res/api-management/service/logger/README.md @@ -20,8 +20,8 @@ This module deploys an API Management Service Logger. | Parameter | Type | Description | | :-- | :-- | :-- | -| [`loggerType`](#parameter-loggertype) | string | Logger type. | | [`name`](#parameter-name) | string | Resource Name. | +| [`type`](#parameter-type) | string | Logger type. | **Conditional parameters** @@ -35,10 +35,17 @@ This module deploys an API Management Service Logger. | Parameter | Type | Description | | :-- | :-- | :-- | +| [`description`](#parameter-description) | string | Logger description. | | [`isBuffered`](#parameter-isbuffered) | bool | Whether records are buffered in the logger before publishing. | -| [`loggerDescription`](#parameter-loggerdescription) | string | Logger description. | -### Parameter: `loggerType` +### Parameter: `name` + +Resource Name. + +- Required: Yes +- Type: string + +### Parameter: `type` Logger type. @@ -53,13 +60,6 @@ Logger type. ] ``` -### Parameter: `name` - -Resource Name. - -- Required: Yes -- Type: string - ### Parameter: `apiManagementServiceName` The name of the parent API Management service. Required if the template is used in a standalone deployment. @@ -81,6 +81,14 @@ Required if loggerType = applicationInsights or azureEventHub. Azure Resource Id - Required: Yes - Type: string +### Parameter: `description` + +Logger description. + +- Required: No +- Type: string +- Default: `''` + ### Parameter: `isBuffered` Whether records are buffered in the logger before publishing. @@ -89,13 +97,6 @@ Whether records are buffered in the logger before publishing. - Type: bool - Default: `True` -### Parameter: `loggerDescription` - -Logger description. - -- Required: Yes -- Type: string - ## Outputs | Output | Type | Description | diff --git a/avm/res/api-management/service/logger/main.bicep b/avm/res/api-management/service/logger/main.bicep index 6f7d1af8fb..0397eb4c99 100644 --- a/avm/res/api-management/service/logger/main.bicep +++ b/avm/res/api-management/service/logger/main.bicep @@ -2,31 +2,31 @@ metadata name = 'API Management Service Loggers' metadata description = 'This module deploys an API Management Service Logger.' metadata owner = 'Azure/module-maintainers' -@description('Conditional. The name of the parent API Management service. Required if the template is used in a standalone deployment.') +@sys.description('Conditional. The name of the parent API Management service. Required if the template is used in a standalone deployment.') param apiManagementServiceName string -@description('Required. Resource Name.') +@sys.description('Required. Resource Name.') param name string -@description('Optional. Logger description.') -param loggerDescription string +@sys.description('Optional. Logger description.') +param description string = '' -@description('Optional. Whether records are buffered in the logger before publishing.') +@sys.description('Optional. Whether records are buffered in the logger before publishing.') param isBuffered bool = true -@description('Required. Logger type.') +@sys.description('Required. Logger type.') @allowed([ 'applicationInsights' 'azureEventHub' 'azureMonitor' ]) -param loggerType string +param type string -@description('Conditional. Required if loggerType = applicationInsights or azureEventHub. Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).') +@sys.description('Conditional. Required if loggerType = applicationInsights or azureEventHub. Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).') param targetResourceId string @secure() -@description('Conditional. Required if loggerType = applicationInsights or azureEventHub. The name and SendRule connection string of the event hub for azureEventHub logger. Instrumentation key for applicationInsights logger.') +@sys.description('Conditional. Required if loggerType = applicationInsights or azureEventHub. The name and SendRule connection string of the event hub for azureEventHub logger. Instrumentation key for applicationInsights logger.') param credentials object resource service 'Microsoft.ApiManagement/service@2021-08-01' existing = { @@ -38,18 +38,18 @@ resource loggers 'Microsoft.ApiManagement/service/loggers@2022-08-01' = { parent: service properties: { credentials: credentials - description: loggerDescription + description: description isBuffered: isBuffered - loggerType: loggerType + loggerType: type resourceId: targetResourceId } } -@description('The resource ID of the logger.') +@sys.description('The resource ID of the logger.') output resourceId string = loggers.id -@description('The name of the logger.') +@sys.description('The name of the logger.') output name string = loggers.name -@description('The resource group the named value was deployed into.') +@sys.description('The resource group the named value was deployed into.') output resourceGroupName string = resourceGroup().name diff --git a/avm/res/api-management/service/logger/main.json b/avm/res/api-management/service/logger/main.json index 7d3305a3cd..0065107236 100644 --- a/avm/res/api-management/service/logger/main.json +++ b/avm/res/api-management/service/logger/main.json @@ -5,7 +5,7 @@ "_generator": { "name": "bicep", "version": "0.30.23.60470", - "templateHash": "12834599511984803283" + "templateHash": "11939692347898757759" }, "name": "API Management Service Loggers", "description": "This module deploys an API Management Service Logger.", @@ -24,8 +24,9 @@ "description": "Required. Resource Name." } }, - "loggerDescription": { + "description": { "type": "string", + "defaultValue": "", "metadata": { "description": "Optional. Logger description." } @@ -37,7 +38,7 @@ "description": "Optional. Whether records are buffered in the logger before publishing." } }, - "loggerType": { + "type": { "type": "string", "allowedValues": [ "applicationInsights", @@ -68,9 +69,9 @@ "name": "[format('{0}/{1}', parameters('apiManagementServiceName'), parameters('name'))]", "properties": { "credentials": "[parameters('credentials')]", - "description": "[parameters('loggerDescription')]", + "description": "[parameters('description')]", "isBuffered": "[parameters('isBuffered')]", - "loggerType": "[parameters('loggerType')]", + "loggerType": "[parameters('type')]", "resourceId": "[parameters('targetResourceId')]" } } diff --git a/avm/res/api-management/service/main.bicep b/avm/res/api-management/service/main.bicep index 7049560b15..cc18535d18 100644 --- a/avm/res/api-management/service/main.bicep +++ b/avm/res/api-management/service/main.bicep @@ -416,9 +416,9 @@ module service_loggers 'logger/main.bicep' = [ name: logger.name apiManagementServiceName: service.name credentials: logger.?credentials ?? {} - isBuffered: logger.?isBuffered ?? true - loggerDescription: logger.?loggerDescription ?? '' - loggerType: logger.?loggerType ?? 'azureMonitor' + isBuffered: logger.?isBuffered + description: logger.?loggerDescription + type: logger.?loggerType ?? 'azureMonitor' targetResourceId: logger.?targetResourceId ?? '' } dependsOn: [ diff --git a/avm/res/api-management/service/main.json b/avm/res/api-management/service/main.json index fc42a71966..c4756dd6ee 100644 --- a/avm/res/api-management/service/main.json +++ b/avm/res/api-management/service/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.30.23.60470", - "templateHash": "7676062632439815762" + "templateHash": "17391549919743437794" }, "name": "API Management Services", "description": "This module deploys an API Management Service. The default deployment is set to use a Premium SKU to align with Microsoft WAF-aligned best practices. In most cases, non-prod deployments should use a lower-tier SKU.", @@ -2602,12 +2602,12 @@ "value": "[coalesce(tryGet(parameters('loggers')[copyIndex()], 'credentials'), createObject())]" }, "isBuffered": { - "value": "[coalesce(tryGet(parameters('loggers')[copyIndex()], 'isBuffered'), true())]" + "value": "[tryGet(parameters('loggers')[copyIndex()], 'isBuffered')]" }, - "loggerDescription": { - "value": "[coalesce(tryGet(parameters('loggers')[copyIndex()], 'loggerDescription'), '')]" + "description": { + "value": "[tryGet(parameters('loggers')[copyIndex()], 'loggerDescription')]" }, - "loggerType": { + "type": { "value": "[coalesce(tryGet(parameters('loggers')[copyIndex()], 'loggerType'), 'azureMonitor')]" }, "targetResourceId": { @@ -2621,7 +2621,7 @@ "_generator": { "name": "bicep", "version": "0.30.23.60470", - "templateHash": "12834599511984803283" + "templateHash": "11939692347898757759" }, "name": "API Management Service Loggers", "description": "This module deploys an API Management Service Logger.", @@ -2640,8 +2640,9 @@ "description": "Required. Resource Name." } }, - "loggerDescription": { + "description": { "type": "string", + "defaultValue": "", "metadata": { "description": "Optional. Logger description." } @@ -2653,7 +2654,7 @@ "description": "Optional. Whether records are buffered in the logger before publishing." } }, - "loggerType": { + "type": { "type": "string", "allowedValues": [ "applicationInsights", @@ -2684,9 +2685,9 @@ "name": "[format('{0}/{1}', parameters('apiManagementServiceName'), parameters('name'))]", "properties": { "credentials": "[parameters('credentials')]", - "description": "[parameters('loggerDescription')]", + "description": "[parameters('description')]", "isBuffered": "[parameters('isBuffered')]", - "loggerType": "[parameters('loggerType')]", + "loggerType": "[parameters('type')]", "resourceId": "[parameters('targetResourceId')]" } }