com.pulumi.awsnative.cloudfront.kotlin.KeyValueStore.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.cloudfront.kotlin
import com.pulumi.awsnative.cloudfront.kotlin.outputs.KeyValueStoreImportSource
import com.pulumi.awsnative.cloudfront.kotlin.outputs.KeyValueStoreImportSource.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 [KeyValueStore].
*/
@PulumiTagMarker
public class KeyValueStoreResourceBuilder internal constructor() {
public var name: String? = null
public var args: KeyValueStoreArgs = KeyValueStoreArgs()
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 KeyValueStoreArgsBuilder.() -> Unit) {
val builder = KeyValueStoreArgsBuilder()
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(): KeyValueStore {
val builtJavaResource = com.pulumi.awsnative.cloudfront.KeyValueStore(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return KeyValueStore(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::CloudFront::KeyValueStore
*/
public class KeyValueStore internal constructor(
override val javaResource: com.pulumi.awsnative.cloudfront.KeyValueStore,
) : KotlinCustomResource(javaResource, KeyValueStoreMapper) {
/**
* The Amazon Resource Name (ARN) of the key value store.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The unique Id for the key value store.
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* A comment for the key value store.
*/
public val comment: Output?
get() = javaResource.comment().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The import source for the key value store.
*/
public val importSource: Output?
get() = javaResource.importSource().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
toKotlin(args0)
})
}).orElse(null)
})
/**
* The name of the key value store.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The current status of the key value store. For more information, see [Key value store statuses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/kvs-with-functions-create.html#key-value-store-status) in the *.*
*/
public val status: Output
get() = javaResource.status().applyValue({ args0 -> args0 })
}
public object KeyValueStoreMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.cloudfront.KeyValueStore::class == javaResource::class
override fun map(javaResource: Resource): KeyValueStore = KeyValueStore(
javaResource as
com.pulumi.awsnative.cloudfront.KeyValueStore,
)
}
/**
* @see [KeyValueStore].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [KeyValueStore].
*/
public suspend fun keyValueStore(
name: String,
block: suspend KeyValueStoreResourceBuilder.() -> Unit,
): KeyValueStore {
val builder = KeyValueStoreResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [KeyValueStore].
* @param name The _unique_ name of the resulting resource.
*/
public fun keyValueStore(name: String): KeyValueStore {
val builder = KeyValueStoreResourceBuilder()
builder.name(name)
return builder.build()
}