Skip to content

Commit

Permalink
Latest API and removing unneccessary deps (Azure#4271)
Browse files Browse the repository at this point in the history
## Description

Updated API version of RP and removed unnecessary dependencies

## 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%2Flatest_api)](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:
- [ ] 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`.
  - [ ] 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 Jan 24, 2025
1 parent 61a27b4 commit e89ad4a
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 38 deletions.
8 changes: 4 additions & 4 deletions avm/res/cache/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ This module deploys a Redis Cache.
| :-- | :-- |
| `Microsoft.Authorization/locks` | [2020-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.Cache/redis` | [2024-03-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Cache/2024-03-01/redis) |
| `Microsoft.Cache/redis/accessPolicies` | [2024-04-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Cache/2024-04-01-preview/redis/accessPolicies) |
| `Microsoft.Cache/redis/accessPolicyAssignments` | [2024-04-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Cache/2024-04-01-preview/redis/accessPolicyAssignments) |
| `Microsoft.Cache/redis/linkedServers` | [2024-03-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Cache/2024-03-01/redis/linkedServers) |
| `Microsoft.Cache/redis` | [2024-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Cache/2024-11-01/redis) |
| `Microsoft.Cache/redis/accessPolicies` | [2024-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Cache/2024-11-01/redis/accessPolicies) |
| `Microsoft.Cache/redis/accessPolicyAssignments` | [2024-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Cache/2024-11-01/redis/accessPolicyAssignments) |
| `Microsoft.Cache/redis/linkedServers` | [2024-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Cache/2024-11-01/redis/linkedServers) |
| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
| `Microsoft.KeyVault/vaults/secrets` | [2023-07-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2023-07-01/vaults/secrets) |
| `Microsoft.Network/privateEndpoints` | [2023-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2023-11-01/privateEndpoints) |
Expand Down
2 changes: 1 addition & 1 deletion avm/res/cache/redis/linked-servers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This module connects a primary and secondary Redis Cache together for geo-replic

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.Cache/redis/linkedServers` | [2024-03-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Cache/2024-03-01/redis/linkedServers) |
| `Microsoft.Cache/redis/linkedServers` | [2024-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Cache/2024-11-01/redis/linkedServers) |

## Parameters

Expand Down
4 changes: 2 additions & 2 deletions avm/res/cache/redis/linked-servers/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ param linkedRedisCacheLocation string?
@description('Optional. The role of the linked server. Possible values include: "Primary", "Secondary". Default value is "Secondary".')
param serverRole string = 'Secondary'

resource redisCache 'Microsoft.Cache/redis@2024-03-01' existing = {
resource redisCache 'Microsoft.Cache/redis@2024-11-01' existing = {
name: redisCacheName
}

resource redisLinkedServer 'Microsoft.Cache/redis/linkedServers@2024-03-01' = {
resource redisLinkedServer 'Microsoft.Cache/redis/linkedServers@2024-11-01' = {
name: name
properties: {
linkedRedisCacheId: linkedRedisCacheResourceId
Expand Down
8 changes: 4 additions & 4 deletions avm/res/cache/redis/linked-servers/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "3113734842268106241"
"templateHash": "395538410437204745"
},
"name": "Redis Cache Linked Servers",
"description": "This module connects a primary and secondary Redis Cache together for geo-replication."
Expand Down Expand Up @@ -50,16 +50,16 @@
"redisCache": {
"existing": true,
"type": "Microsoft.Cache/redis",
"apiVersion": "2024-03-01",
"apiVersion": "2024-11-01",
"name": "[parameters('redisCacheName')]"
},
"redisLinkedServer": {
"type": "Microsoft.Cache/redis/linkedServers",
"apiVersion": "2024-03-01",
"apiVersion": "2024-11-01",
"name": "[format('{0}/{1}', parameters('redisCacheName'), parameters('name'))]",
"properties": {
"linkedRedisCacheId": "[parameters('linkedRedisCacheResourceId')]",
"linkedRedisCacheLocation": "[coalesce(parameters('linkedRedisCacheLocation'), reference('redisCache', '2024-03-01', 'full').location)]",
"linkedRedisCacheLocation": "[coalesce(parameters('linkedRedisCacheLocation'), reference('redisCache', '2024-11-01', 'full').location)]",
"serverRole": "[parameters('serverRole')]"
},
"dependsOn": [
Expand Down
6 changes: 3 additions & 3 deletions avm/res/cache/redis/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableT
}
}

resource redis 'Microsoft.Cache/redis@2024-03-01' = {
resource redis 'Microsoft.Cache/redis@2024-11-01' = {
name: name
location: location
tags: tags
Expand Down Expand Up @@ -215,7 +215,7 @@ resource redis 'Microsoft.Cache/redis@2024-03-01' = {
zones: availabilityZones
}

resource redis_accessPolicies 'Microsoft.Cache/redis/accessPolicies@2024-04-01-preview' = [
resource redis_accessPolicies 'Microsoft.Cache/redis/accessPolicies@2024-11-01' = [
for policy in accessPolicies: {
name: policy.name
parent: redis
Expand All @@ -225,7 +225,7 @@ resource redis_accessPolicies 'Microsoft.Cache/redis/accessPolicies@2024-04-01-p
}
]

resource redis_accessPolicyAssignments 'Microsoft.Cache/redis/accessPolicyAssignments@2024-04-01-preview' = [
resource redis_accessPolicyAssignments 'Microsoft.Cache/redis/accessPolicyAssignments@2024-11-01' = [
for assignment in accessPolicyAssignments: {
name: assignment.objectId
parent: redis
Expand Down
22 changes: 11 additions & 11 deletions avm/res/cache/redis/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "5511708629648465018"
"templateHash": "6727525263041342083"
},
"name": "Redis Cache",
"description": "This module deploys a Redis Cache."
Expand Down Expand Up @@ -887,7 +887,7 @@
},
"redis": {
"type": "Microsoft.Cache/redis",
"apiVersion": "2024-03-01",
"apiVersion": "2024-11-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
Expand Down Expand Up @@ -919,7 +919,7 @@
"count": "[length(parameters('accessPolicies'))]"
},
"type": "Microsoft.Cache/redis/accessPolicies",
"apiVersion": "2024-04-01-preview",
"apiVersion": "2024-11-01",
"name": "[format('{0}/{1}', parameters('name'), parameters('accessPolicies')[copyIndex()].name)]",
"properties": {
"permissions": "[parameters('accessPolicies')[copyIndex()].permissions]"
Expand All @@ -934,7 +934,7 @@
"count": "[length(parameters('accessPolicyAssignments'))]"
},
"type": "Microsoft.Cache/redis/accessPolicyAssignments",
"apiVersion": "2024-04-01-preview",
"apiVersion": "2024-11-01",
"name": "[format('{0}/{1}', parameters('name'), parameters('accessPolicyAssignments')[copyIndex()].objectId)]",
"properties": {
"objectId": "[parameters('accessPolicyAssignments')[copyIndex()].objectId]",
Expand Down Expand Up @@ -1821,7 +1821,7 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "3113734842268106241"
"templateHash": "395538410437204745"
},
"name": "Redis Cache Linked Servers",
"description": "This module connects a primary and secondary Redis Cache together for geo-replication."
Expand Down Expand Up @@ -1865,16 +1865,16 @@
"redisCache": {
"existing": true,
"type": "Microsoft.Cache/redis",
"apiVersion": "2024-03-01",
"apiVersion": "2024-11-01",
"name": "[parameters('redisCacheName')]"
},
"redisLinkedServer": {
"type": "Microsoft.Cache/redis/linkedServers",
"apiVersion": "2024-03-01",
"apiVersion": "2024-11-01",
"name": "[format('{0}/{1}', parameters('redisCacheName'), parameters('name'))]",
"properties": {
"linkedRedisCacheId": "[parameters('linkedRedisCacheResourceId')]",
"linkedRedisCacheLocation": "[coalesce(parameters('linkedRedisCacheLocation'), reference('redisCache', '2024-03-01', 'full').location)]",
"linkedRedisCacheLocation": "[coalesce(parameters('linkedRedisCacheLocation'), reference('redisCache', '2024-11-01', 'full').location)]",
"serverRole": "[parameters('serverRole')]"
},
"dependsOn": [
Expand Down Expand Up @@ -1936,7 +1936,7 @@
"value": "[last(split(coalesce(tryGet(parameters('secretsExportConfiguration'), 'keyVaultResourceId'), '//'), '/'))]"
},
"secretsToSet": {
"value": "[union(createArray(), if(contains(parameters('secretsExportConfiguration'), 'primaryAccessKeyName'), createArray(createObject('name', parameters('secretsExportConfiguration').primaryAccessKeyName, 'value', listKeys(resourceId('Microsoft.Cache/redis', parameters('name')), '2024-03-01').primaryKey)), createArray()), if(contains(parameters('secretsExportConfiguration'), 'primaryConnectionStringName'), createArray(createObject('name', parameters('secretsExportConfiguration').primaryConnectionStringName, 'value', format('rediss://:{0}@{1}:6380', listKeys(resourceId('Microsoft.Cache/redis', parameters('name')), '2024-03-01').primaryKey, reference('redis').hostName))), createArray()), if(contains(parameters('secretsExportConfiguration'), 'secondaryAccessKeyName'), createArray(createObject('name', parameters('secretsExportConfiguration').secondaryAccessKeyName, 'value', listKeys(resourceId('Microsoft.Cache/redis', parameters('name')), '2024-03-01').secondaryKey)), createArray()), if(contains(parameters('secretsExportConfiguration'), 'secondaryConnectionStringName'), createArray(createObject('name', parameters('secretsExportConfiguration').secondaryConnectionStringName, 'value', format('rediss://:{0}@{1}:6380', listKeys(resourceId('Microsoft.Cache/redis', parameters('name')), '2024-03-01').secondaryKey, reference('redis').hostName))), createArray()))]"
"value": "[union(createArray(), if(contains(parameters('secretsExportConfiguration'), 'primaryAccessKeyName'), createArray(createObject('name', parameters('secretsExportConfiguration').primaryAccessKeyName, 'value', listKeys(resourceId('Microsoft.Cache/redis', parameters('name')), '2024-11-01').primaryKey)), createArray()), if(contains(parameters('secretsExportConfiguration'), 'primaryConnectionStringName'), createArray(createObject('name', parameters('secretsExportConfiguration').primaryConnectionStringName, 'value', format('rediss://:{0}@{1}:6380', listKeys(resourceId('Microsoft.Cache/redis', parameters('name')), '2024-11-01').primaryKey, reference('redis').hostName))), createArray()), if(contains(parameters('secretsExportConfiguration'), 'secondaryAccessKeyName'), createArray(createObject('name', parameters('secretsExportConfiguration').secondaryAccessKeyName, 'value', listKeys(resourceId('Microsoft.Cache/redis', parameters('name')), '2024-11-01').secondaryKey)), createArray()), if(contains(parameters('secretsExportConfiguration'), 'secondaryConnectionStringName'), createArray(createObject('name', parameters('secretsExportConfiguration').secondaryConnectionStringName, 'value', format('rediss://:{0}@{1}:6380', listKeys(resourceId('Microsoft.Cache/redis', parameters('name')), '2024-11-01').secondaryKey, reference('redis').hostName))), createArray()))]"
}
},
"template": {
Expand Down Expand Up @@ -2115,14 +2115,14 @@
"metadata": {
"description": "The principal ID of the system assigned identity."
},
"value": "[coalesce(tryGet(tryGet(reference('redis', '2024-03-01', 'full'), 'identity'), 'principalId'), '')]"
"value": "[coalesce(tryGet(tryGet(reference('redis', '2024-11-01', 'full'), 'identity'), 'principalId'), '')]"
},
"location": {
"type": "string",
"metadata": {
"description": "The location the resource was deployed into."
},
"value": "[reference('redis', '2024-03-01', 'full').location]"
"value": "[reference('redis', '2024-11-01', 'full').location]"
},
"privateEndpoints": {
"type": "array",
Expand Down
3 changes: 0 additions & 3 deletions avm/res/cache/redis/tests/e2e/entra-id/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,5 @@ module testDeployment '../../../main.bicep' = [
}
]
}
dependsOn: [
nestedDependencies
]
}
]
4 changes: 0 additions & 4 deletions avm/res/cache/redis/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,5 @@ module testDeployment '../../../main.bicep' = [
resourceType: 'Redis Cache'
}
}
dependsOn: [
nestedDependencies
diagnosticDependencies
]
}
]
4 changes: 0 additions & 4 deletions avm/res/cache/redis/tests/e2e/waf-aligned/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,5 @@ module testDeployment '../../../main.bicep' = [
resourceType: 'Redis Cache'
}
}
dependsOn: [
nestedDependencies
diagnosticDependencies
]
}
]
4 changes: 2 additions & 2 deletions avm/res/cache/redis/version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.9",
"version": "0.10",
"pathFilters": [
"./main.json"
]
}
}

0 comments on commit e89ad4a

Please sign in to comment.