Skip to content

Commit 250ffaf

Browse files
committed
feat: add changelog and doc
1 parent 3324559 commit 250ffaf

File tree

4 files changed

+170
-11
lines changed

4 files changed

+170
-11
lines changed

.changelog/2697.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_teo_realtime_log_delivery
3+
```

tencentcloud/services/teo/resource_tc_teo_realtime_log_delivery.go

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
---
2+
subcategory: "TencentCloud EdgeOne(TEO)"
3+
layout: "tencentcloud"
4+
page_title: "TencentCloud: tencentcloud_teo_realtime_log_delivery"
5+
sidebar_current: "docs-tencentcloud-resource-teo_realtime_log_delivery"
6+
description: |-
7+
Provides a resource to create a teo teo_realtime_log_delivery
8+
---
9+
10+
# tencentcloud_teo_realtime_log_delivery
11+
12+
Provides a resource to create a teo teo_realtime_log_delivery
13+
14+
## Example Usage
15+
16+
```hcl
17+
resource "tencentcloud_teo_realtime_log_delivery" "teo_realtime_log_delivery" {
18+
area = "overseas"
19+
delivery_status = "disabled"
20+
entity_list = [
21+
"sid-2yvhjw98uaco",
22+
]
23+
fields = [
24+
"ServiceID",
25+
"ConnectTimeStamp",
26+
"DisconnetTimeStamp",
27+
"DisconnetReason",
28+
"ClientRealIP",
29+
"ClientRegion",
30+
"EdgeIP",
31+
"ForwardProtocol",
32+
"ForwardPort",
33+
"SentBytes",
34+
"ReceivedBytes",
35+
"LogTimeStamp",
36+
]
37+
log_type = "application"
38+
sample = 0
39+
task_name = "test"
40+
task_type = "s3"
41+
zone_id = "zone-2qtuhspy7cr6"
42+
43+
log_format {
44+
field_delimiter = ","
45+
format_type = "json"
46+
record_delimiter = "\n"
47+
record_prefix = "{"
48+
record_suffix = "}"
49+
}
50+
51+
s3 {
52+
access_id = "xxxxxxxxxx"
53+
access_key = "xxxxxxxxxx"
54+
bucket = "test-1253833068"
55+
compress_type = "gzip"
56+
endpoint = "https://test-1253833068.cos.ap-nanjing.myqcloud.com"
57+
region = "ap-nanjing"
58+
}
59+
}
60+
```
61+
62+
## Argument Reference
63+
64+
The following arguments are supported:
65+
66+
* `area` - (Required, String) Data delivery area, possible values are: `mainland`: within mainland China; `overseas`: worldwide (excluding mainland China).
67+
* `entity_list` - (Required, List: [`String`]) List of entities (seven-layer domain names or four-layer proxy instances) corresponding to real-time log delivery tasks. Example values are as follows: Seven-layer domain name: `domain.example.com`; four-layer proxy instance: sid-2s69eb5wcms7. For values, refer to: `https://cloud.tencent.com/document/api/1552/80690`, `https://cloud.tencent.com/document/api/1552/86336`.
68+
* `fields` - (Required, List: [`String`]) A list of preset fields for delivery.
69+
* `log_type` - (Required, String) Data delivery type, the values are: `domain`: site acceleration log; `application`: four-layer proxy log; `web-rateLiming`: rate limit and CC attack protection log; `web-attack`: managed rule log; `web-rule`: custom rule log; `web-bot`: Bot management log.
70+
* `sample` - (Required, Int) The sampling ratio is in thousandths, with a value range of 1-1000. For example, filling in 605 means the sampling ratio is 60.5%. Leaving it blank means the sampling ratio is 100%.
71+
* `task_name` - (Required, String) The name of the real-time log delivery task. The format is a combination of numbers, English, -, and _. The maximum length is 200 characters.
72+
* `task_type` - (Required, String) The real-time log delivery task type. The possible values are: `cls`: push to Tencent Cloud CLS; `custom_endpoint`: push to a custom HTTP(S) address; `s3`: push to an AWS S3 compatible storage bucket address.
73+
* `zone_id` - (Required, String, ForceNew) ID of the site.
74+
* `cls` - (Optional, List) CLS configuration information. This parameter is required when TaskType is cls.
75+
* `custom_endpoint` - (Optional, List) Customize the configuration information of the HTTP service. This parameter is required when TaskType is set to custom_endpoint.
76+
* `custom_fields` - (Optional, List) The list of custom fields delivered supports extracting specified field values from HTTP request headers, response headers, and cookies. Custom field names cannot be repeated and cannot exceed 200 fields.
77+
* `delivery_conditions` - (Optional, List) The filter condition for log delivery. If it is not filled, all logs will be delivered.
78+
* `delivery_status` - (Optional, String) The status of the real-time log delivery task. The values are: `enabled`: enabled; `disabled`: disabled. Leave it blank to keep the original configuration. Not required when creating.
79+
* `log_format` - (Optional, List) The output format of log delivery. If it is not filled, it means the default format. The default format logic is as follows: when TaskType is `custom_endpoint`, the default format is an array of multiple JSON objects, each JSON object is a log; when TaskType is `s3`, the default format is JSON Lines; in particular, when TaskType is `cls`, the value of LogFormat.FormatType can only be json, and other parameters in LogFormat will be ignored. It is recommended not to pass LogFormat.
80+
* `s3` - (Optional, List) Configuration information of AWS S3 compatible storage bucket. This parameter is required when TaskType is s3.
81+
82+
The `cls` object supports the following:
83+
84+
* `log_set_id` - (Required, String) Tencent Cloud CLS log set ID.
85+
* `log_set_region` - (Required, String) The region where the Tencent Cloud CLS log set is located.
86+
* `topic_id` - (Required, String) Tencent Cloud CLS log topic ID.
87+
88+
The `conditions` object of `delivery_conditions` supports the following:
89+
90+
* `key` - (Required, String) The key of the filter condition.
91+
* `operator` - (Required, String) Query condition operator, operation types are: `equals`: equal; `notEquals`: not equal; `include`: include; `notInclude`: not include; `startWith`: start with value; `notStartWith`: not start with value; `endWith`: end with value; `notEndWith`: not end with value.
92+
* `value` - (Required, List) The value of the filter condition.
93+
94+
The `custom_endpoint` object supports the following:
95+
96+
* `url` - (Required, String) The custom HTTP interface address for real-time log delivery. Currently, only HTTP/HTTPS protocols are supported.
97+
* `access_id` - (Optional, String) Fill in a custom SecretId to generate an encrypted signature. This parameter is required if the source site requires authentication.
98+
* `access_key` - (Optional, String) Fill in the custom SecretKey to generate the encrypted signature. This parameter is required if the source site requires authentication.
99+
* `compress_type` - (Optional, String) Data compression type, the possible values are: `gzip`: use gzip compression. If it is not filled in, compression is not enabled.
100+
* `headers` - (Optional, List) The custom request header carried when delivering logs. If the header name you fill in is the default header carried by EdgeOne log push, such as Content-Type, then the header value you fill in will overwrite the default value. The header value references a single variable ${batchSize} to obtain the number of logs included in each POST request.
101+
* `protocol` - (Optional, String) When sending logs via POST request, the application layer protocol type used can be: `http`: HTTP protocol; `https`: HTTPS protocol. If not filled in, the protocol type will be parsed according to the filled in URL address.
102+
103+
The `custom_fields` object supports the following:
104+
105+
* `name` - (Required, String) Extract data from the specified location in the HTTP request and response. The values are: `ReqHeader`: extract the specified field value from the HTTP request header; `RspHeader`: extract the specified field value from the HTTP response header; `Cookie`: extract the specified field value from the Cookie.
106+
* `value` - (Required, String) The name of the parameter whose value needs to be extracted, for example: Accept-Language.
107+
* `enabled` - (Optional, Bool) Whether to deliver this field. If left blank, this field will not be delivered.
108+
109+
The `delivery_conditions` object supports the following:
110+
111+
* `conditions` - (Optional, List) Log filtering conditions, the detailed filtering conditions are as follows: - `EdgeResponseStatusCode`: filter according to the status code returned by the EdgeOne node to the client. Supported operators: `equal`, `great`, `less`, `great_equal`, `less_equal`; Value range: any integer greater than or equal to 0; - `OriginResponseStatusCode`: filter according to the origin response status code. Supported operators: `equal`, `great`, `less`, `great_equal`, `less_equal`; Value range: any integer greater than or equal to -1; - `SecurityAction`: filter according to the final disposal action after the request hits the security rule. Supported operators: `equal`; Optional options are as follows: `-`: unknown/miss; `Monitor`: observe; `JSChallenge`: JavaScript challenge; `Deny`: intercept; `Allow`: allow; `BlockIP`: IP ban; `Redirect`: redirect; `ReturnCustomPage`: return to a custom page; `ManagedChallenge`: managed challenge; `Silence`: silent; `LongDelay`: respond after a long wait; `ShortDelay`: respond after a short wait; -`SecurityModule`: filter according to the name of the security module that finally handles the request. Supported operators: `equal`; Optional options: `-`: unknown/missed; `CustomRule`: Web Protection - Custom Rules; `RateLimitingCustomRule`: Web Protection - Rate Limiting Rules; `ManagedRule`: Web Protection - Managed Rules; `L7DDoS`: Web Protection - CC Attack Protection; `BotManagement`: Bot Management - Bot Basic Management; `BotClientReputation`: Bot Management - Client Profile Analysis; `BotBehaviorAnalysis`: Bot Management - Bot Intelligent Analysis; `BotCustomRule`: Bot Management - Custom Bot Rules; `BotActiveDetection`: Bot Management - Active Feature Recognition.
112+
113+
The `headers` object of `custom_endpoint` supports the following:
114+
115+
* `name` - (Required, String) HTTP header name.
116+
* `value` - (Required, String) HTTP header value.
117+
118+
The `log_format` object supports the following:
119+
120+
* `format_type` - (Required, String) The default output format type for log delivery. The possible values are: `json`: Use the default log output format JSON Lines. The fields in a single log are presented as key-value pairs; `csv`: Use the default log output format csv. Only field values are presented in a single log, without field names.
121+
* `batch_prefix` - (Optional, String) A string to be added before each log delivery batch. Each log delivery batch may contain multiple log records.
122+
* `batch_suffix` - (Optional, String) A string to append after each log delivery batch.
123+
* `field_delimiter` - (Optional, String) In a single log record, a string is inserted between fields as a separator. The possible values are: ` `: tab character; `,`: comma; `;`: semicolon.
124+
* `record_delimiter` - (Optional, String) The string inserted between log records as a separator. The possible values are: `
125+
`: newline character; ` `: tab character; `,`: comma.
126+
* `record_prefix` - (Optional, String) A string to prepend to each log record.
127+
* `record_suffix` - (Optional, String) A string to append to each log record.
128+
129+
The `s3` object supports the following:
130+
131+
* `access_id` - (Required, String) The Access Key ID used to access the bucket.
132+
* `access_key` - (Required, String) The secret key used to access the bucket.
133+
* `bucket` - (Required, String) Bucket name and log storage directory, for example: `your_bucket_name/EO-logs/`. If this directory does not exist in the bucket, it will be created automatically.
134+
* `endpoint` - (Required, String) URLs that do not include bucket names or paths, for example: `https://storage.googleapis.com`, `https://s3.ap-northeast-2.amazonaws.com`, `https://cos.ap-nanjing.myqcloud.com`.
135+
* `region` - (Required, String) The region where the bucket is located, for example: ap-northeast-2.
136+
* `compress_type` - (Optional, String) Data compression type, the values are: gzip: gzip compression. If it is not filled in, compression is not enabled.
137+
138+
## Attributes Reference
139+
140+
In addition to all arguments above, the following attributes are exported:
141+
142+
* `id` - ID of the resource.
143+
* `task_id` - Real-time log delivery task ID.
144+
145+
146+
## Import
147+
148+
teo teo_realtime_log_delivery can be imported using the id, e.g.
149+
150+
```
151+
terraform import tencentcloud_teo_realtime_log_delivery.teo_realtime_log_delivery zoneId#taskId
152+
```
153+

website/tencentcloud.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4874,6 +4874,9 @@
48744874
<li>
48754875
<a href="/docs/providers/tencentcloud/r/teo_ownership_verify.html">tencentcloud_teo_ownership_verify</a>
48764876
</li>
4877+
<li>
4878+
<a href="/docs/providers/tencentcloud/r/teo_realtime_log_delivery.html">tencentcloud_teo_realtime_log_delivery</a>
4879+
</li>
48774880
<li>
48784881
<a href="/docs/providers/tencentcloud/r/teo_rule_engine.html">tencentcloud_teo_rule_engine</a>
48794882
</li>

0 commit comments

Comments
 (0)