From 0e8396450ee8f580b8352c95573920ec3591cb2c Mon Sep 17 00:00:00 2001 From: Tony Box Date: Wed, 7 Aug 2024 12:38:33 -0400 Subject: [PATCH] adding conditional params --- avm/ptn/security/security-center/README.md | 14 +++++++------- avm/ptn/security/security-center/main.bicep | 8 ++++---- avm/ptn/security/security-center/main.json | 8 +++----- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/avm/ptn/security/security-center/README.md b/avm/ptn/security/security-center/README.md index 1aba3ec1d7..2b761531af 100644 --- a/avm/ptn/security/security-center/README.md +++ b/avm/ptn/security/security-center/README.md @@ -533,18 +533,18 @@ Defines whether to send email notifications from Microsoft Defender for Cloud to - Required: No - Type: object -**Optional parameters** +**Conditional parameters** | Parameter | Type | Description | | :-- | :-- | :-- | -| [`roles`](#parameter-securitycontactspropertiesnotificationsbyroleroles) | array | Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. | -| [`state`](#parameter-securitycontactspropertiesnotificationsbyrolestate) | string | Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription. | +| [`roles`](#parameter-securitycontactspropertiesnotificationsbyroleroles) | array | Required if using notificationsByRole. Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. | +| [`state`](#parameter-securitycontactspropertiesnotificationsbyrolestate) | string | Required if using notificationsByRole. Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription. | ### Parameter: `securityContactsProperties.notificationsByRole.roles` -Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. +Required if using notificationsByRole. Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. -- Required: No +- Required: Yes - Type: array - Allowed: ```Bicep @@ -558,9 +558,9 @@ Defines which RBAC roles will get email notifications from Microsoft Defender fo ### Parameter: `securityContactsProperties.notificationsByRole.state` -Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription. +Required if using notificationsByRole. Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription. -- Required: No +- Required: Yes - Type: string - Allowed: ```Bicep diff --git a/avm/ptn/security/security-center/main.bicep b/avm/ptn/security/security-center/main.bicep index 8e72129a6b..c4752a0eb2 100644 --- a/avm/ptn/security/security-center/main.bicep +++ b/avm/ptn/security/security-center/main.bicep @@ -289,11 +289,11 @@ type securityContactsType = { @description('Optional. Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles on the subscription.') notificationsByRole: { - @description('Optional. Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud.') - roles: ('AccountAdmin' | 'Contributor' | 'Owner' | 'ServiceAdmin')[]? + @description('Conditional. Required if using notificationsByRole. Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud.') + roles: ('AccountAdmin' | 'Contributor' | 'Owner' | 'ServiceAdmin')[] - @description('Optional. Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription.') - state: ('On' | 'Off')? + @description('Conditional. Required if using notificationsByRole. Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription.') + state: ('On' | 'Off') }? @description('Required. Defines the minimal alert risk level which will be sent as email notifications.') diff --git a/avm/ptn/security/security-center/main.json b/avm/ptn/security/security-center/main.json index f8400fdc75..dcf5d3aa73 100644 --- a/avm/ptn/security/security-center/main.json +++ b/avm/ptn/security/security-center/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.29.47.4906", - "templateHash": "1104248755307814384" + "templateHash": "6305575844099410252" }, "name": "Azure Security Center (Defender for Cloud)", "description": "This module deploys an Azure Security Center (Defender for Cloud) Configuration.", @@ -41,9 +41,8 @@ "Owner", "ServiceAdmin" ], - "nullable": true, "metadata": { - "description": "Optional. Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud." + "description": "Conditional. Required if using notificationsByRole. Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud." } }, "state": { @@ -52,9 +51,8 @@ "Off", "On" ], - "nullable": true, "metadata": { - "description": "Optional. Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription." + "description": "Conditional. Required if using notificationsByRole. Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription." } } },