com.pulumi.vault.identity.kotlin.MfaTotp.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-vault-kotlin Show documentation
Show all versions of pulumi-vault-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.vault.identity.kotlin
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [MfaTotp].
*/
@PulumiTagMarker
public class MfaTotpResourceBuilder internal constructor() {
public var name: String? = null
public var args: MfaTotpArgs = MfaTotpArgs()
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 MfaTotpArgsBuilder.() -> Unit) {
val builder = MfaTotpArgsBuilder()
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(): MfaTotp {
val builtJavaResource = com.pulumi.vault.identity.MfaTotp(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return MfaTotp(builtJavaResource)
}
}
/**
* Resource for configuring the totp MFA method.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const example = new vault.identity.MfaTotp("example", {issuer: "issuer1"});
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* example = vault.identity.MfaTotp("example", issuer="issuer1")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var example = new Vault.Identity.MfaTotp("example", new()
* {
* Issuer = "issuer1",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/identity"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := identity.NewMfaTotp(ctx, "example", &identity.MfaTotpArgs{
* Issuer: pulumi.String("issuer1"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.identity.MfaTotp;
* import com.pulumi.vault.identity.MfaTotpArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new MfaTotp("example", MfaTotpArgs.builder()
* .issuer("issuer1")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: vault:identity:MfaTotp
* properties:
* issuer: issuer1
* ```
*
* ## Import
* Resource can be imported using its `uuid` field, e.g.
* ```sh
* $ pulumi import vault:identity/mfaTotp:MfaTotp example 0d89c36a-4ff5-4d70-8749-bb6a5598aeec
* ```
*/
public class MfaTotp internal constructor(
override val javaResource: com.pulumi.vault.identity.MfaTotp,
) : KotlinCustomResource(javaResource, MfaTotpMapper) {
/**
* Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256, SHA512.
*/
public val algorithm: Output?
get() = javaResource.algorithm().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The number of digits in the generated TOTP token. This value can either be 6 or 8
*/
public val digits: Output?
get() = javaResource.digits().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The name of the key's issuing organization.
*/
public val issuer: Output
get() = javaResource.issuer().applyValue({ args0 -> args0 })
/**
* Specifies the size in bytes of the generated key.
*/
public val keySize: Output?
get() = javaResource.keySize().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The maximum number of consecutive failed validation attempts allowed.
*/
public val maxValidationAttempts: Output?
get() = javaResource.maxValidationAttempts().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Method ID.
*/
public val methodId: Output
get() = javaResource.methodId().applyValue({ args0 -> args0 })
/**
* Mount accessor.
*/
public val mountAccessor: Output
get() = javaResource.mountAccessor().applyValue({ args0 -> args0 })
/**
* Method name.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Target namespace. (requires Enterprise)
*/
public val namespace: Output?
get() = javaResource.namespace().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Method's namespace ID.
*/
public val namespaceId: Output
get() = javaResource.namespaceId().applyValue({ args0 -> args0 })
/**
* Method's namespace path.
*/
public val namespacePath: Output
get() = javaResource.namespacePath().applyValue({ args0 -> args0 })
/**
* The length of time in seconds used to generate a counter for the TOTP token calculation.
*/
public val period: Output?
get() = javaResource.period().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The pixel size of the generated square QR code.
*/
public val qrSize: Output
get() = javaResource.qrSize().applyValue({ args0 -> args0 })
/**
* The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.
*/
public val skew: Output?
get() = javaResource.skew().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* MFA type.
*/
public val type: Output
get() = javaResource.type().applyValue({ args0 -> args0 })
/**
* Resource UUID.
*/
public val uuid: Output
get() = javaResource.uuid().applyValue({ args0 -> args0 })
}
public object MfaTotpMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.vault.identity.MfaTotp::class == javaResource::class
override fun map(javaResource: Resource): MfaTotp = MfaTotp(
javaResource as
com.pulumi.vault.identity.MfaTotp,
)
}
/**
* @see [MfaTotp].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [MfaTotp].
*/
public suspend fun mfaTotp(name: String, block: suspend MfaTotpResourceBuilder.() -> Unit): MfaTotp {
val builder = MfaTotpResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [MfaTotp].
* @param name The _unique_ name of the resulting resource.
*/
public fun mfaTotp(name: String): MfaTotp {
val builder = MfaTotpResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy