LogTailAttachmentArgs

data class LogTailAttachmentArgs(val logtailConfigName: Output<String>? = null, val machineGroupName: Output<String>? = null, val project: Output<String>? = null) : ConvertibleToJava<LogTailAttachmentArgs>

The Logtail access service is a log collection agent provided by Log Service. You can use Logtail to collect logs from servers such as Alibaba Cloud Elastic Compute Service (ECS) instances in real time in the Log Service console. Refer to details This resource amis to attach one logtail configure to a machine group.

NOTE: One logtail configure can be attached to multiple machine groups and one machine group can attach several logtail configures.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomInteger;
import com.pulumi.random.RandomIntegerArgs;
import com.pulumi.alicloud.log.Project;
import com.pulumi.alicloud.log.ProjectArgs;
import com.pulumi.alicloud.log.Store;
import com.pulumi.alicloud.log.StoreArgs;
import com.pulumi.alicloud.log.LogTailConfig;
import com.pulumi.alicloud.log.LogTailConfigArgs;
import com.pulumi.alicloud.log.MachineGroup;
import com.pulumi.alicloud.log.MachineGroupArgs;
import com.pulumi.alicloud.log.LogTailAttachment;
import com.pulumi.alicloud.log.LogTailAttachmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new RandomInteger("default", RandomIntegerArgs.builder()
.max(99999)
.min(10000)
.build());
var exampleProject = new Project("exampleProject", ProjectArgs.builder()
.description("terraform-example")
.build());
var exampleStore = new Store("exampleStore", StoreArgs.builder()
.project(exampleProject.name())
.retentionPeriod(3650)
.shardCount(3)
.autoSplit(true)
.maxSplitShardCount(60)
.appendMeta(true)
.build());
var exampleLogTailConfig = new LogTailConfig("exampleLogTailConfig", LogTailConfigArgs.builder()
.project(exampleProject.name())
.logstore(exampleStore.name())
.inputType("file")
.outputType("LogService")
.inputDetail("""
{
"logPath": "/logPath",
"filePattern": "access.log",
"logType": "json_log",
"topicFormat": "default",
"discardUnmatch": false,
"enableRawLog": true,
"fileEncoding": "gbk",
"maxDepth": 10
}
""")
.build());
var exampleMachineGroup = new MachineGroup("exampleMachineGroup", MachineGroupArgs.builder()
.project(exampleProject.name())
.identifyType("ip")
.topic("terraform")
.identifyLists(
"10.0.0.1",
"10.0.0.2")
.build());
var exampleLogTailAttachment = new LogTailAttachment("exampleLogTailAttachment", LogTailAttachmentArgs.builder()
.project(exampleProject.name())
.logtailConfigName(exampleLogTailConfig.name())
.machineGroupName(exampleMachineGroup.name())
.build());
}
}

Import

Logtial to machine group can be imported using the id, e.g.

$ pulumi import alicloud:log/logTailAttachment:LogTailAttachment example tf-log:tf-log-config:tf-log-machine-group

Constructors

Link copied to clipboard
fun LogTailAttachmentArgs(logtailConfigName: Output<String>? = null, machineGroupName: Output<String>? = null, project: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): LogTailAttachmentArgs

Properties

Link copied to clipboard
val logtailConfigName: Output<String>? = null

The Logtail configuration name, which is unique in the same project.

Link copied to clipboard
val machineGroupName: Output<String>? = null

The machine group name, which is unique in the same project.

Link copied to clipboard
val project: Output<String>? = null

The project name to the log store belongs.