Skip to content

Commit 0ec25d0

Browse files
authored
feat(postgres): [122057778]support parameters (#3146)
* feat(postgres): [122057778]support parameters * feat: add changelog * fix: modify instanceId property
1 parent a4bfdce commit 0ec25d0

10 files changed

+592
-0
lines changed

.changelog/3146.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
tencentcloud_postgresql_parameters
3+
```

tencentcloud/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,7 @@ func Provider() *schema.Provider {
15571557
"tencentcloud_postgresql_apply_parameter_template_operation": postgresql.ResourceTencentCloudPostgresqlApplyParameterTemplateOperation(),
15581558
"tencentcloud_postgresql_clone_db_instance": postgresql.ResourceTencentCloudPostgresqlCloneDbInstance(),
15591559
"tencentcloud_postgresql_instance_network_access": postgresql.ResourceTencentCloudPostgresqlInstanceNetworkAccess(),
1560+
"tencentcloud_postgresql_parameters": postgresql.ResourceTencentCloudPostgresqlParameters(),
15601561
"tencentcloud_sqlserver_instance": sqlserver.ResourceTencentCloudSqlserverInstance(),
15611562
"tencentcloud_sqlserver_db": sqlserver.ResourceTencentCloudSqlserverDB(),
15621563
"tencentcloud_sqlserver_account": sqlserver.ResourceTencentCloudSqlserverAccount(),

tencentcloud/provider.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,7 @@ TencentDB for PostgreSQL(PostgreSQL)
913913
tencentcloud_postgresql_apply_parameter_template_operation
914914
tencentcloud_postgresql_clone_db_instance
915915
tencentcloud_postgresql_instance_network_access
916+
tencentcloud_postgresql_parameters
916917

917918
TencentDB for Redis(crs)
918919
Data Source

tencentcloud/services/postgresql/resource_tc_postgresql_parameters.go

Lines changed: 217 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Use this resource to create postgresql parameter.
2+
3+
Example Usage
4+
5+
```hcl
6+
variable "default_az" {
7+
default = "ap-guangzhou-3"
8+
}
9+
10+
data "tencentcloud_vpc_subnets" "gz3" {
11+
availability_zone = var.default_az
12+
is_default = true
13+
}
14+
15+
locals {
16+
vpc_id = data.tencentcloud_vpc_subnets.gz3.instance_list.0.vpc_id
17+
subnet_id = data.tencentcloud_vpc_subnets.gz3.instance_list.0.subnet_id
18+
}
19+
20+
data "tencentcloud_availability_zones_by_product" "zone" {
21+
product = "postgres"
22+
}
23+
24+
resource "tencentcloud_postgresql_instance" "test" {
25+
name = "tf_postsql_postpaid"
26+
availability_zone = var.default_az
27+
charge_type = "POSTPAID_BY_HOUR"
28+
period = 1
29+
vpc_id = local.vpc_id
30+
subnet_id = local.subnet_id
31+
engine_version = "13.3"
32+
root_password = "t1qaA2k1wgvfa3?ZZZ"
33+
security_groups = ["sg-5275dorp"]
34+
charset = "LATIN1"
35+
project_id = 0
36+
memory = 2
37+
storage = 20
38+
}
39+
resource "tencentcloud_postgresql_parameters" "postgresql_parameters" {
40+
db_instance_id = tencentcloud_postgresql_instance.test.id
41+
param_list {
42+
expected_value = "off"
43+
name = "check_function_bodies"
44+
}
45+
}
46+
```
47+
48+
Import
49+
50+
postgresql parameters can be imported, e.g.
51+
52+
```
53+
$ terraform import tencentcloud_postgresql_parameters.example pgrogrp-lckioi2a
54+
```

0 commit comments

Comments
 (0)