Skip to content

Commit eed5a06

Browse files
authored
rm force new of availability_zone (#1888)
* rm force new of availability_zone * add changelog and doc
1 parent bb3e6fb commit eed5a06

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.changelog/1888.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_instance: adjust `availability_zone` to unchangeable.
3+
```

tencentcloud/resource_tc_postgresql_instance.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,7 @@ func resourceTencentCloudPostgresqlInstance() *schema.Resource {
305305
"availability_zone": {
306306
Type: schema.TypeString,
307307
Required: true,
308-
ForceNew: true,
309-
Description: "Availability zone. NOTE: If value modified but included in `db_node_set`, the diff will be suppressed.",
308+
Description: "Availability zone. NOTE: This field could not be modified, please use `db_node_set` instead of modification. The changes on this field will be suppressed when using the `db_node_set`.",
310309
DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool {
311310
if o == "" {
312311
return false
@@ -1183,9 +1182,9 @@ func resourceTencentCloudPostgresqlInstanceUpdate(d *schema.ResourceData, meta i
11831182

11841183
}
11851184

1186-
if d.HasChange("zone") {
1187-
log.Printf("[WARN] argument `zone` modified, skip process")
1188-
1185+
if d.HasChange("availability_zone") {
1186+
log.Printf("[WARN] argument `availability_zone` modified, skip process")
1187+
return fmt.Errorf("The `availability_zone` cannot be modified, please use `db_node_set` instead of it.")
11891188
}
11901189

11911190
if d.HasChange("db_kernel_version") {

website/docs/r/postgresql_instance.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ resource "tencentcloud_postgresql_instance" "test" {
181181

182182
The following arguments are supported:
183183

184-
* `availability_zone` - (Required, String, ForceNew) Availability zone. NOTE: If value modified but included in `db_node_set`, the diff will be suppressed.
184+
* `availability_zone` - (Required, String) Availability zone. NOTE: This field could not be modified, please use `db_node_set` instead of modification. The changes on this field will be suppressed when using the `db_node_set`.
185185
* `memory` - (Required, Int) Memory size(in GB). Allowed value must be larger than `memory` that data source `tencentcloud_postgresql_specinfos` provides.
186186
* `name` - (Required, String) Name of the postgresql instance.
187187
* `root_password` - (Required, String) Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.

0 commit comments

Comments
 (0)