Skip to content

fix(postgresql): [123708596] tencentcloud_postgresql_parameter_template update fileds #3331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/3331.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_postgresql_parameter_template: update fileds `db_major_version`, `db_engine` attribuite
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package postgresql

import (
"context"
"fmt"
"log"

tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
Expand Down Expand Up @@ -31,12 +30,14 @@ func ResourceTencentCloudPostgresqlParameterTemplate() *schema.Resource {

"db_major_version": {
Required: true,
ForceNew: true,
Type: schema.TypeString,
Description: "The major database version number, such as 11, 12, 13.",
},

"db_engine": {
Required: true,
ForceNew: true,
Type: schema.TypeString,
Description: "Database engine, such as postgresql, mssql_compatible.",
},
Expand Down Expand Up @@ -218,15 +219,6 @@ func resourceTencentCloudPostgresqlParameterTemplateUpdate(d *schema.ResourceDat

request.TemplateId = helper.String(d.Id())

immutableArgs := []string{"db_major_version", "db_engine"}

// do not care the param_info_set attribute
for _, v := range immutableArgs {
if d.HasChange(v) {
return fmt.Errorf("argument `%s` cannot be changed", v)
}
}

if d.HasChange("template_name") {
if v, ok := d.GetOk("template_name"); ok {
request.TemplateName = helper.String(v.(string))
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/postgresql_parameter_template.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ resource "tencentcloud_postgresql_parameter_template" "parameter_template" {

The following arguments are supported:

* `db_engine` - (Required, String) Database engine, such as postgresql, mssql_compatible.
* `db_major_version` - (Required, String) The major database version number, such as 11, 12, 13.
* `db_engine` - (Required, String, ForceNew) Database engine, such as postgresql, mssql_compatible.
* `db_major_version` - (Required, String, ForceNew) The major database version number, such as 11, 12, 13.
* `template_name` - (Required, String) Template name, which can contain 1-60 letters, digits, and symbols (-_./()+=:@).
* `delete_param_set` - (Optional, Set: [`String`]) The set of parameters that need to be deleted.
* `modify_param_entry_set` - (Optional, Set) The set of parameters that need to be modified or added. Note: the same parameter cannot appear in the set of modifying and adding and deleting at the same time.
Expand Down
Loading