Log Service manages all the ECS instances whose logs need to be collected by using the Logtail client in the form of machine groups. Refer to details
Basic Usage
resource "random_integer" "default" {
max = 99999
min = 10000
}
resource "alicloud_log_project" "example" {
name = "terraform-example-${random_integer.default.result}"
description = "terraform-example"
}
resource "alicloud_log_machine_group" "example" {
project = alicloud_log_project.example.name
name = "terraform-example"
identify_type = "ip"
topic = "terraform"
identify_list = ["10.0.0.1", "10.0.0.2"]
}
You can use the existing sls-logtail module to create logtail config, machine group, install logtail on ECS instances and join instances into machine group one-click.
The following arguments are supported:
project
- (Required, ForceNew) The project name to the machine group belongs.name
- (Required, ForceNew) The machine group name, which is unique in the same project.identify_type
- (Optional) The machine identification type, including IP and user-defined identity. Valid values are "ip" and "userdefined". Default to "ip".identify_list
- (Required) The specific machine identification, which can be an IP address or user-defined identity.topic
- (Optional) The topic of a machine group.The following attributes are exported:
id
- The ID of the log machine group. It formats of <project>:<name>
.project
- The project name.name
- The machine group name.identify_type
- The machine identification type.identify_list
- The machine identification.topic
- The machine group topic.Log machine group can be imported using the id, e.g.
$ terraform import alicloud_log_machine_group.example tf-log:tf-machine-group