diff --git a/internal/services/redis/redis_cache_resource.go b/internal/services/redis/redis_cache_resource.go index 0a654bb26fdf..e3d8b8f7f570 100644 --- a/internal/services/redis/redis_cache_resource.go +++ b/internal/services/redis/redis_cache_resource.go @@ -820,12 +820,20 @@ func expandRedisConfiguration(d *pluginsdk.ResourceData) (*redis.RedisCommonProp // nolint : staticcheck v, valExists := d.GetOkExists("redis_configuration.0.rdb_backup_enabled") if valExists { - if v := raw["rdb_backup_enabled"].(bool); v { - if connStr := raw["rdb_storage_connection_string"].(string); connStr == "" { - return nil, fmt.Errorf("The rdb_storage_connection_string property must be set when rdb_backup_enabled is true") + skuName := d.Get("sku_name").(string) + rdbBackupEnabled := raw["rdb_backup_enabled"].(bool) + + // rdb_backup_enabled is available when SKU is Premium + if strings.EqualFold(skuName, string(redis.SkuNamePremium)) { + if rdbBackupEnabled { + if connStr := raw["rdb_storage_connection_string"].(string); connStr == "" { + return nil, fmt.Errorf("The rdb_storage_connection_string property must be set when rdb_backup_enabled is true") + } } + output.RdbBackupEnabled = utils.String(strconv.FormatBool(rdbBackupEnabled)) + } else if rdbBackupEnabled && !strings.EqualFold(skuName, string(redis.SkuNamePremium)) { + return nil, fmt.Errorf("The `rdb_backup_enabled` property requires a `Premium` sku to be set") } - output.RdbBackupEnabled = utils.String(strconv.FormatBool(v.(bool))) } if v := raw["rdb_backup_frequency"].(int); v > 0 {