com.pulumi.awsnative.elasticache.kotlin.UserGroup.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.elasticache.kotlin
import com.pulumi.awsnative.elasticache.kotlin.enums.UserGroupEngine
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.elasticache.kotlin.enums.UserGroupEngine.Companion.toKotlin as userGroupEngineToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [UserGroup].
*/
@PulumiTagMarker
public class UserGroupResourceBuilder internal constructor() {
public var name: String? = null
public var args: UserGroupArgs = UserGroupArgs()
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 UserGroupArgsBuilder.() -> Unit) {
val builder = UserGroupArgsBuilder()
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(): UserGroup {
val builtJavaResource = com.pulumi.awsnative.elasticache.UserGroup(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return UserGroup(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::ElastiCache::UserGroup
*/
public class UserGroup internal constructor(
override val javaResource: com.pulumi.awsnative.elasticache.UserGroup,
) : KotlinCustomResource(javaResource, UserGroupMapper) {
/**
* The Amazon Resource Name (ARN) of the user account.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* Must be redis.
*/
public val engine: Output
get() = javaResource.engine().applyValue({ args0 ->
args0.let({ args0 ->
userGroupEngineToKotlin(args0)
})
})
/**
* Indicates user group status. Can be "creating", "active", "modifying", "deleting".
*/
public val status: Output
get() = javaResource.status().applyValue({ args0 -> args0 })
/**
* An array of key-value pairs to apply to this user.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* The ID of the user group.
*/
public val userGroupId: Output
get() = javaResource.userGroupId().applyValue({ args0 -> args0 })
/**
* List of users associated to this user group.
*/
public val userIds: Output>
get() = javaResource.userIds().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
}
public object UserGroupMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.elasticache.UserGroup::class == javaResource::class
override fun map(javaResource: Resource): UserGroup = UserGroup(
javaResource as
com.pulumi.awsnative.elasticache.UserGroup,
)
}
/**
* @see [UserGroup].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [UserGroup].
*/
public suspend fun userGroup(name: String, block: suspend UserGroupResourceBuilder.() -> Unit): UserGroup {
val builder = UserGroupResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [UserGroup].
* @param name The _unique_ name of the resulting resource.
*/
public fun userGroup(name: String): UserGroup {
val builder = UserGroupResourceBuilder()
builder.name(name)
return builder.build()
}