Skip to content

Commit 1b25548

Browse files
author
mikatong
committed
update
1 parent ec012ee commit 1b25548

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.changelog/3324.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_postgresql_readonly_instance: fixed the issue of returning an empty id when creating
3+
```

tencentcloud/services/postgresql/resource_tc_postgresql_readonly_instance_test.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,24 @@ func TestAccTencentCloudPostgresqlReadonlyInstanceResource_update_ro_group(t *te
132132
})
133133
}
134134

135+
func TestAccTencentCloudPostgresqlReadonlyInstanceResource_prepaid(t *testing.T) {
136+
resource.Test(t, resource.TestCase{
137+
PreCheck: func() {
138+
tcacctest.AccPreCheck(t)
139+
},
140+
Providers: tcacctest.AccProviders,
141+
Steps: []resource.TestStep{
142+
{
143+
Config: testAccPostgresqlReadonlyInstanceInstance_prepaid,
144+
Check: resource.ComposeTestCheckFunc(
145+
resource.TestCheckResourceAttrSet(testPostgresqlReadonlyInstanceResourceKey, "id"),
146+
resource.TestCheckResourceAttr(testPostgresqlReadonlyInstanceResourceKey, "instance_charge_type", "PREPAID"),
147+
),
148+
},
149+
},
150+
})
151+
}
152+
135153
const testAccPostgresqlReadonlyInstanceInstance_basic_without_rogroup string = tcacctest.OperationPresetPGSQL + tcacctest.DefaultVpcSubnets + tcacctest.DefaultSecurityGroupData + `
136154
resource "tencentcloud_postgresql_readonly_instance" "instance" {
137155
auto_renew_flag = 0
@@ -244,3 +262,22 @@ const testAccPostgresqlReadonlyInstanceInstance_update_rogroup string = tcacctes
244262
min_delay_eliminate_reserve = 1
245263
}
246264
`
265+
266+
const testAccPostgresqlReadonlyInstanceInstance_prepaid = `
267+
resource "tencentcloud_postgresql_readonly_instance" "instance" {
268+
db_version = "17.0"
269+
instance_charge_type = "PREPAID"
270+
period = 1
271+
master_db_instance_id = "postgres-25816pex"
272+
memory = 4
273+
cpu = 2
274+
name = "tf_ro_instance_test_rog"
275+
need_support_ipv6 = 0
276+
project_id = 0
277+
security_groups_ids = ["sg-kensue7b"]
278+
storage = 20
279+
vpc_id = "vpc-48tmc13b"
280+
subnet_id = "subnet-96hw3j18"
281+
zone = "ap-guangzhou-3"
282+
}
283+
`

0 commit comments

Comments
 (0)