Skip to content

Commit fcea3c0

Browse files
committed
add
1 parent d7df13c commit fcea3c0

File tree

3 files changed

+72
-9
lines changed

3 files changed

+72
-9
lines changed

tencentcloud/services/cls/resource_tc_cls_cos_shipper.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ func ResourceTencentCloudClsCosShipper() *schema.Resource {
179179
"start_time": {
180180
Type: schema.TypeInt,
181181
Optional: true,
182+
Computed: true,
182183
Description: "Start time for data shipping, which cannot be earlier than the lifecycle start time of the log topic. If you do not specify this parameter, it will be set to the time when you create the data shipping task.",
183184
},
184185
"end_time": {

tencentcloud/services/cls/resource_tc_cls_cos_shipper.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,45 @@ Provides a resource to create a cls cos shipper.
33
Example Usage
44

55
```hcl
6-
resource "tencentcloud_cls_cos_shipper" "shipper" {
7-
bucket = "preset-scf-bucket-1308919341"
6+
data "tencentcloud_user_info" "info" {}
7+
8+
locals {
9+
app_id = data.tencentcloud_user_info.info.app_id
10+
}
11+
12+
resource "tencentcloud_cos_bucket" "example" {
13+
bucket = "private-bucket-${local.app_id}"
14+
acl = "private"
15+
}
16+
17+
resource "tencentcloud_cls_logset" "example" {
18+
logset_name = "tf-example"
19+
tags = {
20+
createBy = "Terraform"
21+
}
22+
}
23+
24+
resource "tencentcloud_cls_topic" "example" {
25+
topic_name = "tf-example"
26+
logset_id = tencentcloud_cls_logset.example.id
27+
auto_split = false
28+
max_split_partitions = 20
29+
partition_count = 1
30+
period = 10
31+
storage_type = "hot"
32+
tags = {
33+
createBy = "Terraform"
34+
}
35+
}
36+
37+
resource "tencentcloud_cls_cos_shipper" "example" {
38+
bucket = tencentcloud_cos_bucket.example.id
39+
topic_id = tencentcloud_cls_topic.example.id
840
interval = 300
941
max_size = 200
1042
partition = "/%Y/%m/%d/%H/"
1143
prefix = "ap-guangzhou-fffsasad-1649734752"
1244
shipper_name = "ap-guangzhou-fffsasad-1649734752"
13-
topic_id = "4d07fba0-b93e-4e0b-9a7f-d58542560bbb"
1445
1546
compress {
1647
format = "lzop"
@@ -20,7 +51,7 @@ resource "tencentcloud_cls_cos_shipper" "shipper" {
2051
format = "json"
2152
2253
json {
23-
enable_tag = true
54+
enable_tag = true
2455
meta_fields = [
2556
"__FILENAME__",
2657
"__SOURCE__",
@@ -36,5 +67,5 @@ Import
3667
cls cos shipper can be imported using the id, e.g.
3768

3869
```
39-
$ terraform import tencentcloud_cls_cos_shipper.shipper 5d1b7b2a-c163-4c48-bb01-9ee00584d761
70+
$ terraform import tencentcloud_cls_cos_shipper.example 5d1b7b2a-c163-4c48-bb01-9ee00584d761
4071
```

website/docs/r/cls_cos_shipper.html.markdown

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,45 @@ Provides a resource to create a cls cos shipper.
1414
## Example Usage
1515

1616
```hcl
17-
resource "tencentcloud_cls_cos_shipper" "shipper" {
18-
bucket = "preset-scf-bucket-1308919341"
17+
data "tencentcloud_user_info" "info" {}
18+
19+
locals {
20+
app_id = data.tencentcloud_user_info.info.app_id
21+
}
22+
23+
resource "tencentcloud_cos_bucket" "example" {
24+
bucket = "private-bucket-${local.app_id}"
25+
acl = "private"
26+
}
27+
28+
resource "tencentcloud_cls_logset" "example" {
29+
logset_name = "tf-example"
30+
tags = {
31+
createBy = "Terraform"
32+
}
33+
}
34+
35+
resource "tencentcloud_cls_topic" "example" {
36+
topic_name = "tf-example"
37+
logset_id = tencentcloud_cls_logset.example.id
38+
auto_split = false
39+
max_split_partitions = 20
40+
partition_count = 1
41+
period = 10
42+
storage_type = "hot"
43+
tags = {
44+
createBy = "Terraform"
45+
}
46+
}
47+
48+
resource "tencentcloud_cls_cos_shipper" "example" {
49+
bucket = tencentcloud_cos_bucket.example.id
50+
topic_id = tencentcloud_cls_topic.example.id
1951
interval = 300
2052
max_size = 200
2153
partition = "/%Y/%m/%d/%H/"
2254
prefix = "ap-guangzhou-fffsasad-1649734752"
2355
shipper_name = "ap-guangzhou-fffsasad-1649734752"
24-
topic_id = "4d07fba0-b93e-4e0b-9a7f-d58542560bbb"
2556
2657
compress {
2758
format = "lzop"
@@ -104,6 +135,6 @@ In addition to all arguments above, the following attributes are exported:
104135
cls cos shipper can be imported using the id, e.g.
105136

106137
```
107-
$ terraform import tencentcloud_cls_cos_shipper.shipper 5d1b7b2a-c163-4c48-bb01-9ee00584d761
138+
$ terraform import tencentcloud_cls_cos_shipper.example 5d1b7b2a-c163-4c48-bb01-9ee00584d761
108139
```
109140

0 commit comments

Comments
 (0)