Class VirtualMfaDevice


  • public class VirtualMfaDevice
    extends com.pulumi.resources.CustomResource
    Provides an IAM Virtual MFA Device. > **Note:** All attributes will be stored in the raw state as plain-text. **Note:** A virtual MFA device cannot be directly associated with an IAM User from the provider. To associate the virtual MFA device with a user and enable it, use the code returned in either `base32StringSeed` or `qrCodePng` to generate TOTP authentication codes. The authentication codes can then be used with the AWS CLI command [`aws iam enable-mfa-device`](https://docs.aws.amazon.com/cli/latest/reference/iam/enable-mfa-device.html) or the AWS API call [`EnableMFADevice`](https://docs.aws.amazon.com/IAM/latest/APIReference/API_EnableMFADevice.html). ## Example Usage **Using certs on file:**
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.iam.VirtualMfaDevice;
     import com.pulumi.aws.iam.VirtualMfaDeviceArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     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 VirtualMfaDevice("example", VirtualMfaDeviceArgs.builder()
                 .virtualMfaDeviceName("example")
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import IAM Virtual MFA Devices using the `arn`. For example: ```sh $ pulumi import aws:iam/virtualMfaDevice:VirtualMfaDevice example arn:aws:iam::123456789012:mfa/example ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.lang.String> base32StringSeed()  
      com.pulumi.core.Output<java.lang.String> enableDate()  
      static VirtualMfaDevice get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, VirtualMfaDeviceState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> path()  
      com.pulumi.core.Output<java.lang.String> qrCodePng()  
      com.pulumi.core.Output<java.lang.String> serialNumber()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.lang.String> userName()  
      com.pulumi.core.Output<java.lang.String> virtualMfaDeviceName()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VirtualMfaDevice

        public VirtualMfaDevice​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • VirtualMfaDevice

        public VirtualMfaDevice​(java.lang.String name,
                                VirtualMfaDeviceArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • VirtualMfaDevice

        public VirtualMfaDevice​(java.lang.String name,
                                VirtualMfaDeviceArgs args,
                                @Nullable
                                com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN, which is also the serial number, of the virtual MFA device.
      • base32StringSeed

        public com.pulumi.core.Output<java.lang.String> base32StringSeed()
        Returns:
        Base32 seed defined as specified in [RFC3548](https://tools.ietf.org/html/rfc3548.txt). The `base32StringSeed` is base64-encoded.
      • enableDate

        public com.pulumi.core.Output<java.lang.String> enableDate()
        Returns:
        Date and time when the virtual MFA device was enabled.
      • path

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> path()
        Returns:
        Path for the virtual MFA device.
      • qrCodePng

        public com.pulumi.core.Output<java.lang.String> qrCodePng()
        Returns:
        QR code PNG image that encodes `otpauth://totp/$virtualMFADeviceName@$AccountName?secret=$Base32String` where `$virtualMFADeviceName` is one of the create call arguments. `AccountName` is the user name if set (otherwise, the account ID), and `Base32String` is the seed in base32 format.
      • serialNumber

        public com.pulumi.core.Output<java.lang.String> serialNumber()
        Returns:
        Serial number associated with the virtual MFA device.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Map of resource tags for the virtual MFA device. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • userName

        public com.pulumi.core.Output<java.lang.String> userName()
        Returns:
        Name of the IAM user associated with this virtual MFA device.
      • virtualMfaDeviceName

        public com.pulumi.core.Output<java.lang.String> virtualMfaDeviceName()
        Returns:
        Name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
      • get

        public static VirtualMfaDevice get​(java.lang.String name,
                                           com.pulumi.core.Output<java.lang.String> id,
                                           @Nullable
                                           VirtualMfaDeviceState state,
                                           @Nullable
                                           com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.