UNPKG

@pulumi/aws

Version:

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

108 lines 5.45 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.PortfolioShare = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a Service Catalog Portfolio Share. Shares the specified portfolio with the specified account or organization node. You can share portfolios to an organization, an organizational unit, or a specific account. * * If the portfolio share with the specified account or organization node already exists, using this resource to re-create the share will have no effect and will not return an error. You can then use this resource to update the share. * * > **NOTE:** Shares to an organization node can only be created by the management account of an organization or by a delegated administrator. If a delegated admin is de-registered, they can no longer create portfolio shares. * * > **NOTE:** AWSOrganizationsAccess must be enabled in order to create a portfolio share to an organization node. * * > **NOTE:** You can't share a shared resource, including portfolios that contain a shared product. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.servicecatalog.PortfolioShare("example", { * principalId: "012128675309", * portfolioId: exampleAwsServicecatalogPortfolio.id, * type: "ACCOUNT", * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_servicecatalog_portfolio_share` using the portfolio share ID. For example: * * ```sh * $ pulumi import aws:servicecatalog/portfolioShare:PortfolioShare example port-12344321:ACCOUNT:123456789012 * ``` */ class PortfolioShare extends pulumi.CustomResource { /** * Get an existing PortfolioShare 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 PortfolioShare(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of PortfolioShare. 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'] === PortfolioShare.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["acceptLanguage"] = state ? state.acceptLanguage : undefined; resourceInputs["accepted"] = state ? state.accepted : undefined; resourceInputs["portfolioId"] = state ? state.portfolioId : undefined; resourceInputs["principalId"] = state ? state.principalId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["sharePrincipals"] = state ? state.sharePrincipals : undefined; resourceInputs["shareTagOptions"] = state ? state.shareTagOptions : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["waitForAcceptance"] = state ? state.waitForAcceptance : undefined; } else { const args = argsOrState; if ((!args || args.portfolioId === undefined) && !opts.urn) { throw new Error("Missing required property 'portfolioId'"); } if ((!args || args.principalId === undefined) && !opts.urn) { throw new Error("Missing required property 'principalId'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["acceptLanguage"] = args ? args.acceptLanguage : undefined; resourceInputs["portfolioId"] = args ? args.portfolioId : undefined; resourceInputs["principalId"] = args ? args.principalId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["sharePrincipals"] = args ? args.sharePrincipals : undefined; resourceInputs["shareTagOptions"] = args ? args.shareTagOptions : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["waitForAcceptance"] = args ? args.waitForAcceptance : undefined; resourceInputs["accepted"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(PortfolioShare.__pulumiType, name, resourceInputs, opts); } } exports.PortfolioShare = PortfolioShare; /** @internal */ PortfolioShare.__pulumiType = 'aws:servicecatalog/portfolioShare:PortfolioShare'; //# sourceMappingURL=portfolioShare.js.map