Skip to content

Commit 5d6fb6d

Browse files
committed
fix: revert essentials database source ip fix as this will be fixed API side
1 parent 68ae440 commit 5d6fb6d

File tree

2 files changed

+21
-29
lines changed

2 files changed

+21
-29
lines changed

CHANGELOG.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)
66
# 2.7.0 (22nd October 2025)
77

88
## Added:
9-
- Support for `auto_minor_version_upgrade` attribute on Pro and Active-Active databases. When set to `true`, enables automatic minor version upgrades for Redis databases.
9+
- Add auto_minor_version_upgrade field to Pro and Active-Active database resources (default: true) to allow users to control automatic minor version upgrades. This will NOT affect existing databases.
10+
11+
## Changed:
12+
- Change Redis 8.0 modules validation from hard error to warning since modules are bundled by default in Redis 8+.
1013

1114
## Fixed:
12-
- Fixed module validation causing errors for Redis 8. It will now show a warning instead and ignore the modules.
13-
- Fixed `source_ips` being sent to the API for essentials databases on free plans, which caused errors. The `source_ips` attribute is now only sent for PAYG (Pay-As-You-Go) subscriptions when `enable_payg_features` is true.
15+
- Fix test error message patterns to match updated API error format.
16+
- Fix Redis 8 upgrade test expectation (dataset_size_in_gb: 3→1).
17+
1418

1519
# 2.6.0 (17th October 2025)
1620

provider/resource_rediscloud_essentials_database.go

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ func resourceRedisCloudEssentialsDatabase() *schema.Resource {
138138
Computed: true,
139139
},
140140
"source_ips": {
141-
Description: "Set of CIDR addresses to allow access to the database. Supported only for 'Pay-As-You-Go' subscriptions",
142-
Type: schema.TypeList,
143-
Optional: true,
144-
MinItems: 1,
141+
Description: "Set of CIDR addresses to allow access to the database.",
142+
Type: schema.TypeList,
143+
Optional: true,
144+
MinItems: 1,
145145
Elem: &schema.Schema{
146146
Type: schema.TypeString,
147147
ValidateDiagFunc: validation.ToDiagFunc(validation.IsCIDR),
@@ -307,7 +307,6 @@ func resourceRedisCloudEssentialsDatabaseCreate(ctx context.Context, d *schema.R
307307
api := meta.(*client.ApiClient)
308308

309309
subId := d.Get("subscription_id").(int)
310-
log.Printf("[DEBUG] Creating essentials database in subscription %d", subId)
311310

312311
utils.SubscriptionMutex.Lock(subId)
313312

@@ -318,11 +317,6 @@ func resourceRedisCloudEssentialsDatabaseCreate(ctx context.Context, d *schema.R
318317
Replication: redis.Bool(d.Get("replication").(bool)),
319318
PeriodicBackupPath: redis.String(d.Get("periodic_backup_path").(string)),
320319
}
321-
log.Printf("[DEBUG] Essentials database create request - Name: %s, DataPersistence: %s, DataEviction: %s, Replication: %v",
322-
redis.StringValue(createDatabaseRequest.Name),
323-
redis.StringValue(createDatabaseRequest.DataPersistence),
324-
redis.StringValue(createDatabaseRequest.DataEvictionPolicy),
325-
redis.BoolValue(createDatabaseRequest.Replication))
326320

327321
protocol := d.Get("protocol").(string)
328322
if protocol != "" {
@@ -334,14 +328,11 @@ func resourceRedisCloudEssentialsDatabaseCreate(ctx context.Context, d *schema.R
334328
createDatabaseRequest.RespVersion = redis.String(respVersion)
335329
}
336330

337-
// Only send source_ips for PAYG plans - free plans don't support this feature
338-
if d.Get("enable_payg_features").(bool) {
339-
sourceIps := utils.InterfaceToStringSlice(d.Get("source_ips").([]interface{}))
340-
if len(sourceIps) == 0 {
341-
createDatabaseRequest.SourceIPs = []*string{redis.String("0.0.0.0/0")}
342-
} else {
343-
createDatabaseRequest.SourceIPs = sourceIps
344-
}
331+
sourceIps := utils.InterfaceToStringSlice(d.Get("source_ips").([]interface{}))
332+
if len(sourceIps) == 0 {
333+
createDatabaseRequest.SourceIPs = []*string{redis.String("0.0.0.0/0")}
334+
} else {
335+
createDatabaseRequest.SourceIPs = sourceIps
345336
}
346337

347338
replicaRaw := d.Get("replica").([]interface{})
@@ -642,14 +633,11 @@ func resourceRedisCloudEssentialsDatabaseUpdate(ctx context.Context, d *schema.R
642633
updateDatabaseRequest.RespVersion = redis.String(respVersion)
643634
}
644635

645-
// Only send source_ips for PAYG plans - free plans don't support this feature
646-
if d.Get("enable_payg_features").(bool) {
647-
sourceIps := utils.InterfaceToStringSlice(d.Get("source_ips").([]interface{}))
648-
if len(sourceIps) == 0 {
649-
updateDatabaseRequest.SourceIPs = []*string{redis.String("0.0.0.0/0")}
650-
} else {
651-
updateDatabaseRequest.SourceIPs = sourceIps
652-
}
636+
sourceIps := utils.InterfaceToStringSlice(d.Get("source_ips").([]interface{}))
637+
if len(sourceIps) == 0 {
638+
updateDatabaseRequest.SourceIPs = []*string{redis.String("0.0.0.0/0")}
639+
} else {
640+
updateDatabaseRequest.SourceIPs = sourceIps
653641
}
654642

655643
replicaRaw := d.Get("replica").([]interface{})

0 commit comments

Comments
 (0)