1. Packages
  2. HashiCorp Vault
  3. API Docs
  4. MfaTotp
HashiCorp Vault v6.2.0 published on Friday, Jun 21, 2024 by Pulumi

vault.MfaTotp

Explore with Pulumi AI

vault logo
HashiCorp Vault v6.2.0 published on Friday, Jun 21, 2024 by Pulumi

    Provides a resource to manage TOTP MFA.

    Note this feature is available only with Vault Enterprise.

    Example Usage

    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,
    });
    
    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)
    
    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
    	})
    }
    
    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,
        });
    
    });
    
    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());
    
        }
    }
    
    resources:
      myTotp:
        type: vault:MfaTotp
        name: my_totp
        properties:
          name: my_totp
          issuer: hashicorp
          period: 60
          algorithm: SHA256
          digits: 8
          keySize: 20
    

    Create MfaTotp Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new MfaTotp(name: string, args: MfaTotpArgs, opts?: CustomResourceOptions);
    @overload
    def MfaTotp(resource_name: str,
                args: MfaTotpArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def MfaTotp(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                issuer: Optional[str] = None,
                algorithm: Optional[str] = None,
                digits: Optional[int] = None,
                key_size: Optional[int] = None,
                name: Optional[str] = None,
                namespace: Optional[str] = None,
                period: Optional[int] = None,
                qr_size: Optional[int] = None,
                skew: Optional[int] = None)
    func NewMfaTotp(ctx *Context, name string, args MfaTotpArgs, opts ...ResourceOption) (*MfaTotp, error)
    public MfaTotp(string name, MfaTotpArgs args, CustomResourceOptions? opts = null)
    public MfaTotp(String name, MfaTotpArgs args)
    public MfaTotp(String name, MfaTotpArgs args, CustomResourceOptions options)
    
    type: vault:MfaTotp
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args MfaTotpArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args MfaTotpArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args MfaTotpArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MfaTotpArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MfaTotpArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var vaultMfaTotpResource = new Vault.MfaTotp("vaultMfaTotpResource", new()
    {
        Issuer = "string",
        Algorithm = "string",
        Digits = 0,
        KeySize = 0,
        Name = "string",
        Namespace = "string",
        Period = 0,
        QrSize = 0,
        Skew = 0,
    });
    
    example, err := vault.NewMfaTotp(ctx, "vaultMfaTotpResource", &vault.MfaTotpArgs{
    	Issuer:    pulumi.String("string"),
    	Algorithm: pulumi.String("string"),
    	Digits:    pulumi.Int(0),
    	KeySize:   pulumi.Int(0),
    	Name:      pulumi.String("string"),
    	Namespace: pulumi.String("string"),
    	Period:    pulumi.Int(0),
    	QrSize:    pulumi.Int(0),
    	Skew:      pulumi.Int(0),
    })
    
    var vaultMfaTotpResource = new MfaTotp("vaultMfaTotpResource", MfaTotpArgs.builder()
        .issuer("string")
        .algorithm("string")
        .digits(0)
        .keySize(0)
        .name("string")
        .namespace("string")
        .period(0)
        .qrSize(0)
        .skew(0)
        .build());
    
    vault_mfa_totp_resource = vault.MfaTotp("vaultMfaTotpResource",
        issuer="string",
        algorithm="string",
        digits=0,
        key_size=0,
        name="string",
        namespace="string",
        period=0,
        qr_size=0,
        skew=0)
    
    const vaultMfaTotpResource = new vault.MfaTotp("vaultMfaTotpResource", {
        issuer: "string",
        algorithm: "string",
        digits: 0,
        keySize: 0,
        name: "string",
        namespace: "string",
        period: 0,
        qrSize: 0,
        skew: 0,
    });
    
    type: vault:MfaTotp
    properties:
        algorithm: string
        digits: 0
        issuer: string
        keySize: 0
        name: string
        namespace: string
        period: 0
        qrSize: 0
        skew: 0
    

    MfaTotp Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The MfaTotp resource accepts the following input properties:

    Issuer string
    (string: <required>) - The name of the key's issuing organization.
    Algorithm string
    (string) - Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256 and SHA512
    Digits int
    (int) - The number of digits in the generated TOTP token. This value can either be 6 or 8.
    KeySize int
    (int) - Specifies the size in bytes of the generated key.
    Name string
    (string: <required>) – Name of the MFA method.
    Namespace string
    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. Available only for Vault Enterprise.
    Period int
    (int) - The length of time used to generate a counter for the TOTP token calculation.
    QrSize int
    (int) - The pixel size of the generated square QR code.
    Skew int
    (int) - The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.
    Issuer string
    (string: <required>) - The name of the key's issuing organization.
    Algorithm string
    (string) - Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256 and SHA512
    Digits int
    (int) - The number of digits in the generated TOTP token. This value can either be 6 or 8.
    KeySize int
    (int) - Specifies the size in bytes of the generated key.
    Name string
    (string: <required>) – Name of the MFA method.
    Namespace string
    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. Available only for Vault Enterprise.
    Period int
    (int) - The length of time used to generate a counter for the TOTP token calculation.
    QrSize int
    (int) - The pixel size of the generated square QR code.
    Skew int
    (int) - The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.
    issuer String
    (string: <required>) - The name of the key's issuing organization.
    algorithm String
    (string) - Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256 and SHA512
    digits Integer
    (int) - The number of digits in the generated TOTP token. This value can either be 6 or 8.
    keySize Integer
    (int) - Specifies the size in bytes of the generated key.
    name String
    (string: <required>) – Name of the MFA method.
    namespace String
    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. Available only for Vault Enterprise.
    period Integer
    (int) - The length of time used to generate a counter for the TOTP token calculation.
    qrSize Integer
    (int) - The pixel size of the generated square QR code.
    skew Integer
    (int) - The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.
    issuer string
    (string: <required>) - The name of the key's issuing organization.
    algorithm string
    (string) - Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256 and SHA512
    digits number
    (int) - The number of digits in the generated TOTP token. This value can either be 6 or 8.
    keySize number
    (int) - Specifies the size in bytes of the generated key.
    name string
    (string: <required>) – Name of the MFA method.
    namespace string
    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. Available only for Vault Enterprise.
    period number
    (int) - The length of time used to generate a counter for the TOTP token calculation.
    qrSize number
    (int) - The pixel size of the generated square QR code.
    skew number
    (int) - The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.
    issuer str
    (string: <required>) - The name of the key's issuing organization.
    algorithm str
    (string) - Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256 and SHA512
    digits int
    (int) - The number of digits in the generated TOTP token. This value can either be 6 or 8.
    key_size int
    (int) - Specifies the size in bytes of the generated key.
    name str
    (string: <required>) – Name of the MFA method.
    namespace str
    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. Available only for Vault Enterprise.
    period int
    (int) - The length of time used to generate a counter for the TOTP token calculation.
    qr_size int
    (int) - The pixel size of the generated square QR code.
    skew int
    (int) - The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.
    issuer String
    (string: <required>) - The name of the key's issuing organization.
    algorithm String
    (string) - Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256 and SHA512
    digits Number
    (int) - The number of digits in the generated TOTP token. This value can either be 6 or 8.
    keySize Number
    (int) - Specifies the size in bytes of the generated key.
    name String
    (string: <required>) – Name of the MFA method.
    namespace String
    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. Available only for Vault Enterprise.
    period Number
    (int) - The length of time used to generate a counter for the TOTP token calculation.
    qrSize Number
    (int) - The pixel size of the generated square QR code.
    skew Number
    (int) - The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MfaTotp resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing MfaTotp Resource

    Get an existing MfaTotp resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: MfaTotpState, opts?: CustomResourceOptions): MfaTotp
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            algorithm: Optional[str] = None,
            digits: Optional[int] = None,
            issuer: Optional[str] = None,
            key_size: Optional[int] = None,
            name: Optional[str] = None,
            namespace: Optional[str] = None,
            period: Optional[int] = None,
            qr_size: Optional[int] = None,
            skew: Optional[int] = None) -> MfaTotp
    func GetMfaTotp(ctx *Context, name string, id IDInput, state *MfaTotpState, opts ...ResourceOption) (*MfaTotp, error)
    public static MfaTotp Get(string name, Input<string> id, MfaTotpState? state, CustomResourceOptions? opts = null)
    public static MfaTotp get(String name, Output<String> id, MfaTotpState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Algorithm string
    (string) - Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256 and SHA512
    Digits int
    (int) - The number of digits in the generated TOTP token. This value can either be 6 or 8.
    Issuer string
    (string: <required>) - The name of the key's issuing organization.
    KeySize int
    (int) - Specifies the size in bytes of the generated key.
    Name string
    (string: <required>) – Name of the MFA method.
    Namespace string
    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. Available only for Vault Enterprise.
    Period int
    (int) - The length of time used to generate a counter for the TOTP token calculation.
    QrSize int
    (int) - The pixel size of the generated square QR code.
    Skew int
    (int) - The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.
    Algorithm string
    (string) - Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256 and SHA512
    Digits int
    (int) - The number of digits in the generated TOTP token. This value can either be 6 or 8.
    Issuer string
    (string: <required>) - The name of the key's issuing organization.
    KeySize int
    (int) - Specifies the size in bytes of the generated key.
    Name string
    (string: <required>) – Name of the MFA method.
    Namespace string
    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. Available only for Vault Enterprise.
    Period int
    (int) - The length of time used to generate a counter for the TOTP token calculation.
    QrSize int
    (int) - The pixel size of the generated square QR code.
    Skew int
    (int) - The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.
    algorithm String
    (string) - Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256 and SHA512
    digits Integer
    (int) - The number of digits in the generated TOTP token. This value can either be 6 or 8.
    issuer String
    (string: <required>) - The name of the key's issuing organization.
    keySize Integer
    (int) - Specifies the size in bytes of the generated key.
    name String
    (string: <required>) – Name of the MFA method.
    namespace String
    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. Available only for Vault Enterprise.
    period Integer
    (int) - The length of time used to generate a counter for the TOTP token calculation.
    qrSize Integer
    (int) - The pixel size of the generated square QR code.
    skew Integer
    (int) - The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.
    algorithm string
    (string) - Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256 and SHA512
    digits number
    (int) - The number of digits in the generated TOTP token. This value can either be 6 or 8.
    issuer string
    (string: <required>) - The name of the key's issuing organization.
    keySize number
    (int) - Specifies the size in bytes of the generated key.
    name string
    (string: <required>) – Name of the MFA method.
    namespace string
    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. Available only for Vault Enterprise.
    period number
    (int) - The length of time used to generate a counter for the TOTP token calculation.
    qrSize number
    (int) - The pixel size of the generated square QR code.
    skew number
    (int) - The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.
    algorithm str
    (string) - Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256 and SHA512
    digits int
    (int) - The number of digits in the generated TOTP token. This value can either be 6 or 8.
    issuer str
    (string: <required>) - The name of the key's issuing organization.
    key_size int
    (int) - Specifies the size in bytes of the generated key.
    name str
    (string: <required>) – Name of the MFA method.
    namespace str
    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. Available only for Vault Enterprise.
    period int
    (int) - The length of time used to generate a counter for the TOTP token calculation.
    qr_size int
    (int) - The pixel size of the generated square QR code.
    skew int
    (int) - The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.
    algorithm String
    (string) - Specifies the hashing algorithm used to generate the TOTP code. Options include SHA1, SHA256 and SHA512
    digits Number
    (int) - The number of digits in the generated TOTP token. This value can either be 6 or 8.
    issuer String
    (string: <required>) - The name of the key's issuing organization.
    keySize Number
    (int) - Specifies the size in bytes of the generated key.
    name String
    (string: <required>) – Name of the MFA method.
    namespace String
    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. Available only for Vault Enterprise.
    period Number
    (int) - The length of time used to generate a counter for the TOTP token calculation.
    qrSize Number
    (int) - The pixel size of the generated square QR code.
    skew Number
    (int) - The number of delay periods that are allowed when validating a TOTP token. This value can either be 0 or 1.

    Import

    Mounts can be imported using the path, e.g.

    $ pulumi import vault:index/mfaTotp:MfaTotp my_totp my_totp
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Vault pulumi/pulumi-vault
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vault Terraform Provider.
    vault logo
    HashiCorp Vault v6.2.0 published on Friday, Jun 21, 2024 by Pulumi