aws.iam.VirtualMfaDevice
Explore with Pulumi AI
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
base_32_string_seed
orqr_code_png
to generate TOTP authentication codes. The authentication codes can then be used with the AWS CLI commandaws iam enable-mfa-device
or the AWS API callEnableMFADevice
.
Example Usage
Using certs on file:
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.iam.VirtualMfaDevice("example", {virtualMfaDeviceName: "example"});
import pulumi
import pulumi_aws as aws
example = aws.iam.VirtualMfaDevice("example", virtual_mfa_device_name="example")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := iam.NewVirtualMfaDevice(ctx, "example", &iam.VirtualMfaDeviceArgs{
VirtualMfaDeviceName: pulumi.String("example"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Iam.VirtualMfaDevice("example", new()
{
VirtualMfaDeviceName = "example",
});
});
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.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 VirtualMfaDevice("example", VirtualMfaDeviceArgs.builder()
.virtualMfaDeviceName("example")
.build());
}
}
resources:
example:
type: aws:iam:VirtualMfaDevice
properties:
virtualMfaDeviceName: example
Create VirtualMfaDevice Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VirtualMfaDevice(name: string, args: VirtualMfaDeviceArgs, opts?: CustomResourceOptions);
@overload
def VirtualMfaDevice(resource_name: str,
args: VirtualMfaDeviceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VirtualMfaDevice(resource_name: str,
opts: Optional[ResourceOptions] = None,
virtual_mfa_device_name: Optional[str] = None,
path: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewVirtualMfaDevice(ctx *Context, name string, args VirtualMfaDeviceArgs, opts ...ResourceOption) (*VirtualMfaDevice, error)
public VirtualMfaDevice(string name, VirtualMfaDeviceArgs args, CustomResourceOptions? opts = null)
public VirtualMfaDevice(String name, VirtualMfaDeviceArgs args)
public VirtualMfaDevice(String name, VirtualMfaDeviceArgs args, CustomResourceOptions options)
type: aws:iam:VirtualMfaDevice
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 VirtualMfaDeviceArgs
- 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 VirtualMfaDeviceArgs
- 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 VirtualMfaDeviceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VirtualMfaDeviceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VirtualMfaDeviceArgs
- 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 virtualMfaDeviceResource = new Aws.Iam.VirtualMfaDevice("virtualMfaDeviceResource", new()
{
VirtualMfaDeviceName = "string",
Path = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := iam.NewVirtualMfaDevice(ctx, "virtualMfaDeviceResource", &iam.VirtualMfaDeviceArgs{
VirtualMfaDeviceName: pulumi.String("string"),
Path: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var virtualMfaDeviceResource = new VirtualMfaDevice("virtualMfaDeviceResource", VirtualMfaDeviceArgs.builder()
.virtualMfaDeviceName("string")
.path("string")
.tags(Map.of("string", "string"))
.build());
virtual_mfa_device_resource = aws.iam.VirtualMfaDevice("virtualMfaDeviceResource",
virtual_mfa_device_name="string",
path="string",
tags={
"string": "string",
})
const virtualMfaDeviceResource = new aws.iam.VirtualMfaDevice("virtualMfaDeviceResource", {
virtualMfaDeviceName: "string",
path: "string",
tags: {
string: "string",
},
});
type: aws:iam:VirtualMfaDevice
properties:
path: string
tags:
string: string
virtualMfaDeviceName: string
VirtualMfaDevice Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VirtualMfaDevice resource accepts the following input properties:
- Virtual
Mfa stringDevice Name - The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
- Path string
- The path for the virtual MFA device.
- Dictionary<string, string>
- Map of resource tags for the virtual mfa device. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Virtual
Mfa stringDevice Name - The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
- Path string
- The path for the virtual MFA device.
- map[string]string
- Map of resource tags for the virtual mfa device. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- virtual
Mfa StringDevice Name - The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
- path String
- The path for the virtual MFA device.
- Map<String,String>
- Map of resource tags for the virtual mfa device. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- virtual
Mfa stringDevice Name - The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
- path string
- The path for the virtual MFA device.
- {[key: string]: string}
- Map of resource tags for the virtual mfa device. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- virtual_
mfa_ strdevice_ name - The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
- path str
- The path for the virtual MFA device.
- Mapping[str, str]
- Map of resource tags for the virtual mfa device. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- virtual
Mfa StringDevice Name - The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
- path String
- The path for the virtual MFA device.
- Map<String>
- Map of resource tags for the virtual mfa device. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the VirtualMfaDevice resource produces the following output properties:
- Arn string
- The Amazon Resource Name (ARN) specifying the virtual mfa device.
- Base32String
Seed string - The base32 seed defined as specified in RFC3548. The
base_32_string_seed
is base64-encoded. - Enable
Date string - The date and time when the virtual MFA device was enabled.
- Id string
- The provider-assigned unique ID for this managed resource.
- Qr
Code stringPng - A 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. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - User
Name string - The associated IAM User name if the virtual MFA device is enabled.
- Arn string
- The Amazon Resource Name (ARN) specifying the virtual mfa device.
- Base32String
Seed string - The base32 seed defined as specified in RFC3548. The
base_32_string_seed
is base64-encoded. - Enable
Date string - The date and time when the virtual MFA device was enabled.
- Id string
- The provider-assigned unique ID for this managed resource.
- Qr
Code stringPng - A 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. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - User
Name string - The associated IAM User name if the virtual MFA device is enabled.
- arn String
- The Amazon Resource Name (ARN) specifying the virtual mfa device.
- base32String
Seed String - The base32 seed defined as specified in RFC3548. The
base_32_string_seed
is base64-encoded. - enable
Date String - The date and time when the virtual MFA device was enabled.
- id String
- The provider-assigned unique ID for this managed resource.
- qr
Code StringPng - A 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. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - user
Name String - The associated IAM User name if the virtual MFA device is enabled.
- arn string
- The Amazon Resource Name (ARN) specifying the virtual mfa device.
- base32String
Seed string - The base32 seed defined as specified in RFC3548. The
base_32_string_seed
is base64-encoded. - enable
Date string - The date and time when the virtual MFA device was enabled.
- id string
- The provider-assigned unique ID for this managed resource.
- qr
Code stringPng - A 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. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - user
Name string - The associated IAM User name if the virtual MFA device is enabled.
- arn str
- The Amazon Resource Name (ARN) specifying the virtual mfa device.
- base32_
string_ strseed - The base32 seed defined as specified in RFC3548. The
base_32_string_seed
is base64-encoded. - enable_
date str - The date and time when the virtual MFA device was enabled.
- id str
- The provider-assigned unique ID for this managed resource.
- qr_
code_ strpng - A 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. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - user_
name str - The associated IAM User name if the virtual MFA device is enabled.
- arn String
- The Amazon Resource Name (ARN) specifying the virtual mfa device.
- base32String
Seed String - The base32 seed defined as specified in RFC3548. The
base_32_string_seed
is base64-encoded. - enable
Date String - The date and time when the virtual MFA device was enabled.
- id String
- The provider-assigned unique ID for this managed resource.
- qr
Code StringPng - A 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. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - user
Name String - The associated IAM User name if the virtual MFA device is enabled.
Look up Existing VirtualMfaDevice Resource
Get an existing VirtualMfaDevice 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?: VirtualMfaDeviceState, opts?: CustomResourceOptions): VirtualMfaDevice
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
base32_string_seed: Optional[str] = None,
enable_date: Optional[str] = None,
path: Optional[str] = None,
qr_code_png: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
user_name: Optional[str] = None,
virtual_mfa_device_name: Optional[str] = None) -> VirtualMfaDevice
func GetVirtualMfaDevice(ctx *Context, name string, id IDInput, state *VirtualMfaDeviceState, opts ...ResourceOption) (*VirtualMfaDevice, error)
public static VirtualMfaDevice Get(string name, Input<string> id, VirtualMfaDeviceState? state, CustomResourceOptions? opts = null)
public static VirtualMfaDevice get(String name, Output<String> id, VirtualMfaDeviceState 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.
- Arn string
- The Amazon Resource Name (ARN) specifying the virtual mfa device.
- Base32String
Seed string - The base32 seed defined as specified in RFC3548. The
base_32_string_seed
is base64-encoded. - Enable
Date string - The date and time when the virtual MFA device was enabled.
- Path string
- The path for the virtual MFA device.
- Qr
Code stringPng - A 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. - Dictionary<string, string>
- Map of resource tags for the virtual mfa device. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - User
Name string - The associated IAM User name if the virtual MFA device is enabled.
- Virtual
Mfa stringDevice Name - The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
- Arn string
- The Amazon Resource Name (ARN) specifying the virtual mfa device.
- Base32String
Seed string - The base32 seed defined as specified in RFC3548. The
base_32_string_seed
is base64-encoded. - Enable
Date string - The date and time when the virtual MFA device was enabled.
- Path string
- The path for the virtual MFA device.
- Qr
Code stringPng - A 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. - map[string]string
- Map of resource tags for the virtual mfa device. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - User
Name string - The associated IAM User name if the virtual MFA device is enabled.
- Virtual
Mfa stringDevice Name - The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
- arn String
- The Amazon Resource Name (ARN) specifying the virtual mfa device.
- base32String
Seed String - The base32 seed defined as specified in RFC3548. The
base_32_string_seed
is base64-encoded. - enable
Date String - The date and time when the virtual MFA device was enabled.
- path String
- The path for the virtual MFA device.
- qr
Code StringPng - A 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. - Map<String,String>
- Map of resource tags for the virtual mfa device. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - user
Name String - The associated IAM User name if the virtual MFA device is enabled.
- virtual
Mfa StringDevice Name - The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
- arn string
- The Amazon Resource Name (ARN) specifying the virtual mfa device.
- base32String
Seed string - The base32 seed defined as specified in RFC3548. The
base_32_string_seed
is base64-encoded. - enable
Date string - The date and time when the virtual MFA device was enabled.
- path string
- The path for the virtual MFA device.
- qr
Code stringPng - A 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. - {[key: string]: string}
- Map of resource tags for the virtual mfa device. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - user
Name string - The associated IAM User name if the virtual MFA device is enabled.
- virtual
Mfa stringDevice Name - The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
- arn str
- The Amazon Resource Name (ARN) specifying the virtual mfa device.
- base32_
string_ strseed - The base32 seed defined as specified in RFC3548. The
base_32_string_seed
is base64-encoded. - enable_
date str - The date and time when the virtual MFA device was enabled.
- path str
- The path for the virtual MFA device.
- qr_
code_ strpng - A 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. - Mapping[str, str]
- Map of resource tags for the virtual mfa device. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - user_
name str - The associated IAM User name if the virtual MFA device is enabled.
- virtual_
mfa_ strdevice_ name - The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
- arn String
- The Amazon Resource Name (ARN) specifying the virtual mfa device.
- base32String
Seed String - The base32 seed defined as specified in RFC3548. The
base_32_string_seed
is base64-encoded. - enable
Date String - The date and time when the virtual MFA device was enabled.
- path String
- The path for the virtual MFA device.
- qr
Code StringPng - A 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. - Map<String>
- Map of resource tags for the virtual mfa device. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - user
Name String - The associated IAM User name if the virtual MFA device is enabled.
- virtual
Mfa StringDevice Name - The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
Import
Using pulumi import
, import IAM Virtual MFA Devices using the arn
. For example:
$ pulumi import aws:iam/virtualMfaDevice:VirtualMfaDevice example arn:aws:iam::123456789012:mfa/example
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.