Skip to content

Commit

Permalink
fix: ddosProtectionPlan now optional in ddosSettingsType for Publ…
Browse files Browse the repository at this point in the history
…icIPAddress (Azure#2006)

## Description

<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes Azure#123
Fixes Azure#456
Closes Azure#123
Closes Azure#456
-->

Closes Azure#1940 

## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.network.public-ip-address](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.public-ip-address.yml/badge.svg?branch=public-i-p-ddos)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.public-ip-address.yml)
|

## Type of Change

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

- [ ] Update to CI Environment or utlities (Non-module effecting
changes)
- [x] Azure Verified Module updates:
- [x] 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.
- [ ] 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 day with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
ChrisSidebotham authored and hundredacres committed Jun 19, 2024
1 parent 07e048d commit 798bc4d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 44 deletions.
35 changes: 20 additions & 15 deletions avm/res/network/public-ip-address/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,32 @@ The DDoS protection plan configuration associated with the public IP address.

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`ddosProtectionPlan`](#parameter-ddossettingsddosprotectionplan) | object | The DDoS protection plan associated with the public IP address. |
| [`protectionMode`](#parameter-ddossettingsprotectionmode) | string | The DDoS protection policy customizations. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`ddosProtectionPlan`](#parameter-ddossettingsddosprotectionplan) | object | The DDoS protection plan associated with the public IP address. |

### Parameter: `ddosSettings.protectionMode`

The DDoS protection policy customizations.

- Required: Yes
- Type: string
- Allowed:
```Bicep
[
'Enabled'
]
```

### Parameter: `ddosSettings.ddosProtectionPlan`

The DDoS protection plan associated with the public IP address.

- Required: Yes
- Required: No
- Type: object

**Required parameters**
Expand All @@ -482,19 +500,6 @@ The resource ID of the DDOS protection plan associated with the public IP addres
- Required: Yes
- Type: string

### Parameter: `ddosSettings.protectionMode`

The DDoS protection policy customizations.

- Required: Yes
- Type: string
- Allowed:
```Bicep
[
'Enabled'
]
```

### Parameter: `diagnosticSettings`

The diagnostic settings of the service.
Expand Down
50 changes: 24 additions & 26 deletions avm/res/network/public-ip-address/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,23 @@ var builtInRoleNames = {
)
}

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' =
if (enableTelemetry) {
name: '46d3xbcp.res.network-publicipaddress.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
name: '46d3xbcp.res.network-publicipaddress.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
}
}
}
}

resource publicIpAddress 'Microsoft.Network/publicIPAddresses@2023-09-01' = {
name: name
Expand All @@ -152,17 +151,16 @@ resource publicIpAddress 'Microsoft.Network/publicIPAddresses@2023-09-01' = {
}
}

resource publicIpAddress_lock 'Microsoft.Authorization/locks@2020-05-01' =
if (!empty(lock ?? {}) && lock.?kind != 'None') {
name: lock.?name ?? 'lock-${name}'
properties: {
level: lock.?kind ?? ''
notes: lock.?kind == 'CanNotDelete'
? 'Cannot delete resource or child resources.'
: 'Cannot delete or modify the resource or child resources.'
}
scope: publicIpAddress
resource publicIpAddress_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!empty(lock ?? {}) && lock.?kind != 'None') {
name: lock.?name ?? 'lock-${name}'
properties: {
level: lock.?kind ?? ''
notes: lock.?kind == 'CanNotDelete'
? 'Cannot delete resource or child resources.'
: 'Cannot delete or modify the resource or child resources.'
}
scope: publicIpAddress
}

resource publicIpAddress_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [
for (roleAssignment, index) in (roleAssignments ?? []): {
Expand Down Expand Up @@ -278,11 +276,11 @@ type dnsSettingsType = {
}

type ddosSettingsType = {
@description('Required. The DDoS protection plan associated with the public IP address.')
@description('Optional. The DDoS protection plan associated with the public IP address.')
ddosProtectionPlan: {
@description('Required. The resource ID of the DDOS protection plan associated with the public IP address.')
id: string
}
}?
@description('Required. The DDoS protection policy customizations.')
protectionMode: 'Enabled'
}
Expand Down
7 changes: 4 additions & 3 deletions avm/res/network/public-ip-address/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "1650798617817777444"
"version": "0.27.1.19265",
"templateHash": "7382635530474884069"
},
"name": "Public IP Addresses",
"description": "This module deploys a Public IP Address.",
Expand Down Expand Up @@ -155,8 +155,9 @@
}
}
},
"nullable": true,
"metadata": {
"description": "Required. The DDoS protection plan associated with the public IP address."
"description": "Optional. The DDoS protection plan associated with the public IP address."
}
},
"protectionMode": {
Expand Down

0 comments on commit 798bc4d

Please sign in to comment.