ConstraintArgs

data class ConstraintArgs(val acceptLanguage: Output<String>? = null, val description: Output<String>? = null, val parameters: Output<String>? = null, val portfolioId: Output<String>? = null, val productId: Output<String>? = null, val type: Output<String>? = null) : ConvertibleToJava<ConstraintArgs>

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

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 pulumi
import json
import pulumi_aws as aws
example = aws.servicecatalog.Constraint("example",
description="Back off, man. I'm a scientist.",
portfolio_id=example_aws_servicecatalog_portfolio["id"],
product_id=example_aws_servicecatalog_product["id"],
type="LAUNCH",
parameters=json.dumps({
"RoleArn": "arn:aws:iam::123456789012:role/LaunchRole",
}))
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.ServiceCatalog.Constraint("example", new()
{
Description = "Back off, man. I'm a scientist.",
PortfolioId = exampleAwsServicecatalogPortfolio.Id,
ProductId = exampleAwsServicecatalogProduct.Id,
Type = "LAUNCH",
Parameters = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["RoleArn"] = "arn:aws:iam::123456789012:role/LaunchRole",
}),
});
});
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/servicecatalog"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"RoleArn": "arn:aws:iam::123456789012:role/LaunchRole",
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = servicecatalog.NewConstraint(ctx, "example", &servicecatalog.ConstraintArgs{
Description: pulumi.String("Back off, man. I'm a scientist."),
PortfolioId: pulumi.Any(exampleAwsServicecatalogPortfolio.Id),
ProductId: pulumi.Any(exampleAwsServicecatalogProduct.Id),
Type: pulumi.String("LAUNCH"),
Parameters: pulumi.String(json0),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.servicecatalog.Constraint;
import com.pulumi.aws.servicecatalog.ConstraintArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Constraint("example", ConstraintArgs.builder()
.description("Back off, man. I'm a scientist.")
.portfolioId(exampleAwsServicecatalogPortfolio.id())
.productId(exampleAwsServicecatalogProduct.id())
.type("LAUNCH")
.parameters(serializeJson(
jsonObject(
jsonProperty("RoleArn", "arn:aws:iam::123456789012:role/LaunchRole")
)))
.build());
}
}
resources:
example:
type: aws:servicecatalog:Constraint
properties:
description: Back off, man. I'm a scientist.
portfolioId: ${exampleAwsServicecatalogPortfolio.id}
productId: ${exampleAwsServicecatalogProduct.id}
type: LAUNCH
parameters:
fn::toJSON:
RoleArn: arn:aws:iam::123456789012:role/LaunchRole

Import

Using pulumi import, import aws_servicecatalog_constraint using the constraint ID. For example:

$ pulumi import aws:servicecatalog/constraint:Constraint example cons-nmdkb6cgxfcrs

Constructors

Link copied to clipboard
constructor(acceptLanguage: Output<String>? = null, description: Output<String>? = null, parameters: Output<String>? = null, portfolioId: Output<String>? = null, productId: Output<String>? = null, type: Output<String>? = null)

Properties

Link copied to clipboard
val acceptLanguage: Output<String>? = null

Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.

Link copied to clipboard
val description: Output<String>? = null

Description of the constraint.

Link copied to clipboard
val parameters: Output<String>? = null

Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.

Link copied to clipboard
val portfolioId: Output<String>? = null

Portfolio identifier.

Link copied to clipboard
val productId: Output<String>? = null

Product identifier.

Link copied to clipboard
val type: Output<String>? = null

Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE. The following arguments are optional:

Functions

Link copied to clipboard
open override fun toJava(): ConstraintArgs