com.pulumi.vault.kotlin.MfaTotpArgs.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.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.vault.MfaTotpArgs.builder
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Provides a resource to manage [TOTP MFA](https://www.vaultproject.io/docs/enterprise/mfa/mfa-totp).
* **Note** this feature is available only with Vault Enterprise.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const myTotp = new vault.MfaTotp("my_totp", {
* name: "my_totp",
* issuer: "hashicorp",
* period: 60,
* algorithm: "SHA256",
* digits: 8,
* keySize: 20,
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* my_totp = vault.MfaTotp("my_totp",
* name="my_totp",
* issuer="hashicorp",
* period=60,
* algorithm="SHA256",
* digits=8,
* key_size=20)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var myTotp = new Vault.MfaTotp("my_totp", new()
* {
* Name = "my_totp",
* Issuer = "hashicorp",
* Period = 60,
* Algorithm = "SHA256",
* Digits = 8,
* KeySize = 20,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vault.NewMfaTotp(ctx, "my_totp", &vault.MfaTotpArgs{
* Name: pulumi.String("my_totp"),
* Issuer: pulumi.String("hashicorp"),
* Period: pulumi.Int(60),
* Algorithm: pulumi.String("SHA256"),
* Digits: pulumi.Int(8),
* KeySize: pulumi.Int(20),
* })
* 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.MfaTotp;
* import com.pulumi.vault.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 myTotp = new MfaTotp("myTotp", MfaTotpArgs.builder()
* .name("my_totp")
* .issuer("hashicorp")
* .period(60)
* .algorithm("SHA256")
* .digits(8)
* .keySize(20)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* myTotp:
* type: vault:MfaTotp
* name: my_totp
* properties:
* name: my_totp
* issuer: hashicorp
* period: 60
* algorithm: SHA256
* digits: 8
* keySize: 20
* ```
*
* ## Import
* Mounts can be imported using the `path`, e.g.
* ```sh
* $ pulumi import vault:index/mfaTotp:MfaTotp my_totp my_totp
* ```
* @property algorithm `(string)` - Specifies the hashing algorithm used to generate the TOTP code.
* Options include `SHA1`, `SHA256` and `SHA512`
* @property digits `(int)` - The number of digits in the generated TOTP token.
* This value can either be 6 or 8.
* @property issuer `(string: )` - The name of the key's issuing organization.
* @property keySize `(int)` - Specifies the size in bytes of the generated key.
* @property name `(string: )` – Name of the MFA method.
* @property namespace The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
* @property period `(int)` - The length of time used to generate a counter for the TOTP token calculation.
* @property qrSize `(int)` - The pixel size of the generated square QR code.
* @property skew `(int)` - The number of delay periods that are allowed when validating a TOTP token.
* This value can either be 0 or 1.
*/
public data class MfaTotpArgs(
public val algorithm: Output? = null,
public val digits: Output? = null,
public val issuer: Output? = null,
public val keySize: Output? = null,
public val name: Output? = null,
public val namespace: Output? = null,
public val period: Output? = null,
public val qrSize: Output? = null,
public val skew: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.vault.MfaTotpArgs = com.pulumi.vault.MfaTotpArgs.builder()
.algorithm(algorithm?.applyValue({ args0 -> args0 }))
.digits(digits?.applyValue({ args0 -> args0 }))
.issuer(issuer?.applyValue({ args0 -> args0 }))
.keySize(keySize?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.namespace(namespace?.applyValue({ args0 -> args0 }))
.period(period?.applyValue({ args0 -> args0 }))
.qrSize(qrSize?.applyValue({ args0 -> args0 }))
.skew(skew?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [MfaTotpArgs].
*/
@PulumiTagMarker
public class MfaTotpArgsBuilder internal constructor() {
private var algorithm: Output? = null
private var digits: Output? = null
private var issuer: Output? = null
private var keySize: Output? = null
private var name: Output? = null
private var namespace: Output? = null
private var period: Output? = null
private var qrSize: Output? = null
private var skew: Output? = null
/**
* @param value `(string)` - Specifies the hashing algorithm used to generate the TOTP code.
* Options include `SHA1`, `SHA256` and `SHA512`
*/
@JvmName("qdlasklgvlcpjxys")
public suspend fun algorithm(`value`: Output) {
this.algorithm = value
}
/**
* @param value `(int)` - The number of digits in the generated TOTP token.
* This value can either be 6 or 8.
*/
@JvmName("moompgvrsiydlgpn")
public suspend fun digits(`value`: Output) {
this.digits = value
}
/**
* @param value `(string: )` - The name of the key's issuing organization.
*/
@JvmName("tcwxaaukxgjokeys")
public suspend fun issuer(`value`: Output) {
this.issuer = value
}
/**
* @param value `(int)` - Specifies the size in bytes of the generated key.
*/
@JvmName("jugbtjlhvdkcrcmt")
public suspend fun keySize(`value`: Output) {
this.keySize = value
}
/**
* @param value `(string: )` – Name of the MFA method.
*/
@JvmName("bsxytwiaxbutagqk")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
*/
@JvmName("rocfkecqdfuhrvkb")
public suspend fun namespace(`value`: Output) {
this.namespace = value
}
/**
* @param value `(int)` - The length of time used to generate a counter for the TOTP token calculation.
*/
@JvmName("qleyuxbxfydloeeb")
public suspend fun period(`value`: Output) {
this.period = value
}
/**
* @param value `(int)` - The pixel size of the generated square QR code.
*/
@JvmName("vpmbvikmvvqwogiv")
public suspend fun qrSize(`value`: Output) {
this.qrSize = value
}
/**
* @param value `(int)` - The number of delay periods that are allowed when validating a TOTP token.
* This value can either be 0 or 1.
*/
@JvmName("yvrxihtwlgmaursq")
public suspend fun skew(`value`: Output) {
this.skew = value
}
/**
* @param value `(string)` - Specifies the hashing algorithm used to generate the TOTP code.
* Options include `SHA1`, `SHA256` and `SHA512`
*/
@JvmName("gyjlsvvkhrviccuq")
public suspend fun algorithm(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.algorithm = mapped
}
/**
* @param value `(int)` - The number of digits in the generated TOTP token.
* This value can either be 6 or 8.
*/
@JvmName("rfdrfbtgompevfkq")
public suspend fun digits(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.digits = mapped
}
/**
* @param value `(string: )` - The name of the key's issuing organization.
*/
@JvmName("sqmffujsuthttdjf")
public suspend fun issuer(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.issuer = mapped
}
/**
* @param value `(int)` - Specifies the size in bytes of the generated key.
*/
@JvmName("hbmmtoxcyqwimpxy")
public suspend fun keySize(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.keySize = mapped
}
/**
* @param value `(string: )` – Name of the MFA method.
*/
@JvmName("mgvbhkaxeuqjedyg")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
*/
@JvmName("rfhkmkfsvhxmpgmg")
public suspend fun namespace(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.namespace = mapped
}
/**
* @param value `(int)` - The length of time used to generate a counter for the TOTP token calculation.
*/
@JvmName("chnsnuutwtvuogne")
public suspend fun period(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.period = mapped
}
/**
* @param value `(int)` - The pixel size of the generated square QR code.
*/
@JvmName("evelireytuvibwgd")
public suspend fun qrSize(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.qrSize = mapped
}
/**
* @param value `(int)` - The number of delay periods that are allowed when validating a TOTP token.
* This value can either be 0 or 1.
*/
@JvmName("kjdbdmbupfwfliip")
public suspend fun skew(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.skew = mapped
}
internal fun build(): MfaTotpArgs = MfaTotpArgs(
algorithm = algorithm,
digits = digits,
issuer = issuer,
keySize = keySize,
name = name,
namespace = namespace,
period = period,
qrSize = qrSize,
skew = skew,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy