All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.alicloud.log.kotlin.MachineGroupArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 3.62.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.alicloud.log.kotlin

import com.pulumi.alicloud.log.MachineGroupArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * 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](https://www.alibabacloud.com/help/doc-detail/28966.htm)
 * ## Example Usage
 * Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as alicloud from "@pulumi/alicloud";
 * import * as random from "@pulumi/random";
 * const _default = new random.index.Integer("default", {
 *     max: 99999,
 *     min: 10000,
 * });
 * const example = new alicloud.log.Project("example", {
 *     projectName: `terraform-example-${_default.result}`,
 *     description: "terraform-example",
 * });
 * const exampleMachineGroup = new alicloud.log.MachineGroup("example", {
 *     project: example.projectName,
 *     name: "terraform-example",
 *     identifyType: "ip",
 *     topic: "terraform",
 *     identifyLists: [
 *         "10.0.0.1",
 *         "10.0.0.2",
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_alicloud as alicloud
 * import pulumi_random as random
 * default = random.index.Integer("default",
 *     max=99999,
 *     min=10000)
 * example = alicloud.log.Project("example",
 *     project_name=f"terraform-example-{default['result']}",
 *     description="terraform-example")
 * example_machine_group = alicloud.log.MachineGroup("example",
 *     project=example.project_name,
 *     name="terraform-example",
 *     identify_type="ip",
 *     topic="terraform",
 *     identify_lists=[
 *         "10.0.0.1",
 *         "10.0.0.2",
 *     ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AliCloud = Pulumi.AliCloud;
 * using Random = Pulumi.Random;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Random.Index.Integer("default", new()
 *     {
 *         Max = 99999,
 *         Min = 10000,
 *     });
 *     var example = new AliCloud.Log.Project("example", new()
 *     {
 *         ProjectName = $"terraform-example-{@default.Result}",
 *         Description = "terraform-example",
 *     });
 *     var exampleMachineGroup = new AliCloud.Log.MachineGroup("example", new()
 *     {
 *         Project = example.ProjectName,
 *         Name = "terraform-example",
 *         IdentifyType = "ip",
 *         Topic = "terraform",
 *         IdentifyLists = new[]
 *         {
 *             "10.0.0.1",
 *             "10.0.0.2",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
 * 	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
 * 			Max: 99999,
 * 			Min: 10000,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		example, err := log.NewProject(ctx, "example", &log.ProjectArgs{
 * 			ProjectName: pulumi.Sprintf("terraform-example-%v", _default.Result),
 * 			Description: pulumi.String("terraform-example"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = log.NewMachineGroup(ctx, "example", &log.MachineGroupArgs{
 * 			Project:      example.ProjectName,
 * 			Name:         pulumi.String("terraform-example"),
 * 			IdentifyType: pulumi.String("ip"),
 * 			Topic:        pulumi.String("terraform"),
 * 			IdentifyLists: pulumi.StringArray{
 * 				pulumi.String("10.0.0.1"),
 * 				pulumi.String("10.0.0.2"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.random.integer;
 * import com.pulumi.random.IntegerArgs;
 * import com.pulumi.alicloud.log.Project;
 * import com.pulumi.alicloud.log.ProjectArgs;
 * import com.pulumi.alicloud.log.MachineGroup;
 * import com.pulumi.alicloud.log.MachineGroupArgs;
 * 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 Integer("default", IntegerArgs.builder()
 *             .max(99999)
 *             .min(10000)
 *             .build());
 *         var example = new Project("example", ProjectArgs.builder()
 *             .projectName(String.format("terraform-example-%s", default_.result()))
 *             .description("terraform-example")
 *             .build());
 *         var exampleMachineGroup = new MachineGroup("exampleMachineGroup", MachineGroupArgs.builder()
 *             .project(example.projectName())
 *             .name("terraform-example")
 *             .identifyType("ip")
 *             .topic("terraform")
 *             .identifyLists(
 *                 "10.0.0.1",
 *                 "10.0.0.2")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: random:integer
 *     properties:
 *       max: 99999
 *       min: 10000
 *   example:
 *     type: alicloud:log:Project
 *     properties:
 *       projectName: terraform-example-${default.result}
 *       description: terraform-example
 *   exampleMachineGroup:
 *     type: alicloud:log:MachineGroup
 *     name: example
 *     properties:
 *       project: ${example.projectName}
 *       name: terraform-example
 *       identifyType: ip
 *       topic: terraform
 *       identifyLists:
 *         - 10.0.0.1
 *         - 10.0.0.2
 * ```
 * 
 * ## Module Support
 * 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.
 * ## Import
 * Log machine group can be imported using the id, e.g.
 * ```sh
 * $ pulumi import alicloud:log/machineGroup:MachineGroup example tf-log:tf-machine-group
 * ```
 * @property identifyLists The specific machine identification, which can be an IP address or user-defined identity.
 * @property identifyType The machine identification type, including IP and user-defined identity. Valid values are "ip" and "userdefined". Default to "ip".
 * @property name The machine group name, which is unique in the same project.
 * @property project The project name to the machine group belongs.
 * @property topic The topic of a machine group.
 */
public data class MachineGroupArgs(
    public val identifyLists: Output>? = null,
    public val identifyType: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val topic: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.alicloud.log.MachineGroupArgs =
        com.pulumi.alicloud.log.MachineGroupArgs.builder()
            .identifyLists(identifyLists?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .identifyType(identifyType?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .topic(topic?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [MachineGroupArgs].
 */
@PulumiTagMarker
public class MachineGroupArgsBuilder internal constructor() {
    private var identifyLists: Output>? = null

    private var identifyType: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var topic: Output? = null

    /**
     * @param value The specific machine identification, which can be an IP address or user-defined identity.
     */
    @JvmName("dwgaruhjdimypxpw")
    public suspend fun identifyLists(`value`: Output>) {
        this.identifyLists = value
    }

    @JvmName("vypshetotrmtrmbh")
    public suspend fun identifyLists(vararg values: Output) {
        this.identifyLists = Output.all(values.asList())
    }

    /**
     * @param values The specific machine identification, which can be an IP address or user-defined identity.
     */
    @JvmName("trwnuklmnwtrsrjo")
    public suspend fun identifyLists(values: List>) {
        this.identifyLists = Output.all(values)
    }

    /**
     * @param value The machine identification type, including IP and user-defined identity. Valid values are "ip" and "userdefined". Default to "ip".
     */
    @JvmName("mrgqnvfebwsqapml")
    public suspend fun identifyType(`value`: Output) {
        this.identifyType = value
    }

    /**
     * @param value The machine group name, which is unique in the same project.
     */
    @JvmName("rfnjfwohylfsnyqi")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The project name to the machine group belongs.
     */
    @JvmName("rpleuucryhcxelax")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The topic of a machine group.
     */
    @JvmName("sccslxnyatqypmvk")
    public suspend fun topic(`value`: Output) {
        this.topic = value
    }

    /**
     * @param value The specific machine identification, which can be an IP address or user-defined identity.
     */
    @JvmName("otgpjksjwhibancp")
    public suspend fun identifyLists(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identifyLists = mapped
    }

    /**
     * @param values The specific machine identification, which can be an IP address or user-defined identity.
     */
    @JvmName("kysxrukbbdxktlph")
    public suspend fun identifyLists(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.identifyLists = mapped
    }

    /**
     * @param value The machine identification type, including IP and user-defined identity. Valid values are "ip" and "userdefined". Default to "ip".
     */
    @JvmName("begkujfwwmafkkhf")
    public suspend fun identifyType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identifyType = mapped
    }

    /**
     * @param value The machine group name, which is unique in the same project.
     */
    @JvmName("ieemlkmseknoqpgw")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The project name to the machine group belongs.
     */
    @JvmName("bqnwxsawvarcuywh")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The topic of a machine group.
     */
    @JvmName("jnrphmyljuwsbmel")
    public suspend fun topic(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.topic = mapped
    }

    internal fun build(): MachineGroupArgs = MachineGroupArgs(
        identifyLists = identifyLists,
        identifyType = identifyType,
        name = name,
        project = project,
        topic = topic,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy