From 0d9bb07381d25376f92efa8d78a2bc03d5998a18 Mon Sep 17 00:00:00 2001 From: hundredacres Date: Thu, 13 Feb 2025 09:16:25 -0800 Subject: [PATCH] feat: Allowing shardCount to be nullified (#4437) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Allow shardCount to be nullified to disable default clustering behavior. Below is the behavior of AVM before implementing the change to shardCount. Screenshot 2025-02-12 at 11 29 37 AM After implementing the fix, the Premium cache is not clustered. Screenshot 2025-02-12 at 11 28 56 AM Fixes #4380 Closes #4380 ## Pipeline Reference | 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 - [ ] 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 --- avm/res/cache/redis/README.md | 1 - avm/res/cache/redis/linked-servers/main.json | 4 ++-- avm/res/cache/redis/main.bicep | 2 +- avm/res/cache/redis/main.json | 14 +++++++------- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/avm/res/cache/redis/README.md b/avm/res/cache/redis/README.md index 49297597e7..a47ace669a 100644 --- a/avm/res/cache/redis/README.md +++ b/avm/res/cache/redis/README.md @@ -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` diff --git a/avm/res/cache/redis/linked-servers/main.json b/avm/res/cache/redis/linked-servers/main.json index 170402a3d5..5c70c19270 100644 --- a/avm/res/cache/redis/linked-servers/main.json +++ b/avm/res/cache/redis/linked-servers/main.json @@ -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." diff --git a/avm/res/cache/redis/main.bicep b/avm/res/cache/redis/main.bicep index 461bab33b7..6494bafab4 100644 --- a/avm/res/cache/redis/main.bicep +++ b/avm/res/cache/redis/main.bicep @@ -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 diff --git a/avm/res/cache/redis/main.json b/avm/res/cache/redis/main.json index 10bffbc878..d63179ebfc 100644 --- a/avm/res/cache/redis/main.json +++ b/avm/res/cache/redis/main.json @@ -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." @@ -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." @@ -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." @@ -2073,8 +2073,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.33.13.18514", - "templateHash": "14045530027687796477" + "version": "0.33.93.31351", + "templateHash": "8063348652715653257" } }, "definitions": {