Skip to content

Commit

Permalink
feat: Service Bus Namespace AZ Resiliency Updates (#3248)
Browse files Browse the repository at this point in the history
## Description

The changes in this PR address the requirement for Zone Redundant
configurations by default.
## Pipeline Reference

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

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

|[![avm.res.service-bus.namespace](https://github.com/tsc-buddy/bicep-registry-modules/actions/workflows/avm.res.service-bus.namespace.yml/badge.svg?branch=feat%2Fsb-az-defaults)](https://github.com/tsc-buddy/bicep-registry-modules/actions/workflows/avm.res.service-bus.namespace.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.
- [ ] 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.
- [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
tsc-buddy authored Sep 11, 2024
1 parent 4ca0ccd commit 97f616f
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 64 deletions.
105 changes: 53 additions & 52 deletions avm/res/service-bus/namespace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
params: {
// Required parameters
name: 'sbnmin001'
skuObject: {
name: 'Basic'
}
// Non-required parameters
location: '<location>'
skuObject: {
capacity: 2
name: 'Premium'
}
}
}
```
Expand All @@ -84,14 +85,15 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
"name": {
"value": "sbnmin001"
},
"skuObject": {
"value": {
"name": "Basic"
}
},
// Non-required parameters
"location": {
"value": "<location>"
},
"skuObject": {
"value": {
"capacity": 2,
"name": "Premium"
}
}
}
}
Expand All @@ -115,10 +117,6 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
params: {
// Required parameters
name: 'sbnencr001'
skuObject: {
capacity: 1
name: 'Premium'
}
// Non-required parameters
customerManagedKey: {
keyName: '<keyName>'
Expand All @@ -132,6 +130,10 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
'<managedIdentityResourceId>'
]
}
skuObject: {
capacity: 1
name: 'Premium'
}
}
}
```
Expand All @@ -152,12 +154,6 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
"name": {
"value": "sbnencr001"
},
"skuObject": {
"value": {
"capacity": 1,
"name": "Premium"
}
},
// Non-required parameters
"customerManagedKey": {
"value": {
Expand All @@ -176,6 +172,12 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
"<managedIdentityResourceId>"
]
}
},
"skuObject": {
"value": {
"capacity": 1,
"name": "Premium"
}
}
}
}
Expand All @@ -199,10 +201,6 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
params: {
// Required parameters
name: 'sbnmax001'
skuObject: {
capacity: 16
name: 'Premium'
}
// Non-required parameters
authorizationRules: [
{
Expand Down Expand Up @@ -382,6 +380,10 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
roleDefinitionIdOrName: '<roleDefinitionIdOrName>'
}
]
skuObject: {
capacity: 16
name: 'Premium'
}
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
Expand Down Expand Up @@ -431,7 +433,6 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
]
}
]
zoneRedundant: true
}
}
```
Expand All @@ -452,12 +453,6 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
"name": {
"value": "sbnmax001"
},
"skuObject": {
"value": {
"capacity": 16,
"name": "Premium"
}
},
// Non-required parameters
"authorizationRules": {
"value": [
Expand Down Expand Up @@ -663,6 +658,12 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
}
]
},
"skuObject": {
"value": {
"capacity": 16,
"name": "Premium"
}
},
"tags": {
"value": {
"Environment": "Non-Prod",
Expand Down Expand Up @@ -715,9 +716,6 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
]
}
]
},
"zoneRedundant": {
"value": true
}
}
}
Expand All @@ -741,10 +739,6 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
params: {
// Required parameters
name: 'sbnwaf001'
skuObject: {
capacity: 2
name: 'Premium'
}
// Non-required parameters
authorizationRules: [
{
Expand Down Expand Up @@ -850,6 +844,10 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
}
]
roleAssignments: []
skuObject: {
capacity: 2
name: 'Premium'
}
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
Expand Down Expand Up @@ -878,7 +876,6 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
roleAssignments: []
}
]
zoneRedundant: true
}
}
```
Expand All @@ -899,12 +896,6 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
"name": {
"value": "sbnwaf001"
},
"skuObject": {
"value": {
"capacity": 2,
"name": "Premium"
}
},
// Non-required parameters
"authorizationRules": {
"value": [
Expand Down Expand Up @@ -1036,6 +1027,12 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
"roleAssignments": {
"value": []
},
"skuObject": {
"value": {
"capacity": 2,
"name": "Premium"
}
},
"tags": {
"value": {
"Environment": "Non-Prod",
Expand Down Expand Up @@ -1067,9 +1064,6 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
"roleAssignments": []
}
]
},
"zoneRedundant": {
"value": true
}
}
}
Expand All @@ -1085,7 +1079,7 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`name`](#parameter-name) | string | Name of the Service Bus Namespace. |
| [`skuObject`](#parameter-skuobject) | object | The SKU of the Service Bus Namespace. |
| [`skuObject`](#parameter-skuobject) | object | The SKU of the Service Bus Namespace. Defaulted to Premium for ZoneRedundant configurations by default. |

**Optional parameters**

Expand All @@ -1112,7 +1106,7 @@ module namespace 'br/public:avm/res/service-bus/namespace:<version>' = {
| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
| [`topics`](#parameter-topics) | array | The topics to create in the service bus namespace. |
| [`zoneRedundant`](#parameter-zoneredundant) | bool | Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones. |
| [`zoneRedundant`](#parameter-zoneredundant) | bool | Enabled by default in order to align with resiliency best practices, thus requires Premium SKU. |

### Parameter: `name`

Expand All @@ -1123,10 +1117,17 @@ Name of the Service Bus Namespace.

### Parameter: `skuObject`

The SKU of the Service Bus Namespace.
The SKU of the Service Bus Namespace. Defaulted to Premium for ZoneRedundant configurations by default.

- Required: Yes
- Required: No
- Type: object
- Default:
```Bicep
{
capacity: 2
name: 'Premium'
}
```

**Required parameters**

Expand Down Expand Up @@ -3069,11 +3070,11 @@ Value that indicates whether the topic supports ordering.

### Parameter: `zoneRedundant`

Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones.
Enabled by default in order to align with resiliency best practices, thus requires Premium SKU.

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

## Outputs

Expand Down
11 changes: 7 additions & 4 deletions avm/res/service-bus/namespace/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ param name string
@description('Optional. Location for all resources.')
param location string = resourceGroup().location

@description('Required. The SKU of the Service Bus Namespace.')
param skuObject skuType
@description('Required. The SKU of the Service Bus Namespace. Defaulted to Premium for ZoneRedundant configurations by default.')
param skuObject skuType = {
name: 'Premium'
capacity: 2
}

@description('Optional. Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones.')
param zoneRedundant bool = false
@description('Optional. Enabled by default in order to align with resiliency best practices, thus requires Premium SKU.')
param zoneRedundant bool = true

@allowed([
'1.0'
Expand Down
12 changes: 8 additions & 4 deletions avm/res/service-bus/namespace/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": "16628890374295506516"
"templateHash": "6397771352503979306"
},
"name": "Service Bus Namespaces",
"description": "This module deploys a Service Bus Namespace.",
Expand Down Expand Up @@ -1137,15 +1137,19 @@
},
"skuObject": {
"$ref": "#/definitions/skuType",
"defaultValue": {
"name": "Premium",
"capacity": 2
},
"metadata": {
"description": "Required. The SKU of the Service Bus Namespace."
"description": "Required. The SKU of the Service Bus Namespace. Defaulted to Premium for ZoneRedundant configurations by default."
}
},
"zoneRedundant": {
"type": "bool",
"defaultValue": false,
"defaultValue": true,
"metadata": {
"description": "Optional. Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones."
"description": "Optional. Enabled by default in order to align with resiliency best practices, thus requires Premium SKU."
}
},
"minimumTlsVersion": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ module testDeployment '../../../main.bicep' = [
name: '${namePrefix}${serviceShort}001'
location: resourceLocation
skuObject: {
name: 'Basic'
name: 'Premium'
capacity: 2
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ module testDeployment '../../../main.bicep' = [
capacity: 16
}
premiumMessagingPartitions: 1
zoneRedundant: true
tags: {
'hidden-title': 'This is visible in the resource name'
Environment: 'Non-Prod'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ module testDeployment '../../../main.bicep' = [
capacity: 2
}
premiumMessagingPartitions: 1
zoneRedundant: true
tags: {
'hidden-title': 'This is visible in the resource name'
Environment: 'Non-Prod'
Expand Down
2 changes: 1 addition & 1 deletion avm/res/service-bus/namespace/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.8",
"version": "0.9",
"pathFilters": [
"./main.json"
]
Expand Down

0 comments on commit 97f616f

Please sign in to comment.