@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
109 lines • 4.63 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.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, { ...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?.acceptLanguage;
resourceInputs["description"] = state?.description;
resourceInputs["owner"] = state?.owner;
resourceInputs["parameters"] = state?.parameters;
resourceInputs["portfolioId"] = state?.portfolioId;
resourceInputs["productId"] = state?.productId;
resourceInputs["region"] = state?.region;
resourceInputs["status"] = state?.status;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.parameters === undefined && !opts.urn) {
throw new Error("Missing required property 'parameters'");
}
if (args?.portfolioId === undefined && !opts.urn) {
throw new Error("Missing required property 'portfolioId'");
}
if (args?.productId === undefined && !opts.urn) {
throw new Error("Missing required property 'productId'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["acceptLanguage"] = args?.acceptLanguage;
resourceInputs["description"] = args?.description;
resourceInputs["parameters"] = args?.parameters;
resourceInputs["portfolioId"] = args?.portfolioId;
resourceInputs["productId"] = args?.productId;
resourceInputs["region"] = args?.region;
resourceInputs["type"] = args?.type;
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