Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions avm/res/cache/redis-enterprise/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

The latest version of the changelog can be found [here](https://github.com/Azure/bicep-registry-modules/blob/main/avm/res/cache/redis-enterprise/CHANGELOG.md).

## 0.5.2

### Changes

- Publishing child module `avm/res/cache/redis-enterprise/database`
- Publishing child module `avm/res/cache/redis-enterprise/database/access-policy-assignment`

### Breaking Changes

- None

## 0.5.1

### Changes
Expand Down
13 changes: 13 additions & 0 deletions avm/res/cache/redis-enterprise/database/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

The latest version of the changelog can be found [here](https://github.com/Azure/bicep-registry-modules/blob/main/avm/res/cache/redis-enterprise/database/CHANGELOG.md).

## 0.1.0

### Changes

- Initial version

### Breaking Changes

- None
22 changes: 22 additions & 0 deletions avm/res/cache/redis-enterprise/database/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@

This module deploys a Redis database in a Redis Enterprise or Azure Managed Redis cluster.

You can reference the module as follows:
```bicep
module redisEnterprise 'br/public:avm/res/cache/redis-enterprise/database:<version>' = {
params: { (...) }
}
```
For examples, please refer to the [Usage Examples](#usage-examples) section.

## Navigation

- [Resource Types](#Resource-Types)
- [Parameters](#Parameters)
- [Outputs](#Outputs)
- [Cross-referenced modules](#Cross-referenced-modules)
- [Data Collection](#Data-Collection)

## Resource Types

Expand Down Expand Up @@ -35,6 +44,7 @@ This module deploys a Redis database in a Redis Enterprise or Azure Managed Redi
| [`clusteringPolicy`](#parameter-clusteringpolicy) | string | Redis clustering policy. [Learn more](https://learn.microsoft.com/azure/redis/architecture#cluster-policies). |
| [`deferUpgrade`](#parameter-deferupgrade) | string | Specifies whether to defer future Redis major version upgrades by up to 90 days. [Learn more](https://aka.ms/redisversionupgrade#defer-upgrades). |
| [`diagnosticSettings`](#parameter-diagnosticsettings) | array | The database-level diagnostic settings of the service. |
| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. |
| [`evictionPolicy`](#parameter-evictionpolicy) | string | Specifies the eviction policy for the Redis resource. |
| [`geoReplication`](#parameter-georeplication) | object | The active geo-replication settings of the service. All caches within a geo-replication group must have the same configuration. |
| [`modules`](#parameter-modules) | array | Redis modules to enable. Restrictions may apply based on SKU and configuration. [Learn more](https://aka.ms/redis/enterprise/modules). |
Expand Down Expand Up @@ -269,6 +279,14 @@ Resource ID of the diagnostic log analytics workspace. For security reasons, it
- Required: No
- Type: string

### Parameter: `enableTelemetry`

Enable/Disable usage telemetry for module.

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

### Parameter: `evictionPolicy`

Specifies the eviction policy for the Redis resource.
Expand Down Expand Up @@ -546,3 +564,7 @@ This section gives you an overview of all local-referenced module files (i.e., o
| Reference | Type |
| :-- | :-- |
| `br/public:avm/utl/types/avm-common-types:0.6.1` | Remote reference |

## Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the [repository](https://aka.ms/avm/telemetry). There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

The latest version of the changelog can be found [here](https://github.com/Azure/bicep-registry-modules/blob/main/avm/res/cache/redis-enterprise/database/access-policy-assignment/CHANGELOG.md).

## 0.1.0

### Changes

- Initial version

### Breaking Changes

- None
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@

This module deploys an access policy assignment for an Azure Managed Redis database.

You can reference the module as follows:
```bicep
module redisEnterprise 'br/public:avm/res/cache/redis-enterprise/database/access-policy-assignment:<version>' = {
params: { (...) }
}
```
For examples, please refer to the [Usage Examples](#usage-examples) section.

## Navigation

- [Resource Types](#Resource-Types)
- [Parameters](#Parameters)
- [Outputs](#Outputs)
- [Data Collection](#Data-Collection)

## Resource Types

Expand Down Expand Up @@ -34,6 +43,7 @@ This module deploys an access policy assignment for an Azure Managed Redis datab
| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`accessPolicyName`](#parameter-accesspolicyname) | string | Name of the access policy to be assigned. |
| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. |
| [`name`](#parameter-name) | string | Name of the access policy assignment. |

### Parameter: `userObjectId`
Expand Down Expand Up @@ -71,6 +81,14 @@ Name of the access policy to be assigned.
]
```

### Parameter: `enableTelemetry`

Enable/Disable usage telemetry for module.

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

### Parameter: `name`

Name of the access policy assignment.
Expand All @@ -86,3 +104,7 @@ Name of the access policy assignment.
| `resourceGroupName` | string | The resource group the access policy assignment was deployed into. |
| `resourceId` | string | The resource ID of the access policy assignment. |
| `userObjectId` | string | The object ID of the user associated with the access policy. |

## Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the [repository](https://aka.ms/avm/telemetry). There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@ param databaseName string
@description('Optional. Name of the access policy to be assigned.')
param accessPolicyName string = 'default'

@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

#disable-next-line no-deployments-resources
resource avmTelemetry 'Microsoft.Resources/deployments@2025-04-01' = if (enableTelemetry) {
name: '46d3xbcp.res.cache-redisenterprise-databaseaccess.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name), 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 redisCluster 'Microsoft.Cache/redisEnterprise@2025-07-01' existing = {
name: clusterName

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.41.2.15936",
"templateHash": "15201669394209392511"
"version": "0.43.8.12551",
"templateHash": "3069501489473055095"
},
"name": "Azure Managed Redis Database Access Policy Assignment",
"description": "This module deploys an access policy assignment for an Azure Managed Redis database."
Expand Down Expand Up @@ -46,6 +46,13 @@
"metadata": {
"description": "Optional. Name of the access policy to be assigned."
}
},
"enableTelemetry": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Optional. Enable/Disable usage telemetry for module."
}
}
},
"resources": {
Expand All @@ -55,6 +62,26 @@
"apiVersion": "2025-07-01",
"name": "[format('{0}/{1}', parameters('clusterName'), parameters('databaseName'))]"
},
"avmTelemetry": {
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2025-04-01",
"name": "[format('46d3xbcp.res.cache-redisenterprise-databaseaccess.{0}.{1}', replace('-..--..-', '.', '-'), substring(uniqueString(deployment().name), 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"
}
}
}
}
},
"redisCluster": {
"existing": true,
"type": "Microsoft.Cache/redisEnterprise",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.1"
}
33 changes: 27 additions & 6 deletions avm/res/cache/redis-enterprise/database/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,34 @@ import { diagnosticSettingLogsOnlyType } from 'br/public:avm/utl/types/avm-commo
@description('Optional. The database-level diagnostic settings of the service.')
param diagnosticSettings diagnosticSettingLogsOnlyType[]?

@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

// ============== //
// Resources //
// ============== //

var enableReferencedModulesTelemetry = false

#disable-next-line no-deployments-resources
resource avmTelemetry 'Microsoft.Resources/deployments@2025-04-01' = if (enableTelemetry) {
name: '46d3xbcp.res.cache-redisenterprise-database.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name), 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 redisCluster 'Microsoft.Cache/redisEnterprise@2025-07-01' existing = {
name: redisClusterName
}
Expand Down Expand Up @@ -121,6 +145,7 @@ module database_accessPolicyAssignments 'access-policy-assignment/main.bicep' =
databaseName: redisDatabase.name
accessPolicyName: assignment.?accessPolicyName
userObjectId: assignment.userObjectId
enableTelemetry: enableReferencedModulesTelemetry
}
}
]
Expand Down Expand Up @@ -171,9 +196,7 @@ output endpoint string = '${redisCluster.properties.hostName}:${redisDatabase.pr

@secure()
@description('The primary access key.')
output primaryAccessKey string? = accessKeysAuthentication == 'Enabled'
? redisDatabase.listKeys().primaryKey
: null
output primaryAccessKey string? = accessKeysAuthentication == 'Enabled' ? redisDatabase.listKeys().primaryKey : null

@secure()
@description('The primary connection string.')
Expand All @@ -189,9 +212,7 @@ output primaryStackExchangeRedisConnectionString string? = accessKeysAuthenticat

@secure()
@description('The secondary access key.')
output secondaryAccessKey string? = accessKeysAuthentication == 'Enabled'
? redisDatabase.listKeys().secondaryKey
: null
output secondaryAccessKey string? = accessKeysAuthentication == 'Enabled' ? redisDatabase.listKeys().secondaryKey : null

@secure()
@description('The secondary connection string.')
Expand Down
Loading
Loading