-
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.
fix: Add publicNetworkAccess param and update firewall rule logic (#3959
) ## Description Add publicNetworkAccess param and update firewall rule logic. Also added support for Defender for Cloud, a WAF requirement. Fixes #3717 Closes #3717 ## Pipeline Reference <!-- Insert your Pipeline Status Badge below --> | Pipeline | | -------- | | [![avm.res.db-for-my-sql.flexible-server](https://github.com/hundredacres/bicep-registry-modules/actions/workflows/avm.res.db-for-my-sql.flexible-server.yml/badge.svg?branch=fix%2Fissues%2F3717)](https://github.com/hundredacres/bicep-registry-modules/actions/workflows/avm.res.db-for-my-sql.flexible-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) - [X] 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
1 parent
6dafe6d
commit 658d86f
Showing
12 changed files
with
454 additions
and
61 deletions.
There are no files selected for viewing
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
59 changes: 59 additions & 0 deletions
59
avm/res/db-for-my-sql/flexible-server/advanced-threat-protection/README.md
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,59 @@ | ||
# DBforMySQL Flexible Server Advanced Threat Protection `[Microsoft.DBforMySQL/flexibleServers]` | ||
|
||
This module enables Advanced Threat Protection for DBforMySQL Flexible Server. | ||
|
||
## Navigation | ||
|
||
- [Resource Types](#Resource-Types) | ||
- [Parameters](#Parameters) | ||
- [Outputs](#Outputs) | ||
|
||
## Resource Types | ||
|
||
| Resource Type | API Version | | ||
| :-- | :-- | | ||
| `Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings` | [2023-12-30](https://learn.microsoft.com/en-us/azure/templates/Microsoft.DBforMySQL/2023-12-30/flexibleServers/advancedThreatProtectionSettings) | | ||
|
||
## Parameters | ||
|
||
**Conditional parameters** | ||
|
||
| Parameter | Type | Description | | ||
| :-- | :-- | :-- | | ||
| [`flexibleServerName`](#parameter-flexibleservername) | string | The name of the parent DBforMySQL flexible server. Required if the template is used in a standalone deployment. | | ||
|
||
**Optional parameters** | ||
|
||
| Parameter | Type | Description | | ||
| :-- | :-- | :-- | | ||
| [`advancedThreatProtection`](#parameter-advancedthreatprotection) | string | The state of the advanced threat protection. | | ||
|
||
### Parameter: `flexibleServerName` | ||
|
||
The name of the parent DBforMySQL flexible server. Required if the template is used in a standalone deployment. | ||
|
||
- Required: Yes | ||
- Type: string | ||
|
||
### Parameter: `advancedThreatProtection` | ||
|
||
The state of the advanced threat protection. | ||
|
||
- Required: No | ||
- Type: string | ||
- Default: `'Enabled'` | ||
- Allowed: | ||
```Bicep | ||
[ | ||
'Disabled' | ||
'Enabled' | ||
] | ||
``` | ||
|
||
## Outputs | ||
|
||
| Output | Type | Description | | ||
| :-- | :-- | :-- | | ||
| `name` | string | The name of the deployed threat protection. | | ||
| `resourceGroupName` | string | The resource group of the deployed threat protection. | | ||
| `resourceId` | string | The resource ID of the deployed threat protection. | |
34 changes: 34 additions & 0 deletions
34
avm/res/db-for-my-sql/flexible-server/advanced-threat-protection/main.bicep
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,34 @@ | ||
metadata name = 'DBforMySQL Flexible Server Advanced Threat Protection' | ||
metadata description = 'This module enables Advanced Threat Protection for DBforMySQL Flexible Server.' | ||
metadata owner = 'Azure/module-maintainers' | ||
|
||
@description('Conditional. The name of the parent DBforMySQL flexible server. Required if the template is used in a standalone deployment.') | ||
param flexibleServerName string | ||
|
||
@description('Optional. The state of the advanced threat protection.') | ||
@allowed([ | ||
'Enabled' | ||
'Disabled' | ||
]) | ||
param advancedThreatProtection string = 'Enabled' | ||
|
||
resource flexibleServer 'Microsoft.DBforMySQL/flexibleServers@2023-12-30' existing = { | ||
name: flexibleServerName | ||
} | ||
|
||
resource advancedThreatProtectionSettings 'Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings@2023-12-30' = { | ||
parent: flexibleServer | ||
name: 'Default' | ||
properties: { | ||
state: advancedThreatProtection | ||
} | ||
} | ||
|
||
@description('The name of the deployed threat protection.') | ||
output name string = advancedThreatProtectionSettings.name | ||
|
||
@description('The resource ID of the deployed threat protection.') | ||
output resourceId string = advancedThreatProtectionSettings.id | ||
|
||
@description('The resource group of the deployed threat protection.') | ||
output resourceGroupName string = resourceGroup().name |
Oops, something went wrong.