alicloud_sls_etl
更新时间:
Provides a Log Service (SLS) Etl resource.
For information about Log Service (SLS) Etl and how to use it, see What is Etl.
-> NOTE: Available since v1.248.0.
Example Usage
Basic Usage
variable "name" {
default = "terraform-example"
}
provider "alicloud" {
region = "cn-hangzhou"
}
resource "alicloud_log_project" "defaulthhAPo6" {
description = "terraform-etl-example-813"
project_name = "terraform-etl-example-330"
}
resource "alicloud_log_store" "defaultzWKLkp" {
hot_ttl = "8"
retention_period = "30"
shard_count = "2"
project_name = alicloud_log_project.defaulthhAPo6.id
logstore_name = "example"
}
resource "alicloud_sls_etl" "default" {
project = alicloud_log_project.defaulthhAPo6.id
description = "etl-1740472705-185721"
configuration {
script = "* | extend a=1"
lang = "SPL"
role_arn = var.name
sink {
name = "11111"
endpoint = "cn-hangzhou-intranet.log.aliyuncs.com"
project = "gy-hangzhou-huolang-1"
logstore = "gy-rm2"
datasets = ["__UNNAMED__"]
role_arn = var.name
}
logstore = alicloud_log_store.defaultzWKLkp.logstore_name
from_time = "1706771697"
to_time = "1738394097"
}
job_name = "etl-1740472705-185721"
display_name = "etl-1740472705-185721"
}
Argument Reference
The following arguments are supported:
configuration
- (Required, Set) The ETL configuration. Seeconfiguration
below.description
- (Optional) Data Processing Task Description.display_name
- (Required) Data processing task display name.job_name
- (Required, ForceNew) Unique identification of data processing task.project
- (Required, ForceNew) Project Name.
configuration
The configuration supports the following:
from_time
- (Required, ForceNew, Int) The beginning of the time range for transformation.lang
- (Required) Data processing syntax type.logstore
- (Required, ForceNew) Source Logstore Name.parameters
- (Optional, Map) Advanced parameter configuration.role_arn
- (Required) The ARN role that authorizes reading of the source Logstore.script
- (Required) Processing script.sink
- (Required, Set) Processing result output target list Seesink
below.to_time
- (Required, ForceNew, Int) The end of the time range for transformation.
configuration-sink
The configuration-sink supports the following:
datasets
- (Required, List) Write Result Set.endpoint
- (Required) The endpoint of the region where the target Project is located.logstore
- (Required) Destination Logstore Name.name
- (Required, ForceNew) Output Destination Name.project
- (Required) Target Project name.role_arn
- (Required) The ARN role that authorizes writing to the target Logstore.
Attributes Reference
The following attributes are exported:
id
- The ID of the resource supplied above.The value is formulated as<project>:<job_name>
.create_time
- The time when the data transformation job was created.status
- The status of the data transformation job.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 5 mins) Used when create the Etl.delete
- (Defaults to 5 mins) Used when delete the Etl.update
- (Defaults to 5 mins) Used when update the Etl.
Import
Log Service (SLS) Etl can be imported using the id, e.g.
$ terraform import alicloud_sls_etl.example <project>:<job_name>
该文章对您有帮助吗?