com.pulumi.awsnative.cloudfront.kotlin.KeyGroup.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.cloudfront.kotlin
import com.pulumi.awsnative.cloudfront.kotlin.outputs.KeyGroupConfig
import com.pulumi.awsnative.cloudfront.kotlin.outputs.KeyGroupConfig.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 [KeyGroup].
*/
@PulumiTagMarker
public class KeyGroupResourceBuilder internal constructor() {
public var name: String? = null
public var args: KeyGroupArgs = KeyGroupArgs()
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 KeyGroupArgsBuilder.() -> Unit) {
val builder = KeyGroupArgsBuilder()
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(): KeyGroup {
val builtJavaResource = com.pulumi.awsnative.cloudfront.KeyGroup(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return KeyGroup(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::CloudFront::KeyGroup
*/
public class KeyGroup internal constructor(
override val javaResource: com.pulumi.awsnative.cloudfront.KeyGroup,
) : KotlinCustomResource(javaResource, KeyGroupMapper) {
/**
* The identifier for the key group.
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* The key group configuration.
*/
public val keyGroupConfig: Output
get() = javaResource.keyGroupConfig().applyValue({ args0 ->
args0.let({ args0 ->
toKotlin(args0)
})
})
/**
* The date and time when the key group was last modified.
*/
public val lastModifiedTime: Output
get() = javaResource.lastModifiedTime().applyValue({ args0 -> args0 })
}
public object KeyGroupMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.cloudfront.KeyGroup::class == javaResource::class
override fun map(javaResource: Resource): KeyGroup = KeyGroup(
javaResource as
com.pulumi.awsnative.cloudfront.KeyGroup,
)
}
/**
* @see [KeyGroup].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [KeyGroup].
*/
public suspend fun keyGroup(name: String, block: suspend KeyGroupResourceBuilder.() -> Unit): KeyGroup {
val builder = KeyGroupResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [KeyGroup].
* @param name The _unique_ name of the resulting resource.
*/
public fun keyGroup(name: String): KeyGroup {
val builder = KeyGroupResourceBuilder()
builder.name(name)
return builder.build()
}