com.pulumi.awsnative.elasticache.kotlin.User.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.UserEngine
import com.pulumi.awsnative.elasticache.kotlin.outputs.AuthenticationModeProperties
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.UserEngine.Companion.toKotlin as userEngineToKotlin
import com.pulumi.awsnative.elasticache.kotlin.outputs.AuthenticationModeProperties.Companion.toKotlin as authenticationModePropertiesToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [User].
*/
@PulumiTagMarker
public class UserResourceBuilder internal constructor() {
public var name: String? = null
public var args: UserArgs = UserArgs()
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 UserArgsBuilder.() -> Unit) {
val builder = UserArgsBuilder()
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(): User {
val builtJavaResource = com.pulumi.awsnative.elasticache.User(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return User(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::ElastiCache::User
*/
public class User internal constructor(
override val javaResource: com.pulumi.awsnative.elasticache.User,
) : KotlinCustomResource(javaResource, UserMapper) {
/**
* Access permissions string used for this user account.
*/
public val accessString: Output?
get() = javaResource.accessString().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Amazon Resource Name (ARN) of the user account.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* Specifies the authentication mode to use. Below is an example of the possible JSON values:
* ```
* { Passwords: ["*****", "******"] // If Type is password.
* }
* ```
*/
public val authenticationMode: Output?
get() = javaResource.authenticationMode().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> authenticationModePropertiesToKotlin(args0) })
}).orElse(null)
})
/**
* Must be redis.
*/
public val engine: Output
get() = javaResource.engine().applyValue({ args0 ->
args0.let({ args0 ->
userEngineToKotlin(args0)
})
})
/**
* Indicates a password is not required for this user account.
*/
public val noPasswordRequired: Output?
get() = javaResource.noPasswordRequired().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Passwords used for this user account. You can create up to two passwords for each user.
*/
public val passwords: Output>?
get() = javaResource.passwords().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
/**
* Indicates the user status. Can be "active", "modifying" or "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.
*/
public val userId: Output
get() = javaResource.userId().applyValue({ args0 -> args0 })
/**
* The username of the user.
*/
public val userName: Output
get() = javaResource.userName().applyValue({ args0 -> args0 })
}
public object UserMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.elasticache.User::class == javaResource::class
override fun map(javaResource: Resource): User = User(
javaResource as
com.pulumi.awsnative.elasticache.User,
)
}
/**
* @see [User].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [User].
*/
public suspend fun user(name: String, block: suspend UserResourceBuilder.() -> Unit): User {
val builder = UserResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [User].
* @param name The _unique_ name of the resulting resource.
*/
public fun user(name: String): User {
val builder = UserResourceBuilder()
builder.name(name)
return builder.build()
}