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

[Modules] Changed to updated API and also added new feature properties #1490

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ param storageTypeState string = 'Locked'
@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).')
param enableDefaultTelemetry bool = true

@description('Optional. Is soft delete feature state editable.')
param isSoftDeleteFeatureStateEditable bool = true

resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
properties: {
Expand All @@ -61,11 +64,11 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena
}
}

resource rsv 'Microsoft.RecoveryServices/vaults@2021-12-01' existing = {
resource rsv 'Microsoft.RecoveryServices/vaults@2022-02-01' existing = {
name: recoveryVaultName
}

resource backupConfig 'Microsoft.RecoveryServices/vaults/backupconfig@2021-10-01' = {
resource backupConfig 'Microsoft.RecoveryServices/vaults/backupconfig@2022-02-01' = {
name: name
parent: rsv
properties: {
Expand All @@ -75,6 +78,7 @@ resource backupConfig 'Microsoft.RecoveryServices/vaults/backupconfig@2021-10-01
storageModelType: storageModelType
storageType: storageType
storageTypeState: storageTypeState
isSoftDeleteFeatureStateEditable: isSoftDeleteFeatureStateEditable
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This module deploys recovery services vault backup config.

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.RecoveryServices/vaults/backupconfig` | [2021-10-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.RecoveryServices/2021-10-01/vaults/backupconfig) |
| `Microsoft.RecoveryServices/vaults/backupconfig` | [2022-02-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.RecoveryServices/2022-02-01/vaults/backupconfig) |

## Parameters

Expand All @@ -26,6 +26,7 @@ This module deploys recovery services vault backup config.
| :-- | :-- | :-- | :-- | :-- |
| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via the Customer Usage Attribution ID (GUID). |
| `enhancedSecurityState` | string | `'Enabled'` | `[Disabled, Enabled]` | Enable this setting to protect hybrid backups against accidental deletes and add additional layer of authentication for critical operations. |
| `isSoftDeleteFeatureStateEditable` | bool | `True` | | Is soft delete feature state editable. |
| `name` | string | `'vaultconfig'` | | Name of the Azure Recovery Service Vault Backup Policy. |
| `resourceGuardOperationRequests` | array | `[]` | | ResourceGuard Operation Requests. |
| `softDeleteFeatureState` | string | `'Enabled'` | `[Disabled, Enabled]` | Enable this setting to protect backup data for Azure VM, SQL Server in Azure VM and SAP HANA in Azure VM from accidental deletes. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena
}
}

resource rsv 'Microsoft.RecoveryServices/vaults@2021-12-01' existing = {
resource rsv 'Microsoft.RecoveryServices/vaults@2022-02-01' existing = {
name: recoveryVaultName
}

resource backupPolicy 'Microsoft.RecoveryServices/vaults/backupPolicies@2021-08-01' = {
resource backupPolicy 'Microsoft.RecoveryServices/vaults/backupPolicies@2022-02-01' = {
name: name
parent: rsv
properties: backupPolicyProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This module deploys a Backup Policy for a Recovery Services Vault

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.RecoveryServices/vaults/backupPolicies` | [2021-08-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.RecoveryServices/2021-08-01/vaults/backupPolicies) |
| `Microsoft.RecoveryServices/vaults/backupPolicies` | [2022-02-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.RecoveryServices/2022-02-01/vaults/backupPolicies) |

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ param storageModelType string = 'GeoRedundant'
@description('Optional. Opt in details of Cross Region Restore feature.')
param crossRegionRestoreFlag bool = true

@description('Optional. Change Vault Dedup state.')
@allowed([
'Disabled'
'Enabled'
'Invalid'
])
param dedupState string = 'Disabled'

@description('Optional. Change Vault x-cool state.')
@allowed([
'Disabled'
'Enabled'
'Invalid'
])
param xcoolState string = 'Disabled'

@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).')
param enableDefaultTelemetry bool = true

Expand All @@ -31,16 +47,18 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena
}
}

resource rsv 'Microsoft.RecoveryServices/vaults@2021-12-01' existing = {
resource rsv 'Microsoft.RecoveryServices/vaults@2022-02-01' existing = {
name: recoveryVaultName
}

resource backupStorageConfig 'Microsoft.RecoveryServices/vaults/backupstorageconfig@2021-08-01' = {
resource backupStorageConfig 'Microsoft.RecoveryServices/vaults/backupstorageconfig@2022-02-01' = {
name: name
parent: rsv
properties: {
storageModelType: storageModelType
crossRegionRestoreFlag: crossRegionRestoreFlag
dedupState: dedupState
xcoolState: xcoolState
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This module deploys the Backup Storage Configuration for the Recovery Service Va

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.RecoveryServices/vaults/backupstorageconfig` | [2021-08-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.RecoveryServices/2021-08-01/vaults/backupstorageconfig) |
| `Microsoft.RecoveryServices/vaults/backupstorageconfig` | [2022-02-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.RecoveryServices/2022-02-01/vaults/backupstorageconfig) |

## Parameters

Expand All @@ -24,9 +24,11 @@ This module deploys the Backup Storage Configuration for the Recovery Service Va
| Parameter Name | Type | Default Value | Allowed Values | Description |
| :-- | :-- | :-- | :-- | :-- |
| `crossRegionRestoreFlag` | bool | `True` | | Opt in details of Cross Region Restore feature. |
| `dedupState` | string | `'Disabled'` | `[Disabled, Enabled, Invalid]` | Change Vault Dedup state. |
| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via the Customer Usage Attribution ID (GUID). |
| `name` | string | `'vaultstorageconfig'` | | The name of the backup storage config. |
| `storageModelType` | string | `'GeoRedundant'` | `[GeoRedundant, LocallyRedundant, ReadAccessGeoZoneRedundant, ZoneRedundant]` | Change Vault Storage Type (Works if vault has not registered any backup instance). |
| `xcoolState` | string | `'Disabled'` | `[Disabled, Enabled, Invalid]` | Change Vault x-cool state. |


## Outputs
Expand Down
3 changes: 3 additions & 0 deletions arm/Microsoft.RecoveryServices/vaults/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ module rsv_backupStorageConfiguration 'backupStorageConfig/deploy.bicep' = if (!
storageModelType: backupStorageConfig.storageModelType
crossRegionRestoreFlag: backupStorageConfig.crossRegionRestoreFlag
enableDefaultTelemetry: enableChildTelemetry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace any occurrence of enableChildTelemetry with enableReferencedModulesTelemetry

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

dedupState: backupStorageConfig.dedupState
xcoolState: backupStorageConfig.xcoolState
}
}

Expand Down Expand Up @@ -233,6 +235,7 @@ module rsv_backupConfig 'backupConfig/deploy.bicep' = if (!empty(backupConfig))
storageModelType: contains(backupConfig, 'storageModelType') ? backupConfig.storageModelType : 'GeoRedundant'
storageType: contains(backupConfig, 'storageType') ? backupConfig.storageType : 'GeoRedundant'
storageTypeState: contains(backupConfig, 'storageTypeState') ? backupConfig.storageTypeState : 'Locked'
isSoftDeleteFeatureStateEditable: contains(backupConfig, 'isSoftDeleteFeatureStateEditable') ? backupConfig.isSoftDeleteFeatureStateEditable : true
enableDefaultTelemetry: enableChildTelemetry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this line as it has been correctly replaced below

Suggested change
enableDefaultTelemetry: enableChildTelemetry

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

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

resource protectionContainer 'Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers@2021-08-01' = {
resource protectionContainer 'Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers@2022-02-01' = {
name: '${recoveryVaultName}/Azure/${name}'
properties: {
sourceResourceId: !empty(sourceResourceId) ? sourceResourceId : null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# RecoveryServicesProtectionContainer `[Microsoft.RecoveryServices/vaults/protectionContainers]`
# RecoveryServices Vaults ProtectionContainers `[Microsoft.RecoveryServices/vaults/protectionContainers]`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# RecoveryServices Vaults ProtectionContainers `[Microsoft.RecoveryServices/vaults/protectionContainers]`
# Recovery Services Vaults Protection Containers `[Microsoft.RecoveryServices/vaults/protectionContainers]`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you kindly double check? I still see the old code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, I can see the correct code in my branch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment


This module deploys a Protection Container for a Recovery Services Vault
This module deploys RecoveryServices Vaults ProtectionContainers.
// TODO: Replace Resource and fill in description
Comment on lines +3 to +4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This module deploys RecoveryServices Vaults ProtectionContainers.
// TODO: Replace Resource and fill in description
This module deploys a recovery services vault protection container.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


## Navigation

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

## Resource types
## Resource Types

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers` | [2021-08-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.RecoveryServices/2021-08-01/vaults/backupFabrics/protectionContainers) |
| `Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers` | [2022-02-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.RecoveryServices/2022-02-01/vaults/backupFabrics/protectionContainers) |

## Parameters

Expand All @@ -36,6 +37,10 @@ This module deploys a Protection Container for a Recovery Services Vault
| `sourceResourceId` | string | `''` | | Resource ID of the target resource for the Protection Container. |


### Parameter Usage: `<ParameterPlaceholder>`

// TODO: Fill in Parameter usage

Comment on lines +40 to +43
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please either add parameter usage if needed or remove this placeholder

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you kindly double check? I still see the old code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, I can see the correct code in my branch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can. Just update you main to latest & merge it into you branch:

git checkout main
git pull
git checkout 'users/prsaha/apifixrsv#1388'
git merge main

## Outputs

| Output Name | Type | Description |
Expand Down
Loading