UNPKG

@pulumi/aws

Version:

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

109 lines 5 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.Constraint = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a Service Catalog Constraint. * * > **NOTE:** This resource does not associate a Service Catalog product and portfolio. However, the product and portfolio must be associated (see the `aws.servicecatalog.ProductPortfolioAssociation` resource) prior to creating a constraint or you will receive an error. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.servicecatalog.Constraint("example", { * description: "Back off, man. I'm a scientist.", * portfolioId: exampleAwsServicecatalogPortfolio.id, * productId: exampleAwsServicecatalogProduct.id, * type: "LAUNCH", * parameters: JSON.stringify({ * RoleArn: "arn:aws:iam::123456789012:role/LaunchRole", * }), * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_servicecatalog_constraint` using the constraint ID. For example: * * ```sh * $ pulumi import aws:servicecatalog/constraint:Constraint example cons-nmdkb6cgxfcrs * ``` */ class Constraint extends pulumi.CustomResource { /** * Get an existing Constraint 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 Constraint(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Constraint. 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'] === Constraint.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["acceptLanguage"] = state ? state.acceptLanguage : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["owner"] = state ? state.owner : undefined; resourceInputs["parameters"] = state ? state.parameters : undefined; resourceInputs["portfolioId"] = state ? state.portfolioId : undefined; resourceInputs["productId"] = state ? state.productId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.parameters === undefined) && !opts.urn) { throw new Error("Missing required property 'parameters'"); } if ((!args || args.portfolioId === undefined) && !opts.urn) { throw new Error("Missing required property 'portfolioId'"); } if ((!args || args.productId === undefined) && !opts.urn) { throw new Error("Missing required property 'productId'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["acceptLanguage"] = args ? args.acceptLanguage : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["parameters"] = args ? args.parameters : undefined; resourceInputs["portfolioId"] = args ? args.portfolioId : undefined; resourceInputs["productId"] = args ? args.productId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["owner"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Constraint.__pulumiType, name, resourceInputs, opts); } } exports.Constraint = Constraint; /** @internal */ Constraint.__pulumiType = 'aws:servicecatalog/constraint:Constraint'; //# sourceMappingURL=constraint.js.map