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

com.pulumi.awsnative.ecs.kotlin.inputs.ServiceLogConfigurationArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.ecs.kotlin.inputs

import com.pulumi.awsnative.ecs.inputs.ServiceLogConfigurationArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * The log configuration for the container. This parameter maps to ``LogConfig`` in the docker container create command and the ``--log-driver`` option to docker run.
 *  By default, containers use the same logging driver that the Docker daemon uses. However, the container might use a different logging driver than the Docker daemon by specifying a log driver configuration in the container definition.
 *  Understand the following when specifying a log configuration for your containers.
 *   +  Amazon ECS currently supports a subset of the logging drivers available to the Docker daemon. Additional log drivers may be available in future releases of the Amazon ECS container agent.
 *  For tasks on FARGATElong, the supported log drivers are ``awslogs``, ``splunk``, and ``awsfirelens``.
 *  For tasks hosted on Amazon EC2 instances, the supported log drivers are ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``,``syslog``, ``splunk``, and ``awsfirelens``.
 *   +  This parameter requires version 1.18 of the Docker Remote API or greater on your container instance.
 *   +  For tasks that are hosted on Amazon EC2 instances, the Amazon ECS container agent must register the available logging drivers with the ``ECS_AVAILABLE_LOGGING_DRIVERS`` environment variable before containers placed on that instance can use these log configuration options. For more information, see [Amazon ECS container agent configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) in the *Amazon Elastic Container Service Developer Guide*.
 *   +  For tasks that are on FARGATElong, because you don't have access to the underlying infrastructure your tasks are hosted on, any additional software needed must be installed outside of the task. For example, the Fluentd output aggregators or a remote host running Logstash to send Gelf logs to.
 * @property logDriver The log driver to use for the container.
 *  For tasks on FARGATElong, the supported log drivers are ``awslogs``, ``splunk``, and ``awsfirelens``.
 *  For tasks hosted on Amazon EC2 instances, the supported log drivers are ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``, ``syslog``, ``splunk``, and ``awsfirelens``.
 *  For more information about using the ``awslogs`` log driver, see [Send Amazon ECS logs to CloudWatch](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) in the *Amazon Elastic Container Service Developer Guide*.
 *  For more information about using the ``awsfirelens`` log driver, see [Send Amazon ECS logs to an service or Partner](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html).
 *   If you have a custom driver that isn't listed, you can fork the Amazon ECS container agent project that's [available on GitHub](https://docs.aws.amazon.com/https://github.com/aws/amazon-ecs-agent) and customize it to work with that driver. We encourage you to submit pull requests for changes that you would like to have included. However, we don't currently provide support for running modified copies of this software.
 * @property options The configuration options to send to the log driver. This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: ``sudo docker version --format '{{.Server.APIVersion}}'``
 * @property secretOptions The secrets to pass to the log configuration. For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide*.
 */
public data class ServiceLogConfigurationArgs(
    public val logDriver: Output? = null,
    public val options: Output>? = null,
    public val secretOptions: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ecs.inputs.ServiceLogConfigurationArgs =
        com.pulumi.awsnative.ecs.inputs.ServiceLogConfigurationArgs.builder()
            .logDriver(logDriver?.applyValue({ args0 -> args0 }))
            .options(options?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .secretOptions(
                secretOptions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [ServiceLogConfigurationArgs].
 */
@PulumiTagMarker
public class ServiceLogConfigurationArgsBuilder internal constructor() {
    private var logDriver: Output? = null

    private var options: Output>? = null

    private var secretOptions: Output>? = null

    /**
     * @param value The log driver to use for the container.
     *  For tasks on FARGATElong, the supported log drivers are ``awslogs``, ``splunk``, and ``awsfirelens``.
     *  For tasks hosted on Amazon EC2 instances, the supported log drivers are ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``, ``syslog``, ``splunk``, and ``awsfirelens``.
     *  For more information about using the ``awslogs`` log driver, see [Send Amazon ECS logs to CloudWatch](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) in the *Amazon Elastic Container Service Developer Guide*.
     *  For more information about using the ``awsfirelens`` log driver, see [Send Amazon ECS logs to an service or Partner](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html).
     *   If you have a custom driver that isn't listed, you can fork the Amazon ECS container agent project that's [available on GitHub](https://docs.aws.amazon.com/https://github.com/aws/amazon-ecs-agent) and customize it to work with that driver. We encourage you to submit pull requests for changes that you would like to have included. However, we don't currently provide support for running modified copies of this software.
     */
    @JvmName("mpfvcmlfybffylru")
    public suspend fun logDriver(`value`: Output) {
        this.logDriver = value
    }

    /**
     * @param value The configuration options to send to the log driver. This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: ``sudo docker version --format '{{.Server.APIVersion}}'``
     */
    @JvmName("guavxpnkfdfpnvkb")
    public suspend fun options(`value`: Output>) {
        this.options = value
    }

    /**
     * @param value The secrets to pass to the log configuration. For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide*.
     */
    @JvmName("dgubwvvcveufecqv")
    public suspend fun secretOptions(`value`: Output>) {
        this.secretOptions = value
    }

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

    /**
     * @param values The secrets to pass to the log configuration. For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide*.
     */
    @JvmName("tgtueemgiehhwlor")
    public suspend fun secretOptions(values: List>) {
        this.secretOptions = Output.all(values)
    }

    /**
     * @param value The log driver to use for the container.
     *  For tasks on FARGATElong, the supported log drivers are ``awslogs``, ``splunk``, and ``awsfirelens``.
     *  For tasks hosted on Amazon EC2 instances, the supported log drivers are ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``, ``syslog``, ``splunk``, and ``awsfirelens``.
     *  For more information about using the ``awslogs`` log driver, see [Send Amazon ECS logs to CloudWatch](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) in the *Amazon Elastic Container Service Developer Guide*.
     *  For more information about using the ``awsfirelens`` log driver, see [Send Amazon ECS logs to an service or Partner](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html).
     *   If you have a custom driver that isn't listed, you can fork the Amazon ECS container agent project that's [available on GitHub](https://docs.aws.amazon.com/https://github.com/aws/amazon-ecs-agent) and customize it to work with that driver. We encourage you to submit pull requests for changes that you would like to have included. However, we don't currently provide support for running modified copies of this software.
     */
    @JvmName("gjnwmeavxtsewaty")
    public suspend fun logDriver(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logDriver = mapped
    }

    /**
     * @param value The configuration options to send to the log driver. This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: ``sudo docker version --format '{{.Server.APIVersion}}'``
     */
    @JvmName("utkxnutgmmsejkap")
    public suspend fun options(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.options = mapped
    }

    /**
     * @param values The configuration options to send to the log driver. This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: ``sudo docker version --format '{{.Server.APIVersion}}'``
     */
    @JvmName("bkdcaonbvyhdrtuo")
    public fun options(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.options = mapped
    }

    /**
     * @param value The secrets to pass to the log configuration. For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide*.
     */
    @JvmName("oivwrlyrwprbsiqv")
    public suspend fun secretOptions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secretOptions = mapped
    }

    /**
     * @param argument The secrets to pass to the log configuration. For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide*.
     */
    @JvmName("doetqqirdwfvqgtd")
    public suspend fun secretOptions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ServiceSecretArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.secretOptions = mapped
    }

    /**
     * @param argument The secrets to pass to the log configuration. For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide*.
     */
    @JvmName("ewcyfnygvvhunycm")
    public suspend fun secretOptions(vararg argument: suspend ServiceSecretArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ServiceSecretArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.secretOptions = mapped
    }

    /**
     * @param argument The secrets to pass to the log configuration. For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide*.
     */
    @JvmName("pmggppvkgfntvrep")
    public suspend fun secretOptions(argument: suspend ServiceSecretArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ServiceSecretArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.secretOptions = mapped
    }

    /**
     * @param values The secrets to pass to the log configuration. For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon Elastic Container Service Developer Guide*.
     */
    @JvmName("kqhjejetubcyunir")
    public suspend fun secretOptions(vararg values: ServiceSecretArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.secretOptions = mapped
    }

    internal fun build(): ServiceLogConfigurationArgs = ServiceLogConfigurationArgs(
        logDriver = logDriver,
        options = options,
        secretOptions = secretOptions,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy