UNPKG

@pulumi/aws

Version:

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

108 lines 5.07 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, { ...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?.acceptLanguage; resourceInputs["accepted"] = state?.accepted; resourceInputs["portfolioId"] = state?.portfolioId; resourceInputs["principalId"] = state?.principalId; resourceInputs["region"] = state?.region; resourceInputs["sharePrincipals"] = state?.sharePrincipals; resourceInputs["shareTagOptions"] = state?.shareTagOptions; resourceInputs["type"] = state?.type; resourceInputs["waitForAcceptance"] = state?.waitForAcceptance; } else { const args = argsOrState; if (args?.portfolioId === undefined && !opts.urn) { throw new Error("Missing required property 'portfolioId'"); } if (args?.principalId === undefined && !opts.urn) { throw new Error("Missing required property 'principalId'"); } if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["acceptLanguage"] = args?.acceptLanguage; resourceInputs["portfolioId"] = args?.portfolioId; resourceInputs["principalId"] = args?.principalId; resourceInputs["region"] = args?.region; resourceInputs["sharePrincipals"] = args?.sharePrincipals; resourceInputs["shareTagOptions"] = args?.shareTagOptions; resourceInputs["type"] = args?.type; resourceInputs["waitForAcceptance"] = args?.waitForAcceptance; 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