Skip to content

Commit

Permalink
fix: SQL Server ZR default updates (Azure#3093) (Azure#3099)
Browse files Browse the repository at this point in the history
## Description

| Pipeline |
| -------- |

[![avm.res.sql.server](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.sql.server.yml/badge.svg?branch=users%2Falsehr%2Ftsc-buddy_feat%2Fsql-zr-update&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.sql.server.yml)

Follow up to Azure#3093:

Addresses Zone Redundancy gaps for WAF Alignment by default. Please note
the pipeline fails becuase dev/test subscriptions do not support
maintenance windows which are configured on WAF and MAX tests.
@AlexanderSehr can we run this against the AVM environment and confirm
it goes green!

## Pipeline Reference

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

| Pipeline |
| -------- |

|[![avm.res.sql.server](https://github.com/tsc-buddy/bicep-registry-modules/actions/workflows/avm.res.sql.server.yml/badge.svg)](https://github.com/tsc-buddy/bicep-registry-modules/actions/workflows/avm.res.sql.server.yml)|

## Type of Change

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

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [ ] 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.
- [x] 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`.
  - [x] 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.
- [ ] 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: Buddy <[email protected]>
  • Loading branch information
AlexanderSehr and tsc-buddy authored Aug 30, 2024
1 parent c804d3a commit b52640c
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion avm/res/sql/server/database/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ Whether or not this database is zone redundant.

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


## Outputs
Expand Down
2 changes: 1 addition & 1 deletion avm/res/sql/server/database/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ param maxSizeBytes int = 34359738368
param sampleName string = ''

@description('Optional. Whether or not this database is zone redundant.')
param zoneRedundant bool = false
param zoneRedundant bool = true

@description('Optional. The license type to apply for this database.')
param licenseType string = ''
Expand Down
4 changes: 2 additions & 2 deletions avm/res/sql/server/database/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": "8343448660522432164"
"templateHash": "6019999815954957727"
},
"name": "SQL Server Database",
"description": "This module deploys an Azure SQL Server Database.",
Expand Down Expand Up @@ -217,7 +217,7 @@
},
"zoneRedundant": {
"type": "bool",
"defaultValue": false,
"defaultValue": true,
"metadata": {
"description": "Optional. Whether or not this database is zone redundant."
}
Expand Down
2 changes: 1 addition & 1 deletion avm/res/sql/server/elastic-pool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Whether or not this elastic pool is zone redundant, which means the replicas of

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


## Outputs
Expand Down
2 changes: 1 addition & 1 deletion avm/res/sql/server/elastic-pool/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ param databaseMaxCapacity int = 2
param databaseMinCapacity int = 0

@description('Optional. Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones.')
param zoneRedundant bool = false
param zoneRedundant bool = true

resource server 'Microsoft.Sql/servers@2023-08-01-preview' existing = {
name: serverName
Expand Down
4 changes: 2 additions & 2 deletions avm/res/sql/server/elastic-pool/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": "17663884310941548142"
"templateHash": "18037703368269722870"
},
"name": "SQL Server Elastic Pool",
"description": "This module deploys an Azure SQL Server Elastic Pool.",
Expand Down Expand Up @@ -115,7 +115,7 @@
},
"zoneRedundant": {
"type": "bool",
"defaultValue": false,
"defaultValue": true,
"metadata": {
"description": "Optional. Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones."
}
Expand Down
4 changes: 2 additions & 2 deletions avm/res/sql/server/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ module server_databases 'database/main.bicep' = [
: ''
sampleName: contains(database, 'sampleName') ? database.sampleName : ''
tags: database.?tags ?? tags
zoneRedundant: contains(database, 'zoneRedundant') ? database.zoneRedundant : false
zoneRedundant: contains(database, 'zoneRedundant') ? database.zoneRedundant : true
elasticPoolId: contains(database, 'elasticPoolId') ? database.elasticPoolId : ''
backupShortTermRetentionPolicy: contains(database, 'backupShortTermRetentionPolicy')
? database.backupShortTermRetentionPolicy
Expand Down Expand Up @@ -305,7 +305,7 @@ module server_elasticPools 'elastic-pool/main.bicep' = [
skuCapacity: contains(elasticPool, 'skuCapacity') ? elasticPool.skuCapacity : 2
skuName: contains(elasticPool, 'skuName') ? elasticPool.skuName : 'GP_Gen5'
skuTier: contains(elasticPool, 'skuTier') ? elasticPool.skuTier : 'GeneralPurpose'
zoneRedundant: contains(elasticPool, 'zoneRedundant') ? elasticPool.zoneRedundant : false
zoneRedundant: contains(elasticPool, 'zoneRedundant') ? elasticPool.zoneRedundant : true
location: location
tags: elasticPool.?tags ?? tags
}
Expand Down
14 changes: 7 additions & 7 deletions avm/res/sql/server/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": "18130756437591455522"
"templateHash": "8727418248832787909"
},
"name": "Azure SQL Servers",
"description": "This module deploys an Azure SQL Server.",
Expand Down Expand Up @@ -740,7 +740,7 @@
"tags": {
"value": "[coalesce(tryGet(parameters('databases')[copyIndex()], 'tags'), parameters('tags'))]"
},
"zoneRedundant": "[if(contains(parameters('databases')[copyIndex()], 'zoneRedundant'), createObject('value', parameters('databases')[copyIndex()].zoneRedundant), createObject('value', false()))]",
"zoneRedundant": "[if(contains(parameters('databases')[copyIndex()], 'zoneRedundant'), createObject('value', parameters('databases')[copyIndex()].zoneRedundant), createObject('value', true()))]",
"elasticPoolId": "[if(contains(parameters('databases')[copyIndex()], 'elasticPoolId'), createObject('value', parameters('databases')[copyIndex()].elasticPoolId), createObject('value', ''))]",
"backupShortTermRetentionPolicy": "[if(contains(parameters('databases')[copyIndex()], 'backupShortTermRetentionPolicy'), createObject('value', parameters('databases')[copyIndex()].backupShortTermRetentionPolicy), createObject('value', createObject()))]",
"backupLongTermRetentionPolicy": "[if(contains(parameters('databases')[copyIndex()], 'backupLongTermRetentionPolicy'), createObject('value', parameters('databases')[copyIndex()].backupLongTermRetentionPolicy), createObject('value', createObject()))]",
Expand All @@ -758,7 +758,7 @@
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "8343448660522432164"
"templateHash": "6019999815954957727"
},
"name": "SQL Server Database",
"description": "This module deploys an Azure SQL Server Database.",
Expand Down Expand Up @@ -969,7 +969,7 @@
},
"zoneRedundant": {
"type": "bool",
"defaultValue": false,
"defaultValue": true,
"metadata": {
"description": "Optional. Whether or not this database is zone redundant."
}
Expand Down Expand Up @@ -1500,7 +1500,7 @@
"skuCapacity": "[if(contains(parameters('elasticPools')[copyIndex()], 'skuCapacity'), createObject('value', parameters('elasticPools')[copyIndex()].skuCapacity), createObject('value', 2))]",
"skuName": "[if(contains(parameters('elasticPools')[copyIndex()], 'skuName'), createObject('value', parameters('elasticPools')[copyIndex()].skuName), createObject('value', 'GP_Gen5'))]",
"skuTier": "[if(contains(parameters('elasticPools')[copyIndex()], 'skuTier'), createObject('value', parameters('elasticPools')[copyIndex()].skuTier), createObject('value', 'GeneralPurpose'))]",
"zoneRedundant": "[if(contains(parameters('elasticPools')[copyIndex()], 'zoneRedundant'), createObject('value', parameters('elasticPools')[copyIndex()].zoneRedundant), createObject('value', false()))]",
"zoneRedundant": "[if(contains(parameters('elasticPools')[copyIndex()], 'zoneRedundant'), createObject('value', parameters('elasticPools')[copyIndex()].zoneRedundant), createObject('value', true()))]",
"location": {
"value": "[parameters('location')]"
},
Expand All @@ -1516,7 +1516,7 @@
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "17663884310941548142"
"templateHash": "18037703368269722870"
},
"name": "SQL Server Elastic Pool",
"description": "This module deploys an Azure SQL Server Elastic Pool.",
Expand Down Expand Up @@ -1625,7 +1625,7 @@
},
"zoneRedundant": {
"type": "bool",
"defaultValue": false,
"defaultValue": true,
"metadata": {
"description": "Optional. Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones."
}
Expand Down
4 changes: 2 additions & 2 deletions avm/res/sql/server/version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.5",
"version": "0.6",
"pathFilters": [
"./main.json"
]
}
}

0 comments on commit b52640c

Please sign in to comment.