Skip to content

Commit

Permalink
feat: added new netapp volume properties (#3866)
Browse files Browse the repository at this point in the history
## Description

<!--
The following new optional properties were added to NetApp volume:

- smbEncryption
- smbContinuouslyAvailable
- smbNonBrowsable

Closes #3788 
-->

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->


[![avm.res.net-app.net-app-account](https://github.com/fbinotto/bicep-registry-modules/actions/workflows/avm.res.net-app.net-app-account.yml/badge.svg?branch=users%2Ffbinotto%2Ffeature-3788)](https://github.com/fbinotto/bicep-registry-modules/actions/workflows/avm.res.net-app.net-app-account.yml)

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [X] Azure Verified Module updates:
- [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [X] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

## Checklist

- [X] I'm sure there are no other open Pull Requests for the same
update/change
- [X] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [X] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->

---------

Co-authored-by: Felipe Binotto <[email protected]>
  • Loading branch information
fbinotto and fbinottoms authored Dec 2, 2024
1 parent e233dbe commit ff7bdfc
Show file tree
Hide file tree
Showing 10 changed files with 176 additions and 39 deletions.
9 changes: 9 additions & 0 deletions avm/res/net-app/net-app-account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ module netAppAccount 'br/public:avm/res/net-app/net-app-account:<version>' = {
protocolTypes: [
'NFSv4.1'
]
smbContinuouslyAvailable: false
smbEncryption: false
smbNonBrowsable: 'Disabled'
subnetResourceId: '<subnetResourceId>'
usageThreshold: 107374182400
zones: [
Expand Down Expand Up @@ -316,6 +319,9 @@ module netAppAccount 'br/public:avm/res/net-app/net-app-account:<version>' = {
"protocolTypes": [
"NFSv4.1"
],
"smbContinuouslyAvailable": false,
"smbEncryption": false,
"smbNonBrowsable": "Disabled",
"subnetResourceId": "<subnetResourceId>",
"usageThreshold": 107374182400,
"zones": [
Expand Down Expand Up @@ -458,6 +464,9 @@ param capacityPools = [
protocolTypes: [
'NFSv4.1'
]
smbContinuouslyAvailable: false
smbEncryption: false
smbNonBrowsable: 'Disabled'
subnetResourceId: '<subnetResourceId>'
usageThreshold: 107374182400
zones: [
Expand Down
4 changes: 2 additions & 2 deletions avm/res/net-app/net-app-account/backup-policies/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.31.92.45157",
"templateHash": "7603372758800543114"
"version": "0.28.1.47646",
"templateHash": "15255260076655189132"
},
"name": "Azure NetApp Files Backup Policy",
"description": "This module deploys a Backup Policy for Azure NetApp File.",
Expand Down
45 changes: 35 additions & 10 deletions avm/res/net-app/net-app-account/capacity-pool/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.31.92.45157",
"templateHash": "3730866544800685451"
"version": "0.28.1.47646",
"templateHash": "1366013891071224264"
},
"name": "Azure NetApp Files Capacity Pools",
"description": "This module deploys an Azure NetApp Files Capacity Pool.",
Expand Down Expand Up @@ -442,8 +442,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.31.92.45157",
"templateHash": "9959623373940729999"
"version": "0.28.1.47646",
"templateHash": "14328317888842072540"
},
"name": "Azure NetApp Files Capacity Pool Volumes",
"description": "This module deploys an Azure NetApp Files Capacity Pool Volume.",
Expand Down Expand Up @@ -911,7 +911,32 @@
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Optional. Boolean to enable replication."
"description": "Optional. Enables replication."
}
},
"smbEncryption": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Optional. Enables SMB encryption. Only applicable for SMB/DualProtocol volume."
}
},
"smbContinuouslyAvailable": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Optional. Enables continuously available share property for SMB volume. Only applicable for SMB volume."
}
},
"smbNonBrowsable": {
"type": "string",
"defaultValue": "Disabled",
"allowedValues": [
"Enabled",
"Disabled"
],
"metadata": {
"description": "Optional. Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume."
}
}
},
Expand Down Expand Up @@ -952,7 +977,7 @@
"apiVersion": "2024-03-01",
"name": "[format('{0}/{1}/{2}', parameters('netAppAccountName'), parameters('capacityPoolName'), parameters('name'))]",
"location": "[parameters('location')]",
"properties": "[shallowMerge(createArray(createObject('coolAccess', parameters('coolAccess'), 'coolAccessRetrievalPolicy', parameters('coolAccessRetrievalPolicy'), 'coolnessPeriod', parameters('coolnessPeriod'), 'encryptionKeySource', parameters('encryptionKeySource')), if(not(equals(parameters('encryptionKeySource'), 'Microsoft.NetApp')), createObject('keyVaultPrivateEndpointResourceId', parameters('keyVaultPrivateEndpointResourceId')), createObject()), if(not(equals(parameters('volumeType'), '')), createObject('volumeType', parameters('volumeType'), 'dataProtection', createObject('replication', if(parameters('replicationEnabled'), createObject('endpointType', parameters('endpointType'), 'remoteVolumeRegion', parameters('remoteVolumeRegion'), 'remoteVolumeResourceId', parameters('remoteVolumeResourceId'), 'replicationSchedule', parameters('replicationSchedule')), createObject()), 'backup', if(parameters('backupEnabled'), createObject('backupPolicyId', reference('backupPolicies').outputs.resourceId.value, 'policyEnforced', parameters('policyEnforced'), 'backupVaultId', parameters('backupVaultResourceId')), createObject()), 'snapshot', if(parameters('snapEnabled'), createObject('snapshotPolicyId', reference('snapshotPolicies').outputs.resourceId.value), createObject()))), createObject()), createObject('networkFeatures', parameters('networkFeatures'), 'serviceLevel', parameters('serviceLevel'), 'creationToken', parameters('creationToken'), 'usageThreshold', parameters('usageThreshold'), 'protocolTypes', parameters('protocolTypes'), 'subnetId', parameters('subnetResourceId'), 'exportPolicy', if(not(empty(parameters('exportPolicyRules'))), createObject('rules', parameters('exportPolicyRules')), null()))))]",
"properties": "[shallowMerge(createArray(createObject('coolAccess', parameters('coolAccess'), 'coolAccessRetrievalPolicy', parameters('coolAccessRetrievalPolicy'), 'coolnessPeriod', parameters('coolnessPeriod'), 'encryptionKeySource', parameters('encryptionKeySource')), if(not(equals(parameters('encryptionKeySource'), 'Microsoft.NetApp')), createObject('keyVaultPrivateEndpointResourceId', parameters('keyVaultPrivateEndpointResourceId')), createObject()), if(not(equals(parameters('volumeType'), '')), createObject('volumeType', parameters('volumeType'), 'dataProtection', createObject('replication', if(parameters('replicationEnabled'), createObject('endpointType', parameters('endpointType'), 'remoteVolumeRegion', parameters('remoteVolumeRegion'), 'remoteVolumeResourceId', parameters('remoteVolumeResourceId'), 'replicationSchedule', parameters('replicationSchedule')), createObject()), 'backup', if(parameters('backupEnabled'), createObject('backupPolicyId', reference('backupPolicies').outputs.resourceId.value, 'policyEnforced', parameters('policyEnforced'), 'backupVaultId', parameters('backupVaultResourceId')), createObject()), 'snapshot', if(parameters('snapEnabled'), createObject('snapshotPolicyId', reference('snapshotPolicies').outputs.resourceId.value), createObject()))), createObject()), createObject('networkFeatures', parameters('networkFeatures'), 'serviceLevel', parameters('serviceLevel'), 'creationToken', parameters('creationToken'), 'usageThreshold', parameters('usageThreshold'), 'protocolTypes', parameters('protocolTypes'), 'subnetId', parameters('subnetResourceId'), 'exportPolicy', if(not(empty(parameters('exportPolicyRules'))), createObject('rules', parameters('exportPolicyRules')), null()), 'smbContinuouslyAvailable', parameters('smbContinuouslyAvailable'), 'smbEncryption', parameters('smbEncryption'), 'smbNonBrowsable', parameters('smbNonBrowsable'))))]",
"zones": "[parameters('zones')]",
"dependsOn": [
"backupPolicies",
Expand Down Expand Up @@ -1041,8 +1066,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.31.92.45157",
"templateHash": "7603372758800543114"
"version": "0.28.1.47646",
"templateHash": "15255260076655189132"
},
"name": "Azure NetApp Files Backup Policy",
"description": "This module deploys a Backup Policy for Azure NetApp File.",
Expand Down Expand Up @@ -1212,8 +1237,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.31.92.45157",
"templateHash": "16621946217169811859"
"version": "0.28.1.47646",
"templateHash": "17696312984702506132"
},
"name": "Azure NetApp Files Snapshot Policy",
"description": "This module deploys a Snapshot Policy for an Azure NetApp File.",
Expand Down
38 changes: 36 additions & 2 deletions avm/res/net-app/net-app-account/capacity-pool/volume/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ This module deploys an Azure NetApp Files Capacity Pool Volume.
| [`networkFeatures`](#parameter-networkfeatures) | string | Network feature for the volume. |
| [`policyEnforced`](#parameter-policyenforced) | bool | If Backup policy is enforced. |
| [`protocolTypes`](#parameter-protocoltypes) | array | Set of protocol types. |
| [`replicationEnabled`](#parameter-replicationenabled) | bool | Boolean to enable replication. |
| [`replicationEnabled`](#parameter-replicationenabled) | bool | Enables replication. |
| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`serviceLevel`](#parameter-servicelevel) | string | The pool service level. Must match the one of the parent capacity pool. |
| [`smbContinuouslyAvailable`](#parameter-smbcontinuouslyavailable) | bool | Enables continuously available share property for SMB volume. Only applicable for SMB volume. |
| [`smbEncryption`](#parameter-smbencryption) | bool | Enables SMB encryption. Only applicable for SMB/DualProtocol volume. |
| [`smbNonBrowsable`](#parameter-smbnonbrowsable) | string | Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. |
| [`snapEnabled`](#parameter-snapenabled) | bool | Indicates whether the snapshot policy is enabled. |
| [`zones`](#parameter-zones) | array | Zone where the volume will be placed. |

Expand Down Expand Up @@ -496,7 +499,7 @@ Set of protocol types.

### Parameter: `replicationEnabled`

Boolean to enable replication.
Enables replication.

- Required: No
- Type: bool
Expand Down Expand Up @@ -622,6 +625,37 @@ The pool service level. Must match the one of the parent capacity pool.
]
```

### Parameter: `smbContinuouslyAvailable`

Enables continuously available share property for SMB volume. Only applicable for SMB volume.

- Required: No
- Type: bool
- Default: `False`

### Parameter: `smbEncryption`

Enables SMB encryption. Only applicable for SMB/DualProtocol volume.

- Required: No
- Type: bool
- Default: `False`

### Parameter: `smbNonBrowsable`

Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume.

- Required: No
- Type: string
- Default: `'Disabled'`
- Allowed:
```Bicep
[
'Disabled'
'Enabled'
]
```

### Parameter: `snapEnabled`

Indicates whether the snapshot policy is enabled.
Expand Down
18 changes: 17 additions & 1 deletion avm/res/net-app/net-app-account/capacity-pool/volume/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,22 @@ param roleAssignments roleAssignmentType[]?
@description('Required. The Id of the Backup Vault.')
param backupVaultResourceId string

@description('Optional. Boolean to enable replication.')
@description('Optional. Enables replication.')
param replicationEnabled bool = true

@description('Optional. Enables SMB encryption. Only applicable for SMB/DualProtocol volume.')
param smbEncryption bool = false

@description('Optional. Enables continuously available share property for SMB volume. Only applicable for SMB volume.')
param smbContinuouslyAvailable bool = false

@description('Optional. Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume.')
@allowed([
'Enabled'
'Disabled'
])
param smbNonBrowsable string = 'Disabled'

var builtInRoleNames = {
Contributor: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
Owner: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')
Expand Down Expand Up @@ -282,6 +295,9 @@ resource volume 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes@2024-03-0
rules: exportPolicyRules
}
: null
smbContinuouslyAvailable: smbContinuouslyAvailable
smbEncryption: smbEncryption
smbNonBrowsable: smbNonBrowsable
}
zones: zones
}
Expand Down
41 changes: 33 additions & 8 deletions avm/res/net-app/net-app-account/capacity-pool/volume/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.31.92.45157",
"templateHash": "9959623373940729999"
"version": "0.28.1.47646",
"templateHash": "14328317888842072540"
},
"name": "Azure NetApp Files Capacity Pool Volumes",
"description": "This module deploys an Azure NetApp Files Capacity Pool Volume.",
Expand Down Expand Up @@ -474,7 +474,32 @@
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Optional. Boolean to enable replication."
"description": "Optional. Enables replication."
}
},
"smbEncryption": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Optional. Enables SMB encryption. Only applicable for SMB/DualProtocol volume."
}
},
"smbContinuouslyAvailable": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Optional. Enables continuously available share property for SMB volume. Only applicable for SMB volume."
}
},
"smbNonBrowsable": {
"type": "string",
"defaultValue": "Disabled",
"allowedValues": [
"Enabled",
"Disabled"
],
"metadata": {
"description": "Optional. Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume."
}
}
},
Expand Down Expand Up @@ -515,7 +540,7 @@
"apiVersion": "2024-03-01",
"name": "[format('{0}/{1}/{2}', parameters('netAppAccountName'), parameters('capacityPoolName'), parameters('name'))]",
"location": "[parameters('location')]",
"properties": "[shallowMerge(createArray(createObject('coolAccess', parameters('coolAccess'), 'coolAccessRetrievalPolicy', parameters('coolAccessRetrievalPolicy'), 'coolnessPeriod', parameters('coolnessPeriod'), 'encryptionKeySource', parameters('encryptionKeySource')), if(not(equals(parameters('encryptionKeySource'), 'Microsoft.NetApp')), createObject('keyVaultPrivateEndpointResourceId', parameters('keyVaultPrivateEndpointResourceId')), createObject()), if(not(equals(parameters('volumeType'), '')), createObject('volumeType', parameters('volumeType'), 'dataProtection', createObject('replication', if(parameters('replicationEnabled'), createObject('endpointType', parameters('endpointType'), 'remoteVolumeRegion', parameters('remoteVolumeRegion'), 'remoteVolumeResourceId', parameters('remoteVolumeResourceId'), 'replicationSchedule', parameters('replicationSchedule')), createObject()), 'backup', if(parameters('backupEnabled'), createObject('backupPolicyId', reference('backupPolicies').outputs.resourceId.value, 'policyEnforced', parameters('policyEnforced'), 'backupVaultId', parameters('backupVaultResourceId')), createObject()), 'snapshot', if(parameters('snapEnabled'), createObject('snapshotPolicyId', reference('snapshotPolicies').outputs.resourceId.value), createObject()))), createObject()), createObject('networkFeatures', parameters('networkFeatures'), 'serviceLevel', parameters('serviceLevel'), 'creationToken', parameters('creationToken'), 'usageThreshold', parameters('usageThreshold'), 'protocolTypes', parameters('protocolTypes'), 'subnetId', parameters('subnetResourceId'), 'exportPolicy', if(not(empty(parameters('exportPolicyRules'))), createObject('rules', parameters('exportPolicyRules')), null()))))]",
"properties": "[shallowMerge(createArray(createObject('coolAccess', parameters('coolAccess'), 'coolAccessRetrievalPolicy', parameters('coolAccessRetrievalPolicy'), 'coolnessPeriod', parameters('coolnessPeriod'), 'encryptionKeySource', parameters('encryptionKeySource')), if(not(equals(parameters('encryptionKeySource'), 'Microsoft.NetApp')), createObject('keyVaultPrivateEndpointResourceId', parameters('keyVaultPrivateEndpointResourceId')), createObject()), if(not(equals(parameters('volumeType'), '')), createObject('volumeType', parameters('volumeType'), 'dataProtection', createObject('replication', if(parameters('replicationEnabled'), createObject('endpointType', parameters('endpointType'), 'remoteVolumeRegion', parameters('remoteVolumeRegion'), 'remoteVolumeResourceId', parameters('remoteVolumeResourceId'), 'replicationSchedule', parameters('replicationSchedule')), createObject()), 'backup', if(parameters('backupEnabled'), createObject('backupPolicyId', reference('backupPolicies').outputs.resourceId.value, 'policyEnforced', parameters('policyEnforced'), 'backupVaultId', parameters('backupVaultResourceId')), createObject()), 'snapshot', if(parameters('snapEnabled'), createObject('snapshotPolicyId', reference('snapshotPolicies').outputs.resourceId.value), createObject()))), createObject()), createObject('networkFeatures', parameters('networkFeatures'), 'serviceLevel', parameters('serviceLevel'), 'creationToken', parameters('creationToken'), 'usageThreshold', parameters('usageThreshold'), 'protocolTypes', parameters('protocolTypes'), 'subnetId', parameters('subnetResourceId'), 'exportPolicy', if(not(empty(parameters('exportPolicyRules'))), createObject('rules', parameters('exportPolicyRules')), null()), 'smbContinuouslyAvailable', parameters('smbContinuouslyAvailable'), 'smbEncryption', parameters('smbEncryption'), 'smbNonBrowsable', parameters('smbNonBrowsable'))))]",
"zones": "[parameters('zones')]",
"dependsOn": [
"backupPolicies",
Expand Down Expand Up @@ -604,8 +629,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.31.92.45157",
"templateHash": "7603372758800543114"
"version": "0.28.1.47646",
"templateHash": "15255260076655189132"
},
"name": "Azure NetApp Files Backup Policy",
"description": "This module deploys a Backup Policy for Azure NetApp File.",
Expand Down Expand Up @@ -775,8 +800,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.31.92.45157",
"templateHash": "16621946217169811859"
"version": "0.28.1.47646",
"templateHash": "17696312984702506132"
},
"name": "Azure NetApp Files Snapshot Policy",
"description": "This module deploys a Snapshot Policy for an Azure NetApp File.",
Expand Down
Loading

0 comments on commit ff7bdfc

Please sign in to comment.