com.pulumi.awsnative.iam.kotlin.VirtualMfaDevice.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.iam.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.kotlin.outputs.Tag.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
import kotlin.collections.List
/**
* Builder for [VirtualMfaDevice].
*/
@PulumiTagMarker
public class VirtualMfaDeviceResourceBuilder internal constructor() {
public var name: String? = null
public var args: VirtualMfaDeviceArgs = VirtualMfaDeviceArgs()
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 VirtualMfaDeviceArgsBuilder.() -> Unit) {
val builder = VirtualMfaDeviceArgsBuilder()
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(): VirtualMfaDevice {
val builtJavaResource = com.pulumi.awsnative.iam.VirtualMfaDevice(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return VirtualMfaDevice(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::IAM::VirtualMFADevice
*/
public class VirtualMfaDevice internal constructor(
override val javaResource: com.pulumi.awsnative.iam.VirtualMfaDevice,
) : KotlinCustomResource(javaResource, VirtualMfaDeviceMapper) {
/**
* The path for the virtual MFA device. For more information about paths, see [IAM identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) in the *IAM User Guide* .
* This parameter is optional. If it is not included, it defaults to a slash (/).
* This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex) ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! ( `\u0021` ) through the DEL character ( `\u007F` ), including most punctuation characters, digits, and upper and lowercased letters.
*/
public val path: Output?
get() = javaResource.path().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Returns the serial number for the specified `AWS::IAM::VirtualMFADevice` resource.
*/
public val serialNumber: Output
get() = javaResource.serialNumber().applyValue({ args0 -> args0 })
/**
* A list of tags that you want to attach to the new IAM virtual MFA device. Each tag consists of a key name and an associated value. For more information about tagging, see [Tagging IAM resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) in the *IAM User Guide* .
* > If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
}).orElse(null)
})
/**
* The IAM user associated with this virtual MFA device.
*/
public val users: Output>
get() = javaResource.users().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* The name of the virtual MFA device, which must be unique. Use with path to uniquely identify a virtual MFA device.
* This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex) ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
*/
public val virtualMfaDeviceName: Output?
get() = javaResource.virtualMfaDeviceName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object VirtualMfaDeviceMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.iam.VirtualMfaDevice::class == javaResource::class
override fun map(javaResource: Resource): VirtualMfaDevice = VirtualMfaDevice(
javaResource as
com.pulumi.awsnative.iam.VirtualMfaDevice,
)
}
/**
* @see [VirtualMfaDevice].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [VirtualMfaDevice].
*/
public suspend fun virtualMfaDevice(
name: String,
block: suspend VirtualMfaDeviceResourceBuilder.() -> Unit,
): VirtualMfaDevice {
val builder = VirtualMfaDeviceResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [VirtualMfaDevice].
* @param name The _unique_ name of the resulting resource.
*/
public fun virtualMfaDevice(name: String): VirtualMfaDevice {
val builder = VirtualMfaDeviceResourceBuilder()
builder.name(name)
return builder.build()
}