-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add failover groups to
avm/res/sql/server
(#3881)
## Description This PR adds support for failover groups for the `avm/res/sql/server` module. Fixes #3609 Questions: * In the failover group test, I have a dependency (the secondary SQL Server): should I move that to a separate dependencies module, or is it OK to have it in the main test file? * The test contains hard-coded locations to ensure proper region pairs. Is that the preferred way to override location? * Should I extend `max` and/or `waf` test with this module? ## Pipeline Reference <!-- Insert your Pipeline Status Badge below --> | Pipeline | | -------- | | [![avm.res.sql.server](https://github.com/peterbud/bicep-registry-modules/actions/workflows/avm.res.sql.server.yml/badge.svg)](https://github.com/peterbud/bicep-registry-modules/actions/workflows/avm.res.sql.server.yml) | Pls note I don't have Maintenance Window available in my sbscription. ## 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`: - [x] 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 -->
- Loading branch information
Showing
19 changed files
with
1,501 additions
and
146 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
# Azure SQL Server failover group `[Microsoft.Sql/servers/failoverGroups]` | ||
|
||
This module deploys Azure SQL Server failover group. | ||
|
||
## Navigation | ||
|
||
- [Resource Types](#Resource-Types) | ||
- [Parameters](#Parameters) | ||
- [Outputs](#Outputs) | ||
|
||
## Resource Types | ||
|
||
| Resource Type | API Version | | ||
| :-- | :-- | | ||
| `Microsoft.Sql/servers/failoverGroups` | [2024-05-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Sql/2024-05-01-preview/servers/failoverGroups) | | ||
|
||
## Parameters | ||
|
||
**Required parameters** | ||
|
||
| Parameter | Type | Description | | ||
| :-- | :-- | :-- | | ||
| [`databases`](#parameter-databases) | array | List of databases in the failover group. | | ||
| [`name`](#parameter-name) | string | The name of the failover group. | | ||
| [`partnerServers`](#parameter-partnerservers) | array | List of the partner servers for the failover group. | | ||
| [`readWriteEndpoint`](#parameter-readwriteendpoint) | object | Read-write endpoint of the failover group instance. | | ||
| [`secondaryType`](#parameter-secondarytype) | string | Databases secondary type on partner server. | | ||
|
||
**Conditional parameters** | ||
|
||
| Parameter | Type | Description | | ||
| :-- | :-- | :-- | | ||
| [`serverName`](#parameter-servername) | string | The Name of SQL Server. Required if the template is used in a standalone deployment. | | ||
|
||
**Optional parameters** | ||
|
||
| Parameter | Type | Description | | ||
| :-- | :-- | :-- | | ||
| [`readOnlyEndpoint`](#parameter-readonlyendpoint) | object | Read-only endpoint of the failover group instance. | | ||
|
||
### Parameter: `databases` | ||
|
||
List of databases in the failover group. | ||
|
||
- Required: Yes | ||
- Type: array | ||
|
||
### Parameter: `name` | ||
|
||
The name of the failover group. | ||
|
||
- Required: Yes | ||
- Type: string | ||
|
||
### Parameter: `partnerServers` | ||
|
||
List of the partner servers for the failover group. | ||
|
||
- Required: Yes | ||
- Type: array | ||
|
||
### Parameter: `readWriteEndpoint` | ||
|
||
Read-write endpoint of the failover group instance. | ||
|
||
- Required: Yes | ||
- Type: object | ||
|
||
**Required parameters** | ||
|
||
| Parameter | Type | Description | | ||
| :-- | :-- | :-- | | ||
| [`failoverPolicy`](#parameter-readwriteendpointfailoverpolicy) | string | Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. | | ||
|
||
**Optional parameters** | ||
|
||
| Parameter | Type | Description | | ||
| :-- | :-- | :-- | | ||
| [`failoverWithDataLossGracePeriodMinutes`](#parameter-readwriteendpointfailoverwithdatalossgraceperiodminutes) | int | Grace period before failover with data loss is attempted for the read-write endpoint. | | ||
|
||
### Parameter: `readWriteEndpoint.failoverPolicy` | ||
|
||
Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. | ||
|
||
- Required: Yes | ||
- Type: string | ||
- Allowed: | ||
```Bicep | ||
[ | ||
'Automatic' | ||
'Manual' | ||
] | ||
``` | ||
|
||
### Parameter: `readWriteEndpoint.failoverWithDataLossGracePeriodMinutes` | ||
|
||
Grace period before failover with data loss is attempted for the read-write endpoint. | ||
|
||
- Required: No | ||
- Type: int | ||
|
||
### Parameter: `secondaryType` | ||
|
||
Databases secondary type on partner server. | ||
|
||
- Required: Yes | ||
- Type: string | ||
- Allowed: | ||
```Bicep | ||
[ | ||
'Geo' | ||
'Standby' | ||
] | ||
``` | ||
|
||
### Parameter: `serverName` | ||
|
||
The Name of SQL Server. Required if the template is used in a standalone deployment. | ||
|
||
- Required: Yes | ||
- Type: string | ||
|
||
### Parameter: `readOnlyEndpoint` | ||
|
||
Read-only endpoint of the failover group instance. | ||
|
||
- Required: No | ||
- Type: object | ||
|
||
**Required parameters** | ||
|
||
| Parameter | Type | Description | | ||
| :-- | :-- | :-- | | ||
| [`failoverPolicy`](#parameter-readonlyendpointfailoverpolicy) | string | Failover policy of the read-only endpoint for the failover group. | | ||
| [`targetServer`](#parameter-readonlyendpointtargetserver) | string | The target partner server where the read-only endpoint points to. | | ||
|
||
### Parameter: `readOnlyEndpoint.failoverPolicy` | ||
|
||
Failover policy of the read-only endpoint for the failover group. | ||
|
||
- Required: Yes | ||
- Type: string | ||
- Allowed: | ||
```Bicep | ||
[ | ||
'Disabled' | ||
'Enabled' | ||
] | ||
``` | ||
|
||
### Parameter: `readOnlyEndpoint.targetServer` | ||
|
||
The target partner server where the read-only endpoint points to. | ||
|
||
- Required: Yes | ||
- Type: string | ||
|
||
## Outputs | ||
|
||
| Output | Type | Description | | ||
| :-- | :-- | :-- | | ||
| `name` | string | The name of the deployed failover group. | | ||
| `resourceGroupName` | string | The resource group of the deployed failover group. | | ||
| `resourceId` | string | The resource ID of the deployed failover group. | |
Oops, something went wrong.