com.pulumi.awsnative.iot.kotlin.Logging.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.iot.kotlin
import com.pulumi.awsnative.iot.kotlin.enums.LoggingDefaultLogLevel
import com.pulumi.awsnative.iot.kotlin.enums.LoggingDefaultLogLevel.Companion.toKotlin
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
/**
* Builder for [Logging].
*/
@PulumiTagMarker
public class LoggingResourceBuilder internal constructor() {
public var name: String? = null
public var args: LoggingArgs = LoggingArgs()
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 LoggingArgsBuilder.() -> Unit) {
val builder = LoggingArgsBuilder()
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(): Logging {
val builtJavaResource = com.pulumi.awsnative.iot.Logging(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Logging(builtJavaResource)
}
}
/**
* Logging Options enable you to configure your IoT V2 logging role and default logging level so that you can monitor progress events logs as it passes from your devices through Iot core service.
*/
public class Logging internal constructor(
override val javaResource: com.pulumi.awsnative.iot.Logging,
) : KotlinCustomResource(javaResource, LoggingMapper) {
/**
* Your 12-digit account ID (used as the primary identifier for the CloudFormation resource).
*/
public val accountId: Output
get() = javaResource.accountId().applyValue({ args0 -> args0 })
/**
* The log level to use. Valid values are: ERROR, WARN, INFO, DEBUG, or DISABLED.
*/
public val defaultLogLevel: Output
get() = javaResource.defaultLogLevel().applyValue({ args0 ->
args0.let({ args0 ->
toKotlin(args0)
})
})
/**
* The ARN of the role that allows IoT to write to Cloudwatch logs.
*/
public val roleArn: Output
get() = javaResource.roleArn().applyValue({ args0 -> args0 })
}
public object LoggingMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.iot.Logging::class == javaResource::class
override fun map(javaResource: Resource): Logging = Logging(
javaResource as
com.pulumi.awsnative.iot.Logging,
)
}
/**
* @see [Logging].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Logging].
*/
public suspend fun logging(name: String, block: suspend LoggingResourceBuilder.() -> Unit): Logging {
val builder = LoggingResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Logging].
* @param name The _unique_ name of the resulting resource.
*/
public fun logging(name: String): Logging {
val builder = LoggingResourceBuilder()
builder.name(name)
return builder.build()
}