Provides a CDN Real Time Log Delivery resource.
For information about CDN Real Time Log Delivery and how to use it, see What is Real Time Log Delivery.
Basic Usage
resource "random_integer" "default" {
max = 99999
min = 10000
}
resource "alicloud_cdn_domain_new" "default" {
scope = "overseas"
domain_name = "mycdndomain-${random_integer.default.result}.alicloud-provider.cn"
cdn_type = "web"
sources {
type = "ipaddr"
content = "1.1.3.1"
priority = 20
port = 80
weight = 15
}
}
resource "alicloud_log_project" "default" {
project_name = "terraform-example-${random_integer.default.result}"
description = "terraform-example"
}
resource "alicloud_log_store" "default" {
project_name = alicloud_log_project.default.name
logstore_name = "example-store"
shard_count = 3
auto_split = true
max_split_shard_count = 60
append_meta = true
}
data "alicloud_regions" "default" {
current = true
}
resource "alicloud_cdn_real_time_log_delivery" "default" {
domain = alicloud_cdn_domain_new.default.domain_name
logstore = alicloud_log_store.default.logstore_name
project = alicloud_log_project.default.project_name
sls_region = data.alicloud_regions.default.regions.0.id
}
The following arguments are supported:
domain
- (Required, ForceNew) The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).logstore
- (Required, ForceNew) The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.project
- (Required, ForceNew) The name of the Log Service project that is used for real-time log delivery.sls_region
- (Required, ForceNew) The region where the Log Service project is deployed.The following attributes are exported:
id
- The resource ID in terraform of Real Time Log Delivery. Its value is same as domain
.status
- The status of the real-time log delivery feature. Valid Values: online
and offline
.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 2 mins) Used when create the Real Time Log Delivery.CDN Real Time Log Delivery can be imported using the id, e.g.
$ terraform import alicloud_cdn_real_time_log_delivery.example <domain>