UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

98 lines 4.68 kB
"use strict"; // *** 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.UserLoginProfile = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an IAM User Login Profile with limited support for password creation during this provider resource creation. Uses PGP to encrypt the password for safe transport to the user. PGP keys can be obtained from Keybase. * * > To reset an IAM User login password via this provider, you can use delete and recreate this resource or change any of the arguments. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.iam.User("example", { * name: "example", * path: "/", * forceDestroy: true, * }); * const exampleUserLoginProfile = new aws.iam.UserLoginProfile("example", { * user: example.name, * pgpKey: "keybase:some_person_that_exists", * }); * export const password = exampleUserLoginProfile.encryptedPassword; * ``` * * ## Import * * Using `pulumi import`, import IAM User Login Profiles without password information via the IAM User name. For example: * * ```sh * $ pulumi import aws:iam/userLoginProfile:UserLoginProfile example myusername * ``` * Since Pulumi has no method to read the PGP or password information during import, use the resource options `ignore_changes` argument to ignore them (unless you want to recreate a password). For example: */ class UserLoginProfile extends pulumi.CustomResource { /** * Get an existing UserLoginProfile 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 UserLoginProfile(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of UserLoginProfile. 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'] === UserLoginProfile.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["encryptedPassword"] = state ? state.encryptedPassword : undefined; resourceInputs["keyFingerprint"] = state ? state.keyFingerprint : undefined; resourceInputs["password"] = state ? state.password : undefined; resourceInputs["passwordLength"] = state ? state.passwordLength : undefined; resourceInputs["passwordResetRequired"] = state ? state.passwordResetRequired : undefined; resourceInputs["pgpKey"] = state ? state.pgpKey : undefined; resourceInputs["user"] = state ? state.user : undefined; } else { const args = argsOrState; if ((!args || args.user === undefined) && !opts.urn) { throw new Error("Missing required property 'user'"); } resourceInputs["passwordLength"] = args ? args.passwordLength : undefined; resourceInputs["passwordResetRequired"] = args ? args.passwordResetRequired : undefined; resourceInputs["pgpKey"] = args ? args.pgpKey : undefined; resourceInputs["user"] = args ? args.user : undefined; resourceInputs["encryptedPassword"] = undefined /*out*/; resourceInputs["keyFingerprint"] = undefined /*out*/; resourceInputs["password"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["password"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(UserLoginProfile.__pulumiType, name, resourceInputs, opts); } } exports.UserLoginProfile = UserLoginProfile; /** @internal */ UserLoginProfile.__pulumiType = 'aws:iam/userLoginProfile:UserLoginProfile'; //# sourceMappingURL=userLoginProfile.js.map