Skip to content

feat(postgres): [122057778]support parameters #3146

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 4 commits into from
Feb 25, 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/3146.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
tencentcloud_postgresql_parameters
```
1 change: 1 addition & 0 deletions tencentcloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,7 @@ func Provider() *schema.Provider {
"tencentcloud_postgresql_apply_parameter_template_operation": postgresql.ResourceTencentCloudPostgresqlApplyParameterTemplateOperation(),
"tencentcloud_postgresql_clone_db_instance": postgresql.ResourceTencentCloudPostgresqlCloneDbInstance(),
"tencentcloud_postgresql_instance_network_access": postgresql.ResourceTencentCloudPostgresqlInstanceNetworkAccess(),
"tencentcloud_postgresql_parameters": postgresql.ResourceTencentCloudPostgresqlParameters(),
"tencentcloud_sqlserver_instance": sqlserver.ResourceTencentCloudSqlserverInstance(),
"tencentcloud_sqlserver_db": sqlserver.ResourceTencentCloudSqlserverDB(),
"tencentcloud_sqlserver_account": sqlserver.ResourceTencentCloudSqlserverAccount(),
Expand Down
1 change: 1 addition & 0 deletions tencentcloud/provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ TencentDB for PostgreSQL(PostgreSQL)
tencentcloud_postgresql_apply_parameter_template_operation
tencentcloud_postgresql_clone_db_instance
tencentcloud_postgresql_instance_network_access
tencentcloud_postgresql_parameters

TencentDB for Redis(crs)
Data Source
Expand Down
217 changes: 217 additions & 0 deletions tencentcloud/services/postgresql/resource_tc_postgresql_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Use this resource to create postgresql parameter.

Example Usage

```hcl
variable "default_az" {
default = "ap-guangzhou-3"
}

data "tencentcloud_vpc_subnets" "gz3" {
availability_zone = var.default_az
is_default = true
}

locals {
vpc_id = data.tencentcloud_vpc_subnets.gz3.instance_list.0.vpc_id
subnet_id = data.tencentcloud_vpc_subnets.gz3.instance_list.0.subnet_id
}

data "tencentcloud_availability_zones_by_product" "zone" {
product = "postgres"
}

resource "tencentcloud_postgresql_instance" "test" {
name = "tf_postsql_postpaid"
availability_zone = var.default_az
charge_type = "POSTPAID_BY_HOUR"
period = 1
vpc_id = local.vpc_id
subnet_id = local.subnet_id
engine_version = "13.3"
root_password = "t1qaA2k1wgvfa3?ZZZ"
security_groups = ["sg-5275dorp"]
charset = "LATIN1"
project_id = 0
memory = 2
storage = 20
}
resource "tencentcloud_postgresql_parameters" "postgresql_parameters" {
db_instance_id = tencentcloud_postgresql_instance.test.id
param_list {
expected_value = "off"
name = "check_function_bodies"
}
}
```

Import

postgresql parameters can be imported, e.g.

```
$ terraform import tencentcloud_postgresql_parameters.example pgrogrp-lckioi2a
```
Loading
Loading