Skip to content

Commit

Permalink
feat: Allowing shardCount to be nullified (#4437)
Browse files Browse the repository at this point in the history
## Description
Allow shardCount to be nullified to disable default clustering behavior.

Below is the behavior of AVM before implementing the change to
shardCount.

<img width="1148" alt="Screenshot 2025-02-12 at 11 29 37 AM"
src="https://github.com/user-attachments/assets/6889136c-4473-4de3-9352-f763234f6430"
/>

After implementing the fix, the Premium cache is not clustered.

<img width="1151" alt="Screenshot 2025-02-12 at 11 28 56 AM"
src="https://github.com/user-attachments/assets/519f9de7-ece9-4d6e-ac39-4fbc551263dd"
/>

Fixes #4380 
Closes #4380 


## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.cache.redis](https://github.com/hundredacres/bicep-registry-modules/actions/workflows/avm.res.cache.redis.yml/badge.svg?branch=feat%2Fissues%2F4380)](https://github.com/hundredacres/bicep-registry-modules/actions/workflows/avm.res.cache.redis.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:
- [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 date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
hundredacres authored Feb 13, 2025
1 parent 3bdd595 commit 0d9bb07
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion avm/res/cache/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2183,7 +2183,6 @@ The number of shards to be created on a Premium Cluster Cache.

- Required: No
- Type: int
- Default: `1`
- MinValue: 1

### Parameter: `skuName`
Expand Down
4 changes: 2 additions & 2 deletions avm/res/cache/redis/linked-servers/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.33.13.18514",
"templateHash": "11294861621866290910"
"version": "0.33.93.31351",
"templateHash": "322534394383651316"
},
"name": "Redis Cache Linked Servers",
"description": "This module connects a primary and secondary Redis Cache together for geo-replication."
Expand Down
2 changes: 1 addition & 1 deletion avm/res/cache/redis/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ param replicasPerPrimary int = 3

@minValue(1)
@description('Optional. The number of shards to be created on a Premium Cluster Cache.')
param shardCount int = 1
param shardCount int?

@allowed([
0
Expand Down
14 changes: 7 additions & 7 deletions avm/res/cache/redis/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.33.13.18514",
"templateHash": "1242857667100916577"
"version": "0.33.93.31351",
"templateHash": "2636464673565813214"
},
"name": "Redis Cache",
"description": "This module deploys a Redis Cache."
Expand Down Expand Up @@ -842,7 +842,7 @@
},
"shardCount": {
"type": "int",
"defaultValue": 1,
"nullable": true,
"minValue": 1,
"metadata": {
"description": "Optional. The number of shards to be created on a Premium Cluster Cache."
Expand Down Expand Up @@ -1947,8 +1947,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.33.13.18514",
"templateHash": "11294861621866290910"
"version": "0.33.93.31351",
"templateHash": "322534394383651316"
},
"name": "Redis Cache Linked Servers",
"description": "This module connects a primary and secondary Redis Cache together for geo-replication."
Expand Down Expand Up @@ -2073,8 +2073,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.33.13.18514",
"templateHash": "14045530027687796477"
"version": "0.33.93.31351",
"templateHash": "8063348652715653257"
}
},
"definitions": {
Expand Down

0 comments on commit 0d9bb07

Please sign in to comment.