@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
131 lines • 4.91 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.User = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing QuickSight User
*
* ## Example Usage
*
* ### Create User With IAM Identity Type Using an IAM Role
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.quicksight.User("example", {
* email: "author1@example.com",
* identityType: "IAM",
* userRole: "AUTHOR",
* iamArn: "arn:aws:iam::123456789012:role/AuthorRole",
* sessionName: "author1",
* });
* ```
*
* ### Create User With IAM Identity Type Using an IAM User
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.quicksight.User("example", {
* email: "authorpro1@example.com",
* identityType: "IAM",
* userRole: "AUTHOR_PRO",
* iamArn: "arn:aws:iam::123456789012:user/authorpro1",
* });
* ```
*
* ### Create User With QuickSight Identity Type in Non-Default Namespace
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.quicksight.User("example", {
* email: "reader1@example.com",
* identityType: "QUICKSIGHT",
* userRole: "READER",
* namespace: "example",
* userName: "reader1",
* });
* ```
*
* ## Import
*
* You cannot import this resource.
*/
class User extends pulumi.CustomResource {
/**
* Get an existing User 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 User(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of User. 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'] === User.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["awsAccountId"] = state?.awsAccountId;
resourceInputs["email"] = state?.email;
resourceInputs["iamArn"] = state?.iamArn;
resourceInputs["identityType"] = state?.identityType;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["region"] = state?.region;
resourceInputs["sessionName"] = state?.sessionName;
resourceInputs["userInvitationUrl"] = state?.userInvitationUrl;
resourceInputs["userName"] = state?.userName;
resourceInputs["userRole"] = state?.userRole;
}
else {
const args = argsOrState;
if (args?.email === undefined && !opts.urn) {
throw new Error("Missing required property 'email'");
}
if (args?.identityType === undefined && !opts.urn) {
throw new Error("Missing required property 'identityType'");
}
if (args?.userRole === undefined && !opts.urn) {
throw new Error("Missing required property 'userRole'");
}
resourceInputs["awsAccountId"] = args?.awsAccountId;
resourceInputs["email"] = args?.email;
resourceInputs["iamArn"] = args?.iamArn;
resourceInputs["identityType"] = args?.identityType;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["region"] = args?.region;
resourceInputs["sessionName"] = args?.sessionName;
resourceInputs["userName"] = args?.userName;
resourceInputs["userRole"] = args?.userRole;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["userInvitationUrl"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(User.__pulumiType, name, resourceInputs, opts);
}
}
exports.User = User;
/** @internal */
User.__pulumiType = 'aws:quicksight/user:User';
//# sourceMappingURL=user.js.map