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

com.pulumi.awsnative.logs.kotlin.LogGroupArgs.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: 1.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.logs.kotlin

import com.pulumi.awsnative.kotlin.inputs.TagArgs
import com.pulumi.awsnative.kotlin.inputs.TagArgsBuilder
import com.pulumi.awsnative.logs.LogGroupArgs.builder
import com.pulumi.awsnative.logs.kotlin.enums.LogGroupClass
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.Any
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The ``AWS::Logs::LogGroup`` resource specifies a log group. A log group defines common properties for log streams, such as their retention and access control rules. Each log stream must belong to one log group.
 *  You can create up to 1,000,000 log groups per Region per account. You must use the following guidelines when naming a log group:
 *   +  Log group names must be unique within a Region for an AWS account.
 *   +  Log group names can be between 1 and 512 characters long.
 *   +  Log group names consist of the following characters: a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period).
 * @property dataProtectionPolicy Creates a data protection policy and assigns it to the log group. A data protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the sensitive log data. When a user who does not have permission to view masked data views a log event that includes masked data, the sensitive data is replaced by asterisks.
 *  For more information, including a list of types of data that can be audited and masked, see [Protect sensitive log data with masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html).
 * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Logs::LogGroup` for more information about the expected schema for this property.
 * @property kmsKeyId The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data.
 *  To associate an KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still within CWL. This enables CWL to decrypt this data whenever it is requested.
 *  If you attempt to associate a KMS key with the log group but the KMS key doesn't exist or is deactivated, you will receive an ``InvalidParameterException`` error.
 *  Log group data is always encrypted in CWL. If you omit this key, the encryption does not use KMS. For more information, see [Encrypt log data in using](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html)
 * @property logGroupClass Specifies the log group class for this log group. There are two classes:
 *   +  The ``Standard`` log class supports all CWL features.
 *   +  The ``Infrequent Access`` log class supports a subset of CWL features and incurs lower costs.
 *  For details about the features supported by each class, see [Log classes](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html)
 * @property logGroupName The name of the log group. If you don't specify a name, CFNlong generates a unique ID for the log group.
 * @property retentionInDays The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.
 *  To set a log group so that its log events do not expire, use [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html).
 * @property tags An array of key-value pairs to apply to the log group.
 *  For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
 */
public data class LogGroupArgs(
    public val dataProtectionPolicy: Output? = null,
    public val kmsKeyId: Output? = null,
    public val logGroupClass: Output? = null,
    public val logGroupName: Output? = null,
    public val retentionInDays: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.logs.LogGroupArgs =
        com.pulumi.awsnative.logs.LogGroupArgs.builder()
            .dataProtectionPolicy(dataProtectionPolicy?.applyValue({ args0 -> args0 }))
            .kmsKeyId(kmsKeyId?.applyValue({ args0 -> args0 }))
            .logGroupClass(logGroupClass?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .logGroupName(logGroupName?.applyValue({ args0 -> args0 }))
            .retentionInDays(retentionInDays?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [LogGroupArgs].
 */
@PulumiTagMarker
public class LogGroupArgsBuilder internal constructor() {
    private var dataProtectionPolicy: Output? = null

    private var kmsKeyId: Output? = null

    private var logGroupClass: Output? = null

    private var logGroupName: Output? = null

    private var retentionInDays: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Creates a data protection policy and assigns it to the log group. A data protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the sensitive log data. When a user who does not have permission to view masked data views a log event that includes masked data, the sensitive data is replaced by asterisks.
     *  For more information, including a list of types of data that can be audited and masked, see [Protect sensitive log data with masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html).
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Logs::LogGroup` for more information about the expected schema for this property.
     */
    @JvmName("viyhcnrokfcfsekk")
    public suspend fun dataProtectionPolicy(`value`: Output) {
        this.dataProtectionPolicy = value
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data.
     *  To associate an KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still within CWL. This enables CWL to decrypt this data whenever it is requested.
     *  If you attempt to associate a KMS key with the log group but the KMS key doesn't exist or is deactivated, you will receive an ``InvalidParameterException`` error.
     *  Log group data is always encrypted in CWL. If you omit this key, the encryption does not use KMS. For more information, see [Encrypt log data in using](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html)
     */
    @JvmName("cssubooecerdkxec")
    public suspend fun kmsKeyId(`value`: Output) {
        this.kmsKeyId = value
    }

    /**
     * @param value Specifies the log group class for this log group. There are two classes:
     *   +  The ``Standard`` log class supports all CWL features.
     *   +  The ``Infrequent Access`` log class supports a subset of CWL features and incurs lower costs.
     *  For details about the features supported by each class, see [Log classes](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html)
     */
    @JvmName("vcjefxvfufycbuqn")
    public suspend fun logGroupClass(`value`: Output) {
        this.logGroupClass = value
    }

    /**
     * @param value The name of the log group. If you don't specify a name, CFNlong generates a unique ID for the log group.
     */
    @JvmName("iputdsbbhejomqkj")
    public suspend fun logGroupName(`value`: Output) {
        this.logGroupName = value
    }

    /**
     * @param value The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.
     *  To set a log group so that its log events do not expire, use [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html).
     */
    @JvmName("sibplvqecmehmeud")
    public suspend fun retentionInDays(`value`: Output) {
        this.retentionInDays = value
    }

    /**
     * @param value An array of key-value pairs to apply to the log group.
     *  For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
     */
    @JvmName("dgpoxvrhkjkmorjr")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

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

    /**
     * @param values An array of key-value pairs to apply to the log group.
     *  For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
     */
    @JvmName("yhklrpvyjlvrunku")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value Creates a data protection policy and assigns it to the log group. A data protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the sensitive log data. When a user who does not have permission to view masked data views a log event that includes masked data, the sensitive data is replaced by asterisks.
     *  For more information, including a list of types of data that can be audited and masked, see [Protect sensitive log data with masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html).
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Logs::LogGroup` for more information about the expected schema for this property.
     */
    @JvmName("tgvgllkjgbefevss")
    public suspend fun dataProtectionPolicy(`value`: Any?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dataProtectionPolicy = mapped
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data.
     *  To associate an KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still within CWL. This enables CWL to decrypt this data whenever it is requested.
     *  If you attempt to associate a KMS key with the log group but the KMS key doesn't exist or is deactivated, you will receive an ``InvalidParameterException`` error.
     *  Log group data is always encrypted in CWL. If you omit this key, the encryption does not use KMS. For more information, see [Encrypt log data in using](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html)
     */
    @JvmName("aofepxgmycxivbww")
    public suspend fun kmsKeyId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.kmsKeyId = mapped
    }

    /**
     * @param value Specifies the log group class for this log group. There are two classes:
     *   +  The ``Standard`` log class supports all CWL features.
     *   +  The ``Infrequent Access`` log class supports a subset of CWL features and incurs lower costs.
     *  For details about the features supported by each class, see [Log classes](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html)
     */
    @JvmName("oovhyxeocmcsluhr")
    public suspend fun logGroupClass(`value`: LogGroupClass?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logGroupClass = mapped
    }

    /**
     * @param value The name of the log group. If you don't specify a name, CFNlong generates a unique ID for the log group.
     */
    @JvmName("vlgqlppdnstlvlpn")
    public suspend fun logGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logGroupName = mapped
    }

    /**
     * @param value The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.
     *  To set a log group so that its log events do not expire, use [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html).
     */
    @JvmName("rxlqiktminhjqvkn")
    public suspend fun retentionInDays(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retentionInDays = mapped
    }

    /**
     * @param value An array of key-value pairs to apply to the log group.
     *  For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
     */
    @JvmName("ejpfngrboktawfrf")
    public suspend fun tags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param argument An array of key-value pairs to apply to the log group.
     *  For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
     */
    @JvmName("xokvgrkujvndqobc")
    public suspend fun tags(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument An array of key-value pairs to apply to the log group.
     *  For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
     */
    @JvmName("xpriltivcusieesh")
    public suspend fun tags(vararg argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument An array of key-value pairs to apply to the log group.
     *  For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
     */
    @JvmName("vsupcmpsshbtlwiy")
    public suspend fun tags(argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TagArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param values An array of key-value pairs to apply to the log group.
     *  For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
     */
    @JvmName("onyfonwgfgrvtrwj")
    public suspend fun tags(vararg values: TagArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): LogGroupArgs = LogGroupArgs(
        dataProtectionPolicy = dataProtectionPolicy,
        kmsKeyId = kmsKeyId,
        logGroupClass = logGroupClass,
        logGroupName = logGroupName,
        retentionInDays = retentionInDays,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy