Skip to content

Commit

Permalink
[Modules] Updated API version of NetApp (#3836)
Browse files Browse the repository at this point in the history
* Updated netapp api

* Expanded allowed versions
  • Loading branch information
AlexanderSehr authored Aug 28, 2023
1 parent 5a8431e commit 62d8095
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 63 deletions.
6 changes: 3 additions & 3 deletions modules/net-app/net-app-account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ This module deploys an Azure NetApp File.
| :-- | :-- |
| `Microsoft.Authorization/locks` | [2020-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.NetApp/netAppAccounts` | [2022-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/netAppAccounts) |
| `Microsoft.NetApp/netAppAccounts/capacityPools` | [2022-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/netAppAccounts/capacityPools) |
| `Microsoft.NetApp/netAppAccounts/capacityPools/volumes` | [2022-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/netAppAccounts/capacityPools/volumes) |
| `Microsoft.NetApp/netAppAccounts` | [2022-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/netAppAccounts) |
| `Microsoft.NetApp/netAppAccounts/capacityPools` | [2022-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/netAppAccounts/capacityPools) |
| `Microsoft.NetApp/netAppAccounts/capacityPools/volumes` | [2022-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/netAppAccounts/capacityPools/volumes) |

## Parameters

Expand Down
5 changes: 3 additions & 2 deletions modules/net-app/net-app-account/capacity-pool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ This module deploys an Azure NetApp Files Capacity Pool.
| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.NetApp/netAppAccounts/capacityPools` | [2022-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/netAppAccounts/capacityPools) |
| `Microsoft.NetApp/netAppAccounts/capacityPools/volumes` | [2022-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/netAppAccounts/capacityPools/volumes) |
| `Microsoft.NetApp/netAppAccounts/capacityPools` | [2022-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/netAppAccounts/capacityPools) |
| `Microsoft.NetApp/netAppAccounts/capacityPools/volumes` | [2022-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/netAppAccounts/capacityPools/volumes) |

## Parameters

Expand All @@ -38,6 +38,7 @@ This module deploys an Azure NetApp Files Capacity Pool.
| :-- | :-- | :-- | :-- | :-- |
| `coolAccess` | bool | `False` | | If enabled (true) the pool can contain cool Access enabled volumes. |
| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). |
| `encryptionType` | string | `'Single'` | `[Double, Single]` | Encryption type of the capacity pool, set encryption type for data at rest for this pool and all volumes in it. This value can only be set when creating new pool. |
| `location` | string | `[resourceGroup().location]` | | Location of the pool volume. |
| `qosType` | string | `'Auto'` | `[Auto, Manual]` | The qos type of the pool. |
| `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
Expand Down
12 changes: 10 additions & 2 deletions modules/net-app/net-app-account/capacity-pool/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ param coolAccess bool = false
@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
param roleAssignments array = []

@description('Optional. Encryption type of the capacity pool, set encryption type for data at rest for this pool and all volumes in it. This value can only be set when creating new pool.')
@allowed([
'Double'
'Single'
])
param encryptionType string = 'Single'

@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
param enableDefaultTelemetry bool = true

Expand All @@ -59,11 +66,11 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena
}
}

resource netAppAccount 'Microsoft.NetApp/netAppAccounts@2022-09-01' existing = {
resource netAppAccount 'Microsoft.NetApp/netAppAccounts@2022-11-01' existing = {
name: netAppAccountName
}

resource capacityPool 'Microsoft.NetApp/netAppAccounts/capacityPools@2022-09-01' = {
resource capacityPool 'Microsoft.NetApp/netAppAccounts/capacityPools@2022-11-01' = {
name: name
parent: netAppAccount
location: location
Expand All @@ -73,6 +80,7 @@ resource capacityPool 'Microsoft.NetApp/netAppAccounts/capacityPools@2022-09-01'
size: size
qosType: qosType
coolAccess: coolAccess
encryptionType: encryptionType
}
}

Expand Down
48 changes: 33 additions & 15 deletions modules/net-app/net-app-account/capacity-pool/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.19.5.34762",
"templateHash": "5582726599079259116"
}
"version": "0.20.4.51522",
"templateHash": "13333372953499047799"
},
"name": "Azure NetApp Files Capacity Pools",
"description": "This module deploys an Azure NetApp Files Capacity Pool.",
"owner": "Azure/module-maintainers"
},
"parameters": {
"netAppAccountName": {
Expand Down Expand Up @@ -86,6 +89,17 @@
"description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"encryptionType": {
"type": "string",
"defaultValue": "Single",
"allowedValues": [
"Double",
"Single"
],
"metadata": {
"description": "Optional. Encryption type of the capacity pool, set encryption type for data at rest for this pool and all volumes in it. This value can only be set when creating new pool."
}
},
"enableDefaultTelemetry": {
"type": "bool",
"defaultValue": true,
Expand Down Expand Up @@ -114,15 +128,16 @@
},
{
"type": "Microsoft.NetApp/netAppAccounts/capacityPools",
"apiVersion": "2022-09-01",
"apiVersion": "2022-11-01",
"name": "[format('{0}/{1}', parameters('netAppAccountName'), parameters('name'))]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
"properties": {
"serviceLevel": "[parameters('serviceLevel')]",
"size": "[parameters('size')]",
"qosType": "[parameters('qosType')]",
"coolAccess": "[parameters('coolAccess')]"
"coolAccess": "[parameters('coolAccess')]",
"encryptionType": "[parameters('encryptionType')]"
}
},
{
Expand Down Expand Up @@ -176,9 +191,12 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.19.5.34762",
"templateHash": "4861424102878838813"
}
"version": "0.20.4.51522",
"templateHash": "5724175752968001086"
},
"name": "Azure NetApp Files Capacity Pool Volumes",
"description": "This module deploys an Azure NetApp Files Capacity Pool Volume.",
"owner": "Azure/module-maintainers"
},
"parameters": {
"netAppAccountName": {
Expand Down Expand Up @@ -284,7 +302,7 @@
},
{
"type": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
"apiVersion": "2022-09-01",
"apiVersion": "2022-11-01",
"name": "[format('{0}/{1}/{2}', parameters('netAppAccountName'), parameters('capacityPoolName'), parameters('name'))]",
"location": "[parameters('location')]",
"properties": {
Expand Down Expand Up @@ -330,8 +348,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.19.5.34762",
"templateHash": "2805945634543671808"
"version": "0.20.4.51522",
"templateHash": "6579931820257793193"
}
},
"parameters": {
Expand Down Expand Up @@ -472,7 +490,7 @@
"metadata": {
"description": "The location the resource was deployed into."
},
"value": "[reference(resourceId('Microsoft.NetApp/netAppAccounts/capacityPools/volumes', parameters('netAppAccountName'), parameters('capacityPoolName'), parameters('name')), '2022-09-01', 'full').location]"
"value": "[reference(resourceId('Microsoft.NetApp/netAppAccounts/capacityPools/volumes', parameters('netAppAccountName'), parameters('capacityPoolName'), parameters('name')), '2022-11-01', 'full').location]"
}
}
}
Expand Down Expand Up @@ -515,8 +533,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.19.5.34762",
"templateHash": "3662901243445895322"
"version": "0.20.4.51522",
"templateHash": "6567527079478034080"
}
},
"parameters": {
Expand Down Expand Up @@ -657,7 +675,7 @@
"metadata": {
"description": "The location the resource was deployed into."
},
"value": "[reference(resourceId('Microsoft.NetApp/netAppAccounts/capacityPools', parameters('netAppAccountName'), parameters('name')), '2022-09-01', 'full').location]"
"value": "[reference(resourceId('Microsoft.NetApp/netAppAccounts/capacityPools', parameters('netAppAccountName'), parameters('name')), '2022-11-01', 'full').location]"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This module deploys an Azure NetApp Files Capacity Pool Volume.
| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.NetApp/netAppAccounts/capacityPools/volumes` | [2022-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/netAppAccounts/capacityPools/volumes) |
| `Microsoft.NetApp/netAppAccounts/capacityPools/volumes` | [2022-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.NetApp/netAppAccounts/capacityPools/volumes) |

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena
}
}

resource netAppAccount 'Microsoft.NetApp/netAppAccounts@2022-09-01' existing = {
resource netAppAccount 'Microsoft.NetApp/netAppAccounts@2022-11-01' existing = {
name: netAppAccountName

resource capacityPool 'capacityPools@2022-05-01' existing = {
resource capacityPool 'capacityPools@2022-11-01' existing = {
name: capacityPoolName
}
}

resource volume 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes@2022-09-01' = {
resource volume 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes@2022-11-01' = {
name: name
parent: netAppAccount::capacityPool
location: location
Expand Down
17 changes: 10 additions & 7 deletions modules/net-app/net-app-account/capacity-pool/volume/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.19.5.34762",
"templateHash": "4861424102878838813"
}
"version": "0.20.4.51522",
"templateHash": "5724175752968001086"
},
"name": "Azure NetApp Files Capacity Pool Volumes",
"description": "This module deploys an Azure NetApp Files Capacity Pool Volume.",
"owner": "Azure/module-maintainers"
},
"parameters": {
"netAppAccountName": {
Expand Down Expand Up @@ -112,7 +115,7 @@
},
{
"type": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
"apiVersion": "2022-09-01",
"apiVersion": "2022-11-01",
"name": "[format('{0}/{1}/{2}', parameters('netAppAccountName'), parameters('capacityPoolName'), parameters('name'))]",
"location": "[parameters('location')]",
"properties": {
Expand Down Expand Up @@ -158,8 +161,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.19.5.34762",
"templateHash": "2805945634543671808"
"version": "0.20.4.51522",
"templateHash": "6579931820257793193"
}
},
"parameters": {
Expand Down Expand Up @@ -300,7 +303,7 @@
"metadata": {
"description": "The location the resource was deployed into."
},
"value": "[reference(resourceId('Microsoft.NetApp/netAppAccounts/capacityPools/volumes', parameters('netAppAccountName'), parameters('capacityPoolName'), parameters('name')), '2022-09-01', 'full').location]"
"value": "[reference(resourceId('Microsoft.NetApp/netAppAccounts/capacityPools/volumes', parameters('netAppAccountName'), parameters('capacityPoolName'), parameters('name')), '2022-11-01', 'full').location]"
}
}
}
4 changes: 3 additions & 1 deletion modules/net-app/net-app-account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena
}
}

resource netAppAccount 'Microsoft.NetApp/netAppAccounts@2022-09-01' = {
resource netAppAccount 'Microsoft.NetApp/netAppAccounts@2022-11-01' = {
name: name
tags: tags
identity: identity
Expand Down Expand Up @@ -126,6 +126,8 @@ module netAppAccount_capacityPools 'capacity-pool/main.bicep' = [for (capacityPo
volumes: contains(capacityPool, 'volumes') ? capacityPool.volumes : []
coolAccess: contains(capacityPool, 'coolAccess') ? capacityPool.coolAccess : false
roleAssignments: contains(capacityPool, 'roleAssignments') ? capacityPool.roleAssignments : []
encryptionType: contains(capacityPool, 'encryptionType') ? capacityPool.encryptionType : 'Single'
tags: contains(capacityPool, 'tags') ? capacityPool.tags : {}
enableDefaultTelemetry: enableReferencedModulesTelemetry
}
}]
Expand Down
Loading

0 comments on commit 62d8095

Please sign in to comment.