Skip to content

Commit e5520bb

Browse files
author
mikatong
committed
update
1 parent cfec2f5 commit e5520bb

File tree

2 files changed

+9
-117
lines changed

2 files changed

+9
-117
lines changed
Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,10 @@
1-
Provides a resource to create a postgresql account
1+
Provides a resource to apply template
22

33
Example Usage
44

55
```hcl
6-
variable "availability_zone" {
7-
default = "ap-guangzhou-3"
6+
resource tencentcloud_postgresql_apply_template_operation "apply_template_operation" {
7+
db_instance_id = "postgres-xxxxxx"
8+
template_id = "xxxxxx"
89
}
9-
10-
# create vpc
11-
resource "tencentcloud_vpc" "vpc" {
12-
name = "vpc"
13-
cidr_block = "10.0.0.0/16"
14-
}
15-
16-
# create vpc subnet
17-
resource "tencentcloud_subnet" "subnet" {
18-
availability_zone = var.availability_zone
19-
name = "subnet"
20-
vpc_id = tencentcloud_vpc.vpc.id
21-
cidr_block = "10.0.20.0/28"
22-
is_multicast = false
23-
}
24-
25-
# create postgresql
26-
resource "tencentcloud_postgresql_instance" "example" {
27-
name = "example"
28-
availability_zone = var.availability_zone
29-
charge_type = "POSTPAID_BY_HOUR"
30-
vpc_id = tencentcloud_vpc.vpc.id
31-
subnet_id = tencentcloud_subnet.subnet.id
32-
db_major_version = "10"
33-
engine_version = "10.23"
34-
root_user = "root123"
35-
root_password = "Root123$"
36-
charset = "UTF8"
37-
project_id = 0
38-
cpu = 1
39-
memory = 2
40-
storage = 10
41-
42-
tags = {
43-
test = "tf"
44-
}
45-
}
46-
47-
# create account
48-
resource "tencentcloud_postgresql_account" "example" {
49-
db_instance_id = tencentcloud_postgresql_instance.example.id
50-
user_name = "tf_example"
51-
password = "Password@123"
52-
type = "normal"
53-
remark = "remark"
54-
lock_status = false
55-
}
56-
```
57-
58-
Import
59-
60-
postgres account can be imported using the id, e.g.
61-
62-
```
63-
terraform import tencentcloud_postgresql_account.example postgres-3hk6b6tj#tf_example
6410
```

website/docs/r/postgresql_apply_template_operation.html.markdown

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,65 +4,19 @@ layout: "tencentcloud"
44
page_title: "TencentCloud: tencentcloud_postgresql_apply_template_operation"
55
sidebar_current: "docs-tencentcloud-resource-postgresql_apply_template_operation"
66
description: |-
7-
Provides a resource to create a postgresql account
7+
Provides a resource to apply template
88
---
99

1010
# tencentcloud_postgresql_apply_template_operation
1111

12-
Provides a resource to create a postgresql account
12+
Provides a resource to apply template
1313

1414
## Example Usage
1515

1616
```hcl
17-
variable "availability_zone" {
18-
default = "ap-guangzhou-3"
19-
}
20-
21-
# create vpc
22-
resource "tencentcloud_vpc" "vpc" {
23-
name = "vpc"
24-
cidr_block = "10.0.0.0/16"
25-
}
26-
27-
# create vpc subnet
28-
resource "tencentcloud_subnet" "subnet" {
29-
availability_zone = var.availability_zone
30-
name = "subnet"
31-
vpc_id = tencentcloud_vpc.vpc.id
32-
cidr_block = "10.0.20.0/28"
33-
is_multicast = false
34-
}
35-
36-
# create postgresql
37-
resource "tencentcloud_postgresql_instance" "example" {
38-
name = "example"
39-
availability_zone = var.availability_zone
40-
charge_type = "POSTPAID_BY_HOUR"
41-
vpc_id = tencentcloud_vpc.vpc.id
42-
subnet_id = tencentcloud_subnet.subnet.id
43-
db_major_version = "10"
44-
engine_version = "10.23"
45-
root_user = "root123"
46-
root_password = "Root123$"
47-
charset = "UTF8"
48-
project_id = 0
49-
cpu = 1
50-
memory = 2
51-
storage = 10
52-
53-
tags = {
54-
test = "tf"
55-
}
56-
}
57-
58-
# create account
59-
resource "tencentcloud_postgresql_account" "example" {
60-
db_instance_id = tencentcloud_postgresql_instance.example.id
61-
user_name = "tf_example"
62-
password = "Password@123"
63-
type = "normal"
64-
remark = "remark"
65-
lock_status = false
17+
resource tencentcloud_postgresql_apply_template_operation "apply_template_operation" {
18+
db_instance_id = "postgres-xxxxxx"
19+
template_id = "xxxxxx"
6620
}
6721
```
6822

@@ -81,11 +35,3 @@ In addition to all arguments above, the following attributes are exported:
8135

8236

8337

84-
## Import
85-
86-
postgres account can be imported using the id, e.g.
87-
88-
```
89-
terraform import tencentcloud_postgresql_account.example postgres-3hk6b6tj#tf_example
90-
```
91-

0 commit comments

Comments
 (0)