Skip to content

Commit ba297da

Browse files
Merge pull request #698 from RedisLabs/bugfix/disable-default-user
2 parents af7fbbb + ff49d27 commit ba297da

23 files changed

+1445
-122
lines changed

.github/workflows/terraform_provider_pr.yml

Lines changed: 54 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,28 @@ jobs:
5656
name: go build
5757
run: go build -o terraform-plugin-dir/registry.terraform.io/RedisLabs/rediscloud/99.99.99/$(go env GOOS)_$(go env GOARCH)/terraform-provider-rediscloud .
5858

59+
go_unit_test:
60+
name: go unit test
61+
needs: [go_build]
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
65+
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
66+
with:
67+
go-version-file: go.mod
68+
- run: go test ./... -run="^TestUnit" # Runs tests starting with TestUnit
69+
70+
tfproviderlint:
71+
name: tfproviderlint
72+
needs: [go_build]
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
76+
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
77+
with:
78+
go-version-file: go.mod
79+
- run: make tfproviderlint
80+
5981
terraform_providers_schema:
6082
name: terraform providers schema
6183
needs: [go_build]
@@ -102,9 +124,33 @@ jobs:
102124
mkdir terraform-providers-schema
103125
terraform providers schema -json > terraform-providers-schema/schema.json
104126
127+
# All acceptance tests run in parallel after quick tests
128+
go_test_smoke_aa_tgw_attachment:
129+
if: false # Temporarily disabled - TGW tests not ready yet
130+
name: go test smoke aa tgw attachment
131+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
132+
runs-on: ubuntu-latest
133+
steps:
134+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
135+
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
136+
with:
137+
go-version-file: go.mod
138+
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudActiveActiveTransitGatewayAttachment_CRUDI"'
139+
140+
go_test_smoke_aa_enable_default_user:
141+
name: go test smoke aa enable default user
142+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
143+
runs-on: ubuntu-latest
144+
steps:
145+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
146+
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
147+
with:
148+
go-version-file: go.mod
149+
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudActiveActiveDatabase_enableDefaultUser"'
150+
105151
go_test_smoke_aa_db:
106152
name: go test smoke aa db
107-
needs: [go_build]
153+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
108154
runs-on: ubuntu-latest
109155
steps:
110156
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -115,7 +161,7 @@ jobs:
115161

116162
go_test_smoke_essentials_sub:
117163
name: go test smoke essentials sub
118-
needs: [go_build]
164+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
119165
runs-on: ubuntu-latest
120166
steps:
121167
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -139,7 +185,7 @@ jobs:
139185

140186
go_test_smoke_pro_db:
141187
name: go test smoke pro db
142-
needs: [go_build]
188+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
143189
runs-on: ubuntu-latest
144190
steps:
145191
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -151,7 +197,7 @@ jobs:
151197

152198
go_test_smoke_misc:
153199
name: go test smoke misc
154-
needs: [ go_build ]
200+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
155201
runs-on: ubuntu-latest
156202
steps:
157203
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -162,7 +208,7 @@ jobs:
162208

163209
go_test_pro_db_upgrade:
164210
name: go test smoke pro db upgrade
165-
needs: [ go_build ]
211+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
166212
runs-on: ubuntu-latest
167213
steps:
168214
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -173,7 +219,7 @@ jobs:
173219

174220
go_test_privatelink:
175221
name: go test smoke privatelink
176-
needs: [ go_build ]
222+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
177223
runs-on: ubuntu-latest
178224
steps:
179225
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -185,7 +231,7 @@ jobs:
185231

186232
go_test_block_public_endpoints:
187233
name: go test smoke public endpoints
188-
needs: [ go_build ]
234+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
189235
runs-on: ubuntu-latest
190236
steps:
191237
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -196,33 +242,11 @@ jobs:
196242

197243
go_test_smoke_qpf:
198244
name: go test smoke query performance factor
199-
needs: [ go_build ]
245+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
200246
runs-on: ubuntu-latest
201247
steps:
202248
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
203249
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
204250
with:
205251
go-version-file: go.mod
206252
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudProDatabase_qpf"'
207-
208-
go_unit_test:
209-
name: go unit test
210-
needs: [go_build]
211-
runs-on: ubuntu-latest
212-
steps:
213-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
214-
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
215-
with:
216-
go-version-file: go.mod
217-
- run: go test ./... -run="^TestUnit" # Runs tests starting with TestUnit
218-
219-
tfproviderlint:
220-
name: tfproviderlint
221-
needs: [go_build]
222-
runs-on: ubuntu-latest
223-
steps:
224-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
225-
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
226-
with:
227-
go-version-file: go.mod
228-
- run: make tfproviderlint

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
44
See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)
55

66

7+
# 2.7.3 (6th November 2025)
8+
9+
## Changed
10+
- Reworked the entire interaction between global/regional overrides and how they read config and state. This should fix many existing subtle state drift bugs.
11+
12+
## Fixed
13+
- `rediscloud_active_active_subscription_database`: Fixed multiple issues concerning regional `enable_default_user` and `global_enable_default_user` to do with drift or incorrectly not detecting changes.
14+
- The default for `global_enable_default_user` was omitted, it is now set to true.
15+
- `rediscloud_active_active_transit_gateway_attachment`: Fixed parameter order bug in update operation.
16+
17+
## Testing
18+
- Added acceptance tests covering `enable_default_user` inheritance and override scenarios
19+
- Added acceptance test for `rediscloud_active_active_transit_gateway_attachment` resource lifecycle (Create/Read/Update/Delete/Import)
20+
721
# 2.7.2 (3rd November 2025)
822

923
## Fixed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Template signature: fmt.Sprintf(template, subscription_name, database_name, password)
2+
locals {
3+
subscription_name = "%s"
4+
database_name = "%s"
5+
password = "%s"
6+
}
7+
8+
data "rediscloud_payment_method" "card" {
9+
card_type = "Visa"
10+
last_four_numbers = "5556"
11+
}
12+
13+
resource "rediscloud_active_active_subscription" "test" {
14+
name = local.subscription_name
15+
payment_method_id = data.rediscloud_payment_method.card.id
16+
cloud_provider = "AWS"
17+
18+
creation_plan {
19+
dataset_size_in_gb = 1
20+
quantity = 1
21+
region {
22+
region = "us-east-1"
23+
networking_deployment_cidr = "192.168.0.0/24"
24+
write_operations_per_second = 1000
25+
read_operations_per_second = 1000
26+
}
27+
region {
28+
region = "us-east-2"
29+
networking_deployment_cidr = "10.0.1.0/24"
30+
write_operations_per_second = 1000
31+
read_operations_per_second = 1000
32+
}
33+
}
34+
}
35+
36+
resource "rediscloud_active_active_subscription_database" "test" {
37+
subscription_id = rediscloud_active_active_subscription.test.id
38+
name = local.database_name
39+
dataset_size_in_gb = 1
40+
global_password = local.password
41+
global_enable_default_user = true
42+
43+
# us-east-1: explicitly true
44+
override_region {
45+
name = "us-east-1"
46+
enable_default_user = true
47+
}
48+
49+
# us-east-2: explicitly false
50+
override_region {
51+
name = "us-east-2"
52+
enable_default_user = false
53+
}
54+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Template signature: fmt.Sprintf(template, subscription_name, database_name, password)
2+
locals {
3+
subscription_name = "%s"
4+
database_name = "%s"
5+
password = "%s"
6+
}
7+
8+
data "rediscloud_payment_method" "card" {
9+
card_type = "Visa"
10+
last_four_numbers = "5556"
11+
}
12+
13+
resource "rediscloud_active_active_subscription" "test" {
14+
name = local.subscription_name
15+
payment_method_id = data.rediscloud_payment_method.card.id
16+
cloud_provider = "AWS"
17+
18+
creation_plan {
19+
dataset_size_in_gb = 1
20+
quantity = 1
21+
region {
22+
region = "us-east-1"
23+
networking_deployment_cidr = "192.168.0.0/24"
24+
write_operations_per_second = 1000
25+
read_operations_per_second = 1000
26+
}
27+
region {
28+
region = "us-east-2"
29+
networking_deployment_cidr = "10.0.1.0/24"
30+
write_operations_per_second = 1000
31+
read_operations_per_second = 1000
32+
}
33+
}
34+
}
35+
36+
resource "rediscloud_active_active_subscription_database" "test" {
37+
subscription_id = rediscloud_active_active_subscription.test.id
38+
name = local.database_name
39+
dataset_size_in_gb = 1
40+
global_password = local.password
41+
global_enable_default_user = false
42+
43+
# us-east-1: explicitly enable (override global false)
44+
override_region {
45+
name = "us-east-1"
46+
enable_default_user = true
47+
}
48+
49+
# us-east-2: inherit global=false
50+
override_region {
51+
name = "us-east-2"
52+
}
53+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Template signature: fmt.Sprintf(template, subscription_name, database_name, password)
2+
locals {
3+
subscription_name = "%s"
4+
database_name = "%s"
5+
password = "%s"
6+
}
7+
8+
data "rediscloud_payment_method" "card" {
9+
card_type = "Visa"
10+
last_four_numbers = "5556"
11+
}
12+
13+
resource "rediscloud_active_active_subscription" "test" {
14+
name = local.subscription_name
15+
payment_method_id = data.rediscloud_payment_method.card.id
16+
cloud_provider = "AWS"
17+
18+
creation_plan {
19+
dataset_size_in_gb = 1
20+
quantity = 1
21+
region {
22+
region = "us-east-1"
23+
networking_deployment_cidr = "192.168.0.0/24"
24+
write_operations_per_second = 1000
25+
read_operations_per_second = 1000
26+
}
27+
region {
28+
region = "us-east-2"
29+
networking_deployment_cidr = "10.0.1.0/24"
30+
write_operations_per_second = 1000
31+
read_operations_per_second = 1000
32+
}
33+
}
34+
}
35+
36+
resource "rediscloud_active_active_subscription_database" "test" {
37+
subscription_id = rediscloud_active_active_subscription.test.id
38+
name = local.database_name
39+
dataset_size_in_gb = 1
40+
global_password = local.password
41+
global_enable_default_user = true
42+
43+
# Both regions should inherit global=true
44+
# Before fix: would send enableDefaultUser=false to API
45+
# After fix: should NOT send enableDefaultUser at all
46+
override_region {
47+
name = "us-east-1"
48+
}
49+
override_region {
50+
name = "us-east-2"
51+
}
52+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Template signature: fmt.Sprintf(template, subscription_name, database_name, password)
2+
locals {
3+
subscription_name = "%s"
4+
database_name = "%s"
5+
password = "%s"
6+
}
7+
8+
data "rediscloud_payment_method" "card" {
9+
card_type = "Visa"
10+
last_four_numbers = "5556"
11+
}
12+
13+
resource "rediscloud_active_active_subscription" "test" {
14+
name = local.subscription_name
15+
payment_method_id = data.rediscloud_payment_method.card.id
16+
cloud_provider = "AWS"
17+
18+
creation_plan {
19+
dataset_size_in_gb = 1
20+
quantity = 1
21+
region {
22+
region = "us-east-1"
23+
networking_deployment_cidr = "192.168.0.0/24"
24+
write_operations_per_second = 1000
25+
read_operations_per_second = 1000
26+
}
27+
region {
28+
region = "us-east-2"
29+
networking_deployment_cidr = "10.0.1.0/24"
30+
write_operations_per_second = 1000
31+
read_operations_per_second = 1000
32+
}
33+
}
34+
}
35+
36+
resource "rediscloud_active_active_subscription_database" "test" {
37+
subscription_id = rediscloud_active_active_subscription.test.id
38+
name = local.database_name
39+
dataset_size_in_gb = 1
40+
global_password = local.password
41+
global_enable_default_user = true
42+
43+
# us-east-1: explicitly disable (override global)
44+
override_region {
45+
name = "us-east-1"
46+
enable_default_user = false
47+
}
48+
49+
# us-east-2: inherit global=true
50+
override_region {
51+
name = "us-east-2"
52+
}
53+
}

0 commit comments

Comments
 (0)