com.pulumi.awsnative.logs.kotlin.LogStream.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.logs.kotlin
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 [LogStream].
*/
@PulumiTagMarker
public class LogStreamResourceBuilder internal constructor() {
public var name: String? = null
public var args: LogStreamArgs = LogStreamArgs()
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 LogStreamArgsBuilder.() -> Unit) {
val builder = LogStreamArgsBuilder()
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(): LogStream {
val builtJavaResource = com.pulumi.awsnative.logs.LogStream(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return LogStream(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::Logs::LogStream
*/
public class LogStream internal constructor(
override val javaResource: com.pulumi.awsnative.logs.LogStream,
) : KotlinCustomResource(javaResource, LogStreamMapper) {
/**
* The name of the log group where the log stream is created.
*/
public val logGroupName: Output
get() = javaResource.logGroupName().applyValue({ args0 -> args0 })
/**
* The name of the log stream. The name must be unique wihtin the log group.
*/
public val logStreamName: Output?
get() = javaResource.logStreamName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object LogStreamMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.logs.LogStream::class == javaResource::class
override fun map(javaResource: Resource): LogStream = LogStream(
javaResource as
com.pulumi.awsnative.logs.LogStream,
)
}
/**
* @see [LogStream].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [LogStream].
*/
public suspend fun logStream(name: String, block: suspend LogStreamResourceBuilder.() -> Unit): LogStream {
val builder = LogStreamResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [LogStream].
* @param name The _unique_ name of the resulting resource.
*/
public fun logStream(name: String): LogStream {
val builder = LogStreamResourceBuilder()
builder.name(name)
return builder.build()
}