1
1
package ipam_test
2
2
3
3
import (
4
+ "fmt"
4
5
"testing"
5
6
6
7
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
@@ -123,13 +124,16 @@ func TestAccDataSourceIPAMIP_InstanceLB(t *testing.T) {
123
124
func TestAccDataSourceIPAMIP_RDB (t * testing.T ) {
124
125
tt := acctest .NewTestTools (t )
125
126
defer tt .Cleanup ()
127
+
128
+ latestEngineVersion := rdbchecks .GetLatestEngineVersion (tt , "PostgreSQL" )
129
+
126
130
resource .ParallelTest (t , resource.TestCase {
127
131
PreCheck : func () { acctest .PreCheck (t ) },
128
132
ProviderFactories : tt .ProviderFactories ,
129
133
CheckDestroy : rdbchecks .IsInstanceDestroyed (tt ),
130
134
Steps : []resource.TestStep {
131
135
{
132
- Config : `
136
+ Config : fmt . Sprintf ( `
133
137
resource "scaleway_vpc" "main" {
134
138
name = "tf-tests-ipam-ip-datasource-rdb"
135
139
}
@@ -145,13 +149,13 @@ func TestAccDataSourceIPAMIP_RDB(t *testing.T) {
145
149
resource scaleway_rdb_instance main {
146
150
name = "test-ipam-ip-rdb"
147
151
node_type = "db-dev-s"
148
- engine = "PostgreSQL-14"
152
+ engine = %q
149
153
is_ha_cluster = false
150
154
disable_backup = true
151
155
user_name = "my_initial_user"
152
156
password = "thiZ_is_v&ry_s3cret"
153
157
tags = [ "terraform-test", "scaleway_rdb_instance", "volume", "rdb_pn" ]
154
- volume_type = "bssd "
158
+ volume_type = "sbs_5k "
155
159
volume_size_in_gb = 10
156
160
private_network {
157
161
pn_id = "${scaleway_vpc_private_network.main.id}"
@@ -166,7 +170,7 @@ func TestAccDataSourceIPAMIP_RDB(t *testing.T) {
166
170
}
167
171
type = "ipv4"
168
172
}
169
- ` ,
173
+ ` , latestEngineVersion ),
170
174
Check : resource .ComposeTestCheckFunc (
171
175
resource .TestCheckResourceAttrSet ("data.scaleway_ipam_ip.main" , "address" ),
172
176
),
0 commit comments