Skip to content

Commit 912c660

Browse files
committed
fix(rdb): fix load balancer removal not detected
1 parent 9e6eb04 commit 912c660

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/services/rdb/instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func ResourceInstance() *schema.Resource {
262262
"load_balancer": {
263263
Type: schema.TypeList,
264264
Optional: true,
265-
Computed: true,
265+
MaxItems: 1,
266266
Description: "Load balancer of the database instance",
267267
Elem: &schema.Resource{
268268
Schema: map[string]*schema.Schema{

internal/services/rdb/instance_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,10 +1046,10 @@ func TestAccInstance_Endpoints(t *testing.T) {
10461046
`, latestEngineVersion),
10471047
Check: resource.ComposeTestCheckFunc(
10481048
isInstancePresent(tt, "scaleway_rdb_instance.test_endpoints"),
1049-
resource.TestCheckResourceAttr("scaleway_rdb_instance.test_endpoints", "load_balancer.#", "1"),
1049+
resource.TestCheckResourceAttr("scaleway_rdb_instance.test_endpoints", "load_balancer.#", "0"),
10501050
resource.TestCheckResourceAttr("scaleway_rdb_instance.test_endpoints", "private_network.#", "0"),
1051-
resource.TestCheckResourceAttrSet("scaleway_rdb_instance.test_endpoints", "endpoint_ip"), // Deprecated attribute, might be deleted later
1052-
resource.TestCheckResourceAttrSet("scaleway_rdb_instance.test_endpoints", "endpoint_port"), // Deprecated attribute, might be deleted later
1051+
resource.TestCheckResourceAttr("scaleway_rdb_instance.test_endpoints", "endpoint_ip", ""), // Deprecated attribute, might be deleted later
1052+
resource.TestCheckResourceAttr("scaleway_rdb_instance.test_endpoints", "endpoint_port", "0"), // Deprecated attribute, might be deleted later
10531053
),
10541054
},
10551055
},

0 commit comments

Comments
 (0)