Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] azurerm_redis_cache backup requires connection string #6819

Merged
merged 3 commits into from May 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions azurerm/internal/services/redis/resource_arm_redis_cache.go
Expand Up @@ -672,6 +672,11 @@ func expandRedisConfiguration(d *schema.ResourceData) (map[string]*string, error

// RDB Backup
if v, ok := d.GetOk("redis_configuration.0.rdb_backup_enabled"); ok {
if v.(bool) {
if connStr, connOk := d.GetOk("redis_configuration.0.rdb_storage_connection_string"); !connOk || connStr.(string) == "" {
return nil, fmt.Errorf("The rdb_storage_connection_string property must be set when rdb_backup_enabled is true")
}
}
delta := strconv.FormatBool(v.(bool))
output["rdb-backup-enabled"] = utils.String(delta)
}
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/redis_cache.html.markdown
Expand Up @@ -92,6 +92,9 @@ A `redis_configuration` block supports the following:
* `maxfragmentationmemory_reserved` - (Optional) Value in megabytes reserved to accommodate for memory fragmentation. Defaults are shown below.

* `rdb_backup_enabled` - (Optional) Is Backup Enabled? Only supported on Premium SKU's.

-> **NOTE:** If `rdb_backup_enabled` set to `true`, `rdb_storage_connection_string` must also be set.

* `rdb_backup_frequency` - (Optional) The Backup Frequency in Minutes. Only supported on Premium SKU's. Possible values are: `15`, `30`, `60`, `360`, `720` and `1440`.
* `rdb_backup_max_snapshot_count` - (Optional) The maximum number of snapshots to create as a backup. Only supported for Premium SKU's.
* `rdb_storage_connection_string` - (Optional) The Connection String to the Storage Account. Only supported for Premium SKU's. In the format: `DefaultEndpointsProtocol=https;BlobEndpoint=${azurerm_storage_account.example.primary_blob_endpoint};AccountName=${azurerm_storage_account.example.name};AccountKey=${azurerm_storage_account.example.primary_access_key}`.
Expand Down