From 2c8417557cb5dd7079556f07b5ea87694080c379 Mon Sep 17 00:00:00 2001 From: Kris Baranek <20225789+krbar@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:56:33 +0200 Subject: [PATCH] Property rename to dataCollectionEndpointResourceId --- avm/res/insights/data-collection-rule/README.md | 16 ++++++++-------- avm/res/insights/data-collection-rule/main.bicep | 14 +++++++------- avm/res/insights/data-collection-rule/main.json | 8 ++++---- .../tests/e2e/customadv/main.test.bicep | 2 +- .../tests/e2e/custombasic/main.test.bicep | 2 +- .../tests/e2e/customiis/main.test.bicep | 2 +- .../tests/e2e/max/main.test.bicep | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/avm/res/insights/data-collection-rule/README.md b/avm/res/insights/data-collection-rule/README.md index 4202dc25fe..ab796d654b 100644 --- a/avm/res/insights/data-collection-rule/README.md +++ b/avm/res/insights/data-collection-rule/README.md @@ -126,7 +126,7 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:' + dataCollectionEndpointResourceId: '' dataFlows: [ { destinations: [ @@ -227,7 +227,7 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:", + "dataCollectionEndpointResourceId": "", "dataFlows": [ { "destinations": [ @@ -338,7 +338,7 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:' + dataCollectionEndpointResourceId: '' dataFlows: [ { destinations: [ @@ -423,7 +423,7 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:", + "dataCollectionEndpointResourceId": "", "dataFlows": [ { "destinations": [ @@ -518,7 +518,7 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:' + dataCollectionEndpointResourceId: '' dataFlows: [ { destinations: [ @@ -582,7 +582,7 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:", + "dataCollectionEndpointResourceId": "", "dataFlows": [ { "destinations": [ @@ -1152,7 +1152,7 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:' + dataCollectionEndpointResourceId: '' dataFlows: [ { destinations: [ @@ -1260,7 +1260,7 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:", + "dataCollectionEndpointResourceId": "", "dataFlows": [ { "destinations": [ diff --git a/avm/res/insights/data-collection-rule/main.bicep b/avm/res/insights/data-collection-rule/main.bicep index e0d6c035e3..89b4545dad 100644 --- a/avm/res/insights/data-collection-rule/main.bicep +++ b/avm/res/insights/data-collection-rule/main.bicep @@ -81,12 +81,15 @@ resource dataCollectionRule 'Microsoft.Insights/dataCollectionRules@2023-03-11' name: name tags: tags properties: union( + { + description: dataCollectionRuleProperties.?description + }, dataCollectionRuleProperties.kind == 'Linux' || dataCollectionRuleProperties.kind == 'Windows' ? { dataSources: dataCollectionRuleProperties.dataSources dataFlows: dataCollectionRuleProperties.dataFlows destinations: dataCollectionRuleProperties.destinations - dataCollectionEndpointId: dataCollectionRuleProperties.?dataCollectionEndpointId + dataCollectionEndpointId: dataCollectionRuleProperties.?dataCollectionEndpointResourceId streamDeclarations: dataCollectionRuleProperties.?streamDeclarations } : {}, @@ -94,10 +97,7 @@ resource dataCollectionRule 'Microsoft.Insights/dataCollectionRules@2023-03-11' ? { agentSettings: dataCollectionRuleProperties.agentSettings } - : {}, - { - description: dataCollectionRuleProperties.?description - } + : {} ) } @@ -206,7 +206,7 @@ type linuxDcrPropertiesType = { destinations: object @description('Optional. The resource ID of the data collection endpoint that this rule can be used with.') - dataCollectionEndpointId: string? + dataCollectionEndpointResourceId: string? @description('Optional. Declaration of custom streams used in this rule.') streamDeclarations: object? @@ -229,7 +229,7 @@ type windowsDcrPropertiesType = { destinations: object @description('Optional. The resource ID of the data collection endpoint that this rule can be used with.') - dataCollectionEndpointId: string? + dataCollectionEndpointResourceId: string? @description('Optional. Declaration of custom streams used in this rule.') streamDeclarations: object? diff --git a/avm/res/insights/data-collection-rule/main.json b/avm/res/insights/data-collection-rule/main.json index 0f4a877002..a891f4395a 100644 --- a/avm/res/insights/data-collection-rule/main.json +++ b/avm/res/insights/data-collection-rule/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.29.47.4906", - "templateHash": "16127257398169774892" + "templateHash": "5321768196426375483" }, "name": "Data Collection Rules", "description": "This module deploys a Data Collection Rule.", @@ -158,7 +158,7 @@ "description": "Required. Specification of destinations that can be used in data flows." } }, - "dataCollectionEndpointId": { + "dataCollectionEndpointResourceId": { "type": "string", "nullable": true, "metadata": { @@ -211,7 +211,7 @@ "description": "Required. Specification of destinations that can be used in data flows." } }, - "dataCollectionEndpointId": { + "dataCollectionEndpointResourceId": { "type": "string", "nullable": true, "metadata": { @@ -388,7 +388,7 @@ "kind": "[parameters('dataCollectionRuleProperties').kind]", "location": "[parameters('location')]", "tags": "[parameters('tags')]", - "properties": "[union(if(or(equals(parameters('dataCollectionRuleProperties').kind, 'Linux'), equals(parameters('dataCollectionRuleProperties').kind, 'Windows')), createObject('dataSources', parameters('dataCollectionRuleProperties').dataSources, 'dataFlows', parameters('dataCollectionRuleProperties').dataFlows, 'destinations', parameters('dataCollectionRuleProperties').destinations, 'dataCollectionEndpointId', tryGet(parameters('dataCollectionRuleProperties'), 'dataCollectionEndpointId'), 'streamDeclarations', tryGet(parameters('dataCollectionRuleProperties'), 'streamDeclarations')), createObject()), if(equals(parameters('dataCollectionRuleProperties').kind, 'AgentSettings'), createObject('agentSettings', parameters('dataCollectionRuleProperties').agentSettings), createObject()), createObject('description', tryGet(parameters('dataCollectionRuleProperties'), 'description')))]" + "properties": "[union(createObject('description', tryGet(parameters('dataCollectionRuleProperties'), 'description')), if(or(equals(parameters('dataCollectionRuleProperties').kind, 'Linux'), equals(parameters('dataCollectionRuleProperties').kind, 'Windows')), createObject('dataSources', parameters('dataCollectionRuleProperties').dataSources, 'dataFlows', parameters('dataCollectionRuleProperties').dataFlows, 'destinations', parameters('dataCollectionRuleProperties').destinations, 'dataCollectionEndpointId', tryGet(parameters('dataCollectionRuleProperties'), 'dataCollectionEndpointResourceId'), 'streamDeclarations', tryGet(parameters('dataCollectionRuleProperties'), 'streamDeclarations')), createObject()), if(equals(parameters('dataCollectionRuleProperties').kind, 'AgentSettings'), createObject('agentSettings', parameters('dataCollectionRuleProperties').agentSettings), createObject()))]" }, "dataCollectionRule_lock": { "condition": "[and(not(empty(coalesce(parameters('lock'), createObject()))), not(equals(tryGet(parameters('lock'), 'kind'), 'None')))]", diff --git a/avm/res/insights/data-collection-rule/tests/e2e/customadv/main.test.bicep b/avm/res/insights/data-collection-rule/tests/e2e/customadv/main.test.bicep index a44f3ff416..97004509b5 100644 --- a/avm/res/insights/data-collection-rule/tests/e2e/customadv/main.test.bicep +++ b/avm/res/insights/data-collection-rule/tests/e2e/customadv/main.test.bicep @@ -54,7 +54,7 @@ module testDeployment '../../../main.bicep' = [ location: resourceLocation dataCollectionRuleProperties: { kind: 'Windows' - dataCollectionEndpointId: nestedDependencies.outputs.dataCollectionEndpointResourceId + dataCollectionEndpointResourceId: nestedDependencies.outputs.dataCollectionEndpointResourceId description: 'Collecting custom text logs with ingestion-time transformation to columns. Expected format of a log line (comma separated values): ",,,", for example: "2023-01-25T20:15:05Z,ERROR,404,Page not found"' dataFlows: [ { diff --git a/avm/res/insights/data-collection-rule/tests/e2e/custombasic/main.test.bicep b/avm/res/insights/data-collection-rule/tests/e2e/custombasic/main.test.bicep index 6cd04b57d8..88cca8c40e 100644 --- a/avm/res/insights/data-collection-rule/tests/e2e/custombasic/main.test.bicep +++ b/avm/res/insights/data-collection-rule/tests/e2e/custombasic/main.test.bicep @@ -54,7 +54,7 @@ module testDeployment '../../../main.bicep' = [ location: resourceLocation dataCollectionRuleProperties: { kind: 'Windows' - dataCollectionEndpointId: nestedDependencies.outputs.dataCollectionEndpointResourceId + dataCollectionEndpointResourceId: nestedDependencies.outputs.dataCollectionEndpointResourceId description: 'Collecting custom text logs without ingestion-time transformation.' dataFlows: [ { diff --git a/avm/res/insights/data-collection-rule/tests/e2e/customiis/main.test.bicep b/avm/res/insights/data-collection-rule/tests/e2e/customiis/main.test.bicep index a2f37ba9c6..017061171a 100644 --- a/avm/res/insights/data-collection-rule/tests/e2e/customiis/main.test.bicep +++ b/avm/res/insights/data-collection-rule/tests/e2e/customiis/main.test.bicep @@ -54,7 +54,7 @@ module testDeployment '../../../main.bicep' = [ location: resourceLocation dataCollectionRuleProperties: { kind: 'Windows' - dataCollectionEndpointId: nestedDependencies.outputs.dataCollectionEndpointResourceId + dataCollectionEndpointResourceId: nestedDependencies.outputs.dataCollectionEndpointResourceId description: 'Collecting IIS logs.' dataFlows: [ { diff --git a/avm/res/insights/data-collection-rule/tests/e2e/max/main.test.bicep b/avm/res/insights/data-collection-rule/tests/e2e/max/main.test.bicep index 58db7b00ac..27ac14b5c4 100644 --- a/avm/res/insights/data-collection-rule/tests/e2e/max/main.test.bicep +++ b/avm/res/insights/data-collection-rule/tests/e2e/max/main.test.bicep @@ -55,7 +55,7 @@ module testDeployment '../../../main.bicep' = [ location: resourceLocation dataCollectionRuleProperties: { kind: 'Windows' - dataCollectionEndpointId: nestedDependencies.outputs.dataCollectionEndpointResourceId + dataCollectionEndpointResourceId: nestedDependencies.outputs.dataCollectionEndpointResourceId description: 'Collecting custom text logs without ingestion-time transformation.' dataFlows: [ {