Skip to content

Commit

Permalink
adding conditional params
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Box committed Aug 7, 2024
1 parent 1e359cd commit 0e83964
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
14 changes: 7 additions & 7 deletions avm/ptn/security/security-center/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions avm/ptn/security/security-center/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down
8 changes: 3 additions & 5 deletions avm/ptn/security/security-center/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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": {
Expand All @@ -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."
}
}
},
Expand Down

0 comments on commit 0e83964

Please sign in to comment.