Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: NetApp - Restructured as per ResourceType structure to & to enable additional capabilities #4043

Open
wants to merge 71 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
7758ded
Initial refactoring
AlexanderSehr Dec 1, 2024
8306d49
Expanded on test
AlexanderSehr Dec 1, 2024
c794003
Removed tests for testing
AlexanderSehr Dec 1, 2024
0e11323
Set retry to 1
AlexanderSehr Dec 1, 2024
dd37c85
Update to latest
AlexanderSehr Dec 1, 2024
de88722
Update to latest
AlexanderSehr Dec 1, 2024
502855f
Update to latest
AlexanderSehr Dec 1, 2024
e01fc61
Update to latest
AlexanderSehr Dec 1, 2024
287f5ff
Update to latest
AlexanderSehr Dec 1, 2024
bf8257a
Update to latest
AlexanderSehr Dec 1, 2024
8865c8b
Update to latest
AlexanderSehr Dec 1, 2024
d317f60
Update to latest
AlexanderSehr Dec 1, 2024
57cff52
Added add. condition
AlexanderSehr Dec 1, 2024
c1d9f4b
Even more conditinoal condition
AlexanderSehr Dec 1, 2024
1a7d4d3
Update to latest
AlexanderSehr Dec 2, 2024
0384d1d
Update to latest
AlexanderSehr Dec 2, 2024
d17e65b
Adjusted region fetch
AlexanderSehr Dec 2, 2024
285082b
Update to latest
AlexanderSehr Dec 2, 2024
7886454
Update to latest
AlexanderSehr Dec 2, 2024
cacfb0d
Update to latest
AlexanderSehr Dec 2, 2024
8c3f6ac
Update to latest
AlexanderSehr Dec 2, 2024
7c37264
Expanded backup implementation
AlexanderSehr Dec 2, 2024
88ce642
Update to latest
AlexanderSehr Dec 2, 2024
3ed8db2
Update to latest
AlexanderSehr Dec 2, 2024
070be7d
Update to latest
AlexanderSehr Dec 2, 2024
cf85e1b
Update to latest
AlexanderSehr Dec 2, 2024
ee17374
Update to latest
AlexanderSehr Dec 3, 2024
fa27217
Update to latest
AlexanderSehr Dec 3, 2024
09ac601
Adjusted creation of policy rules
AlexanderSehr Dec 4, 2024
d27be32
Update to latest
AlexanderSehr Dec 4, 2024
47f8434
Adjusted creation of policy rules
AlexanderSehr Dec 4, 2024
0a05330
Update to latest
AlexanderSehr Dec 5, 2024
f649079
Update to latest
AlexanderSehr Dec 8, 2024
2642aa5
Update to latest
AlexanderSehr Dec 8, 2024
b0583f0
Update to latest
AlexanderSehr Dec 8, 2024
0cbab35
Update to latest
AlexanderSehr Dec 12, 2024
51c4f6e
Update to latest
AlexanderSehr Dec 12, 2024
f516013
Update to latest
AlexanderSehr Dec 12, 2024
387b07d
Update to latest
AlexanderSehr Dec 12, 2024
4236d76
Update to latest
AlexanderSehr Dec 13, 2024
54f5034
Update to latest
AlexanderSehr Dec 13, 2024
3d17be9
Update to latest
AlexanderSehr Dec 13, 2024
3647444
Merge branch 'main' into users/alsehr/netAppStructure
AlexanderSehr Dec 20, 2024
c82b18c
Merged latest main
AlexanderSehr Dec 20, 2024
bab7f14
Added explicit netapp removal
AlexanderSehr Dec 21, 2024
edba240
Update to latest
AlexanderSehr Dec 21, 2024
9ce3f56
Update to latest
AlexanderSehr Dec 21, 2024
209a13c
Update to latest
AlexanderSehr Dec 21, 2024
d100869
Alt approach
AlexanderSehr Dec 21, 2024
b46ef48
Update to latest
AlexanderSehr Dec 21, 2024
85d8b6b
Update to latest
AlexanderSehr Dec 21, 2024
4d4ef27
Update to latest
AlexanderSehr Dec 21, 2024
16bf3a5
Removed snapshot overwrite
AlexanderSehr Dec 21, 2024
7014831
Update to latest
AlexanderSehr Dec 21, 2024
0fe8359
Update to latest
AlexanderSehr Dec 21, 2024
dd7ecf9
Undid temp changes
AlexanderSehr Dec 21, 2024
de89b87
Update to latest
AlexanderSehr Dec 21, 2024
56c33ef
Update to latest
AlexanderSehr Dec 21, 2024
2ad9cfc
Addressed failed tests
AlexanderSehr Dec 21, 2024
b7d8107
Update to latest
AlexanderSehr Dec 21, 2024
d6b6ad6
Merge branch 'main' into users/alsehr/netAppStructure
AlexanderSehr Dec 22, 2024
e4c0ffa
Adjusted removal
AlexanderSehr Dec 22, 2024
151f0fe
Update to latest
AlexanderSehr Dec 22, 2024
3e11e2e
Update to latest
AlexanderSehr Dec 22, 2024
e11c17b
Update to latest
AlexanderSehr Dec 22, 2024
c08fd7d
Update to latest
AlexanderSehr Dec 22, 2024
b7f794c
Update to latest
AlexanderSehr Dec 22, 2024
a2efb3e
Update to latest
AlexanderSehr Dec 22, 2024
42cae05
Undid extracted change
AlexanderSehr Dec 22, 2024
0618e3b
Update to latest
AlexanderSehr Dec 22, 2024
9c16ece
Update to latest
AlexanderSehr Dec 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,861 changes: 1,637 additions & 224 deletions avm/res/net-app/net-app-account/README.md

Large diffs are not rendered by default.

77 changes: 44 additions & 33 deletions avm/res/net-app/net-app-account/backup-policies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ This module deploys a Backup Policy for Azure NetApp File.

## Parameters

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`backupPolicyLocation`](#parameter-backuppolicylocation) | string | The location of the backup policy. Required if the template is used in a standalone deployment. |
| [`dailyBackupsToKeep`](#parameter-dailybackupstokeep) | int | The daily backups to keep. |
| [`monthlyBackupsToKeep`](#parameter-monthlybackupstokeep) | int | The monthly backups to keep. |
| [`weeklyBackupsToKeep`](#parameter-weeklybackupstokeep) | int | The weekly backups to keep. |

**Conditional parameters**

| Parameter | Type | Description |
Expand All @@ -35,12 +26,16 @@ This module deploys a Backup Policy for Azure NetApp File.

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`backupEnabled`](#parameter-backupenabled) | bool | Indicates whether the backup policy is enabled. |
| [`backupPolicyName`](#parameter-backuppolicyname) | string | The name of the backup policy. |
| [`dailyBackupsToKeep`](#parameter-dailybackupstokeep) | int | The daily backups to keep. |
| [`enabled`](#parameter-enabled) | bool | Indicates whether the backup policy is enabled. |
| [`location`](#parameter-location) | string | The location of the backup policy. |
| [`monthlyBackupsToKeep`](#parameter-monthlybackupstokeep) | int | The monthly backups to keep. |
| [`name`](#parameter-name) | string | The name of the backup policy. |
| [`weeklyBackupsToKeep`](#parameter-weeklybackupstokeep) | int | The weekly backups to keep. |

### Parameter: `backupPolicyLocation`
### Parameter: `netAppAccountName`

The location of the backup policy. Required if the template is used in a standalone deployment.
The name of the parent NetApp account. Required if the template is used in a standalone deployment.

- Required: Yes
- Type: string
Expand All @@ -49,45 +44,61 @@ The location of the backup policy. Required if the template is used in a standal

The daily backups to keep.

- Required: Yes
- Type: int

### Parameter: `monthlyBackupsToKeep`

The monthly backups to keep.

- Required: Yes
- Required: No
- Type: int
- Default: `2`
- MinValue: 2
- MaxValue: 1019

### Parameter: `weeklyBackupsToKeep`
### Parameter: `enabled`

The weekly backups to keep.
Indicates whether the backup policy is enabled.

- Required: Yes
- Type: int
- Required: No
- Type: bool
- Default: `True`
- MinValue: 2
- MaxValue: 1019

### Parameter: `netAppAccountName`
### Parameter: `location`

The name of the parent NetApp account. Required if the template is used in a standalone deployment.
The location of the backup policy.

- Required: Yes
- Required: No
- Type: string
- Default: `[resourceGroup().location]`
- MinValue: 2
- MaxValue: 1019

### Parameter: `backupEnabled`
### Parameter: `monthlyBackupsToKeep`

Indicates whether the backup policy is enabled.
The monthly backups to keep.

- Required: No
- Type: bool
- Default: `False`
- Type: int
- Default: `0`
- MinValue: 2
- MaxValue: 1019

### Parameter: `backupPolicyName`
### Parameter: `name`

The name of the backup policy.

- Required: No
- Type: string
- Default: `'backupPolicy'`
- MinValue: 2
- MaxValue: 1019

### Parameter: `weeklyBackupsToKeep`

The weekly backups to keep.

- Required: No
- Type: int
- Default: `0`
- MinValue: 2
- MaxValue: 1019

## Outputs

Expand Down
30 changes: 16 additions & 14 deletions avm/res/net-app/net-app-account/backup-policies/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,38 @@ metadata owner = 'Azure/module-maintainers'
param netAppAccountName string

@description('Optional. The name of the backup policy.')
param backupPolicyName string = 'backupPolicy'
param name string = 'backupPolicy'

@description('Required. The location of the backup policy. Required if the template is used in a standalone deployment.')
param backupPolicyLocation string
@description('Optional. The location of the backup policy.')
param location string = resourceGroup().location

@description('Required. The daily backups to keep.')
param dailyBackupsToKeep int
@description('Optional. The daily backups to keep.')
@minValue(2)
@maxValue(1019)
param dailyBackupsToKeep int = 2

@description('Required. The monthly backups to keep.')
param monthlyBackupsToKeep int
@description('Optional. The monthly backups to keep.')
param monthlyBackupsToKeep int = 0

@description('Required. The weekly backups to keep.')
param weeklyBackupsToKeep int
@description('Optional. The weekly backups to keep.')
param weeklyBackupsToKeep int = 0

@description('Optional. Indicates whether the backup policy is enabled.')
param backupEnabled bool = false
param enabled bool = true

resource netAppAccount 'Microsoft.NetApp/netAppAccounts@2024-03-01' existing = {
name: netAppAccountName
}

resource backupPolicies 'Microsoft.NetApp/netAppAccounts/backupPolicies@2024-03-01' = {
name: backupPolicyName
name: name
parent: netAppAccount
location: backupPolicyLocation
location: location
properties: {
enabled: enabled
dailyBackupsToKeep: dailyBackupsToKeep
enabled: backupEnabled
monthlyBackupsToKeep: monthlyBackupsToKeep
weeklyBackupsToKeep: weeklyBackupsToKeep
monthlyBackupsToKeep: monthlyBackupsToKeep
}
}
@description('The resource IDs of the backup Policy created within volume.')
Expand Down
40 changes: 23 additions & 17 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.28.1.47646",
"templateHash": "15255260076655189132"
"version": "0.32.4.45862",
"templateHash": "9819080339239432564"
},
"name": "Azure NetApp Files Backup Policy",
"description": "This module deploys a Backup Policy for Azure NetApp File.",
Expand All @@ -18,40 +18,46 @@
"description": "Conditional. The name of the parent NetApp account. Required if the template is used in a standalone deployment."
}
},
"backupPolicyName": {
"name": {
"type": "string",
"defaultValue": "backupPolicy",
"metadata": {
"description": "Optional. The name of the backup policy."
}
},
"backupPolicyLocation": {
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Required. The location of the backup policy. Required if the template is used in a standalone deployment."
"description": "Optional. The location of the backup policy."
}
},
"dailyBackupsToKeep": {
"type": "int",
"defaultValue": 2,
"minValue": 2,
"maxValue": 1019,
"metadata": {
"description": "Required. The daily backups to keep."
"description": "Optional. The daily backups to keep."
}
},
"monthlyBackupsToKeep": {
"type": "int",
"defaultValue": 0,
"metadata": {
"description": "Required. The monthly backups to keep."
"description": "Optional. The monthly backups to keep."
}
},
"weeklyBackupsToKeep": {
"type": "int",
"defaultValue": 0,
"metadata": {
"description": "Required. The weekly backups to keep."
"description": "Optional. The weekly backups to keep."
}
},
"backupEnabled": {
"enabled": {
"type": "bool",
"defaultValue": false,
"defaultValue": true,
"metadata": {
"description": "Optional. Indicates whether the backup policy is enabled."
}
Expand All @@ -61,13 +67,13 @@
{
"type": "Microsoft.NetApp/netAppAccounts/backupPolicies",
"apiVersion": "2024-03-01",
"name": "[format('{0}/{1}', parameters('netAppAccountName'), parameters('backupPolicyName'))]",
"location": "[parameters('backupPolicyLocation')]",
"name": "[format('{0}/{1}', parameters('netAppAccountName'), parameters('name'))]",
"location": "[parameters('location')]",
"properties": {
"enabled": "[parameters('enabled')]",
"dailyBackupsToKeep": "[parameters('dailyBackupsToKeep')]",
"enabled": "[parameters('backupEnabled')]",
"monthlyBackupsToKeep": "[parameters('monthlyBackupsToKeep')]",
"weeklyBackupsToKeep": "[parameters('weeklyBackupsToKeep')]"
"weeklyBackupsToKeep": "[parameters('weeklyBackupsToKeep')]",
"monthlyBackupsToKeep": "[parameters('monthlyBackupsToKeep')]"
}
}
],
Expand All @@ -77,14 +83,14 @@
"metadata": {
"description": "The resource IDs of the backup Policy created within volume."
},
"value": "[resourceId('Microsoft.NetApp/netAppAccounts/backupPolicies', parameters('netAppAccountName'), parameters('backupPolicyName'))]"
"value": "[resourceId('Microsoft.NetApp/netAppAccounts/backupPolicies', parameters('netAppAccountName'), parameters('name'))]"
},
"name": {
"type": "string",
"metadata": {
"description": "The name of the Backup Policy."
},
"value": "[parameters('backupPolicyName')]"
"value": "[parameters('name')]"
},
"resourceGroupName": {
"type": "string",
Expand Down
121 changes: 121 additions & 0 deletions avm/res/net-app/net-app-account/backup-vault/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Azure NetApp Files Volume Backup Vault `[Microsoft.NetApp/netAppAccounts/backupVaults]`

This module create a NetApps Files Backup Vault.

## Navigation

- [Resource Types](#Resource-Types)
- [Parameters](#Parameters)
- [Outputs](#Outputs)

## Resource Types

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.NetApp/netAppAccounts/backupVaults` | [2024-03-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/2024-03-01/netAppAccounts/backupVaults) |
| `Microsoft.NetApp/netAppAccounts/backupVaults/backups` | [2024-03-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/2024-03-01/netAppAccounts/backupVaults/backups) |

## Parameters

**Conditional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`netAppAccountName`](#parameter-netappaccountname) | string | The name of the parent NetApp account. Required if the template is used in a standalone deployment. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`backups`](#parameter-backups) | array | The list of backups to create. |
| [`location`](#parameter-location) | string | Location of the backup vault. |
| [`name`](#parameter-name) | string | The name of the backup vault. |

### Parameter: `netAppAccountName`

The name of the parent NetApp account. Required if the template is used in a standalone deployment.

- Required: Yes
- Type: string

### Parameter: `backups`

The list of backups to create.

- Required: No
- Type: array

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`capacityPoolName`](#parameter-backupscapacitypoolname) | string | The name of the capacity pool containing the volumne. |
| [`volumeName`](#parameter-backupsvolumename) | string | The name of the volume to backup. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`label`](#parameter-backupslabel) | string | Label for backup. |
| [`name`](#parameter-backupsname) | string | The name of the backup. |
| [`snapshotName`](#parameter-backupssnapshotname) | string | The name of the snapshot. |

### Parameter: `backups.capacityPoolName`

The name of the capacity pool containing the volumne.

- Required: Yes
- Type: string

### Parameter: `backups.volumeName`

The name of the volume to backup.

- Required: Yes
- Type: string

### Parameter: `backups.label`

Label for backup.

- Required: No
- Type: string

### Parameter: `backups.name`

The name of the backup.

- Required: No
- Type: string

### Parameter: `backups.snapshotName`

The name of the snapshot.

- Required: No
- Type: string

### Parameter: `location`

Location of the backup vault.

- Required: No
- Type: string
- Default: `[resourceGroup().location]`

### Parameter: `name`

The name of the backup vault.

- Required: No
- Type: string
- Default: `'vault'`

## Outputs

| Output | Type | Description |
| :-- | :-- | :-- |
| `location` | string | The location the resource was deployed into. |
| `name` | string | The name of the backup vault. |
| `resourceGroupName` | string | The name of the Resource Group the backup vault was created in. |
| `resourceId` | string | The Resource ID of the backup vault. |
Loading
Loading