com.pulumi.awsnative.kinesis.kotlin.Stream.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.kinesis.kotlin
import com.pulumi.awsnative.kinesis.kotlin.outputs.StreamEncryption
import com.pulumi.awsnative.kinesis.kotlin.outputs.StreamModeDetails
import com.pulumi.awsnative.kotlin.outputs.Tag
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.kinesis.kotlin.outputs.StreamEncryption.Companion.toKotlin as streamEncryptionToKotlin
import com.pulumi.awsnative.kinesis.kotlin.outputs.StreamModeDetails.Companion.toKotlin as streamModeDetailsToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [Stream].
*/
@PulumiTagMarker
public class StreamResourceBuilder internal constructor() {
public var name: String? = null
public var args: StreamArgs = StreamArgs()
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 StreamArgsBuilder.() -> Unit) {
val builder = StreamArgsBuilder()
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(): Stream {
val builtJavaResource = com.pulumi.awsnative.kinesis.Stream(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Stream(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::Kinesis::Stream
*/
public class Stream internal constructor(
override val javaResource: com.pulumi.awsnative.kinesis.Stream,
) : KotlinCustomResource(javaResource, StreamMapper) {
/**
* The Amazon resource name (ARN) of the Kinesis stream
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The name of the Kinesis stream.
*/
public val name: Output?
get() = javaResource.name().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The number of hours for the data records that are stored in shards to remain accessible.
*/
public val retentionPeriodHours: Output?
get() = javaResource.retentionPeriodHours().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The number of shards that the stream uses. Required when StreamMode = PROVISIONED is passed.
*/
public val shardCount: Output?
get() = javaResource.shardCount().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* When specified, enables or updates server-side encryption using an AWS KMS key for a specified stream.
*/
public val streamEncryption: Output?
get() = javaResource.streamEncryption().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> streamEncryptionToKotlin(args0) })
}).orElse(null)
})
/**
* The mode in which the stream is running.
*/
public val streamModeDetails: Output?
get() = javaResource.streamModeDetails().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> streamModeDetailsToKotlin(args0) })
}).orElse(null)
})
/**
* An arbitrary set of tags (key–value pairs) to associate with the Kinesis stream.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object StreamMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.kinesis.Stream::class == javaResource::class
override fun map(javaResource: Resource): Stream = Stream(
javaResource as
com.pulumi.awsnative.kinesis.Stream,
)
}
/**
* @see [Stream].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Stream].
*/
public suspend fun stream(name: String, block: suspend StreamResourceBuilder.() -> Unit): Stream {
val builder = StreamResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Stream].
* @param name The _unique_ name of the resulting resource.
*/
public fun stream(name: String): Stream {
val builder = StreamResourceBuilder()
builder.name(name)
return builder.build()
}