@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
95 lines • 4.4 kB
JavaScript
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.VirtualMfaDevice = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* 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:**
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.iam.VirtualMfaDevice("example", {virtualMfaDeviceName: "example"});
* ```
*
* ## 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
* ```
*/
class VirtualMfaDevice extends pulumi.CustomResource {
/**
* Get an existing VirtualMfaDevice resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new VirtualMfaDevice(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of VirtualMfaDevice. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === VirtualMfaDevice.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["base32StringSeed"] = state?.base32StringSeed;
resourceInputs["enableDate"] = state?.enableDate;
resourceInputs["path"] = state?.path;
resourceInputs["qrCodePng"] = state?.qrCodePng;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["userName"] = state?.userName;
resourceInputs["virtualMfaDeviceName"] = state?.virtualMfaDeviceName;
}
else {
const args = argsOrState;
if (args?.virtualMfaDeviceName === undefined && !opts.urn) {
throw new Error("Missing required property 'virtualMfaDeviceName'");
}
resourceInputs["path"] = args?.path;
resourceInputs["tags"] = args?.tags;
resourceInputs["virtualMfaDeviceName"] = args?.virtualMfaDeviceName;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["base32StringSeed"] = undefined /*out*/;
resourceInputs["enableDate"] = undefined /*out*/;
resourceInputs["qrCodePng"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["userName"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(VirtualMfaDevice.__pulumiType, name, resourceInputs, opts);
}
}
exports.VirtualMfaDevice = VirtualMfaDevice;
/** @internal */
VirtualMfaDevice.__pulumiType = 'aws:iam/virtualMfaDevice:VirtualMfaDevice';
//# sourceMappingURL=virtualMfaDevice.js.map
;