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

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

package com.pulumi.awsnative.iot.kotlin

import com.pulumi.awsnative.iot.kotlin.enums.ResourceSpecificLoggingLogLevel
import com.pulumi.awsnative.iot.kotlin.enums.ResourceSpecificLoggingTargetType
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.awsnative.iot.kotlin.enums.ResourceSpecificLoggingLogLevel.Companion.toKotlin as resourceSpecificLoggingLogLevelToKotlin
import com.pulumi.awsnative.iot.kotlin.enums.ResourceSpecificLoggingTargetType.Companion.toKotlin as resourceSpecificLoggingTargetTypeToKotlin

/**
 * Builder for [ResourceSpecificLogging].
 */
@PulumiTagMarker
public class ResourceSpecificLoggingResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ResourceSpecificLoggingArgs = ResourceSpecificLoggingArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend ResourceSpecificLoggingArgsBuilder.() -> Unit) {
        val builder = ResourceSpecificLoggingArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): ResourceSpecificLogging {
        val builtJavaResource =
            com.pulumi.awsnative.iot.ResourceSpecificLogging(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return ResourceSpecificLogging(builtJavaResource)
    }
}

/**
 * Resource-specific logging allows you to specify a logging level for a specific thing group.
 */
public class ResourceSpecificLogging internal constructor(
    override val javaResource: com.pulumi.awsnative.iot.ResourceSpecificLogging,
) : KotlinCustomResource(javaResource, ResourceSpecificLoggingMapper) {
    /**
     * The log level for a specific target. Valid values are: ERROR, WARN, INFO, DEBUG, or DISABLED.
     */
    public val logLevel: Output
        get() = javaResource.logLevel().applyValue({ args0 ->
            args0.let({ args0 ->
                resourceSpecificLoggingLogLevelToKotlin(args0)
            })
        })

    /**
     * Unique Id for a Target (TargetType:TargetName), this will be internally built to serve as primary identifier for a log target.
     */
    public val targetId: Output
        get() = javaResource.targetId().applyValue({ args0 -> args0 })

    /**
     * The target name.
     */
    public val targetName: Output
        get() = javaResource.targetName().applyValue({ args0 -> args0 })

    /**
     * The target type. Value must be THING_GROUP, CLIENT_ID, SOURCE_IP, PRINCIPAL_ID, or EVENT_TYPE.
     */
    public val targetType: Output
        get() = javaResource.targetType().applyValue({ args0 ->
            args0.let({ args0 ->
                resourceSpecificLoggingTargetTypeToKotlin(args0)
            })
        })
}

public object ResourceSpecificLoggingMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.iot.ResourceSpecificLogging::class == javaResource::class

    override fun map(javaResource: Resource): ResourceSpecificLogging =
        ResourceSpecificLogging(javaResource as com.pulumi.awsnative.iot.ResourceSpecificLogging)
}

/**
 * @see [ResourceSpecificLogging].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [ResourceSpecificLogging].
 */
public suspend fun resourceSpecificLogging(
    name: String,
    block: suspend ResourceSpecificLoggingResourceBuilder.() -> Unit,
): ResourceSpecificLogging {
    val builder = ResourceSpecificLoggingResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [ResourceSpecificLogging].
 * @param name The _unique_ name of the resulting resource.
 */
public fun resourceSpecificLogging(name: String): ResourceSpecificLogging {
    val builder = ResourceSpecificLoggingResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy