1. Packages
  2. AWS Classic
  3. API Docs
  4. servicecatalog
  5. Constraint

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.servicecatalog.Constraint

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    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",
        }))
    
    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
    	})
    }
    
    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 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
    

    Create Constraint Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Constraint(name: string, args: ConstraintArgs, opts?: CustomResourceOptions);
    @overload
    def Constraint(resource_name: str,
                   args: ConstraintArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def Constraint(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   parameters: Optional[str] = None,
                   portfolio_id: Optional[str] = None,
                   product_id: Optional[str] = None,
                   type: Optional[str] = None,
                   accept_language: Optional[str] = None,
                   description: Optional[str] = None)
    func NewConstraint(ctx *Context, name string, args ConstraintArgs, opts ...ResourceOption) (*Constraint, error)
    public Constraint(string name, ConstraintArgs args, CustomResourceOptions? opts = null)
    public Constraint(String name, ConstraintArgs args)
    public Constraint(String name, ConstraintArgs args, CustomResourceOptions options)
    
    type: aws:servicecatalog:Constraint
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ConstraintArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ConstraintArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ConstraintArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConstraintArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConstraintArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var constraintResource = new Aws.ServiceCatalog.Constraint("constraintResource", new()
    {
        Parameters = "string",
        PortfolioId = "string",
        ProductId = "string",
        Type = "string",
        AcceptLanguage = "string",
        Description = "string",
    });
    
    example, err := servicecatalog.NewConstraint(ctx, "constraintResource", &servicecatalog.ConstraintArgs{
    	Parameters:     pulumi.String("string"),
    	PortfolioId:    pulumi.String("string"),
    	ProductId:      pulumi.String("string"),
    	Type:           pulumi.String("string"),
    	AcceptLanguage: pulumi.String("string"),
    	Description:    pulumi.String("string"),
    })
    
    var constraintResource = new Constraint("constraintResource", ConstraintArgs.builder()
        .parameters("string")
        .portfolioId("string")
        .productId("string")
        .type("string")
        .acceptLanguage("string")
        .description("string")
        .build());
    
    constraint_resource = aws.servicecatalog.Constraint("constraintResource",
        parameters="string",
        portfolio_id="string",
        product_id="string",
        type="string",
        accept_language="string",
        description="string")
    
    const constraintResource = new aws.servicecatalog.Constraint("constraintResource", {
        parameters: "string",
        portfolioId: "string",
        productId: "string",
        type: "string",
        acceptLanguage: "string",
        description: "string",
    });
    
    type: aws:servicecatalog:Constraint
    properties:
        acceptLanguage: string
        description: string
        parameters: string
        portfolioId: string
        productId: string
        type: string
    

    Constraint Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Constraint resource accepts the following input properties:

    Parameters string
    Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.
    PortfolioId string
    Portfolio identifier.
    ProductId string
    Product identifier.
    Type string

    Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE.

    The following arguments are optional:

    AcceptLanguage string
    Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.
    Description string
    Description of the constraint.
    Parameters string
    Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.
    PortfolioId string
    Portfolio identifier.
    ProductId string
    Product identifier.
    Type string

    Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE.

    The following arguments are optional:

    AcceptLanguage string
    Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.
    Description string
    Description of the constraint.
    parameters String
    Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.
    portfolioId String
    Portfolio identifier.
    productId String
    Product identifier.
    type String

    Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE.

    The following arguments are optional:

    acceptLanguage String
    Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.
    description String
    Description of the constraint.
    parameters string
    Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.
    portfolioId string
    Portfolio identifier.
    productId string
    Product identifier.
    type string

    Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE.

    The following arguments are optional:

    acceptLanguage string
    Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.
    description string
    Description of the constraint.
    parameters str
    Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.
    portfolio_id str
    Portfolio identifier.
    product_id str
    Product identifier.
    type str

    Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE.

    The following arguments are optional:

    accept_language str
    Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.
    description str
    Description of the constraint.
    parameters String
    Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.
    portfolioId String
    Portfolio identifier.
    productId String
    Product identifier.
    type String

    Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE.

    The following arguments are optional:

    acceptLanguage String
    Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.
    description String
    Description of the constraint.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Constraint resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Owner string
    Owner of the constraint.
    Status string
    Id string
    The provider-assigned unique ID for this managed resource.
    Owner string
    Owner of the constraint.
    Status string
    id String
    The provider-assigned unique ID for this managed resource.
    owner String
    Owner of the constraint.
    status String
    id string
    The provider-assigned unique ID for this managed resource.
    owner string
    Owner of the constraint.
    status string
    id str
    The provider-assigned unique ID for this managed resource.
    owner str
    Owner of the constraint.
    status str
    id String
    The provider-assigned unique ID for this managed resource.
    owner String
    Owner of the constraint.
    status String

    Look up Existing Constraint Resource

    Get an existing Constraint resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ConstraintState, opts?: CustomResourceOptions): Constraint
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            accept_language: Optional[str] = None,
            description: Optional[str] = None,
            owner: Optional[str] = None,
            parameters: Optional[str] = None,
            portfolio_id: Optional[str] = None,
            product_id: Optional[str] = None,
            status: Optional[str] = None,
            type: Optional[str] = None) -> Constraint
    func GetConstraint(ctx *Context, name string, id IDInput, state *ConstraintState, opts ...ResourceOption) (*Constraint, error)
    public static Constraint Get(string name, Input<string> id, ConstraintState? state, CustomResourceOptions? opts = null)
    public static Constraint get(String name, Output<String> id, ConstraintState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AcceptLanguage string
    Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.
    Description string
    Description of the constraint.
    Owner string
    Owner of the constraint.
    Parameters string
    Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.
    PortfolioId string
    Portfolio identifier.
    ProductId string
    Product identifier.
    Status string
    Type string

    Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE.

    The following arguments are optional:

    AcceptLanguage string
    Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.
    Description string
    Description of the constraint.
    Owner string
    Owner of the constraint.
    Parameters string
    Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.
    PortfolioId string
    Portfolio identifier.
    ProductId string
    Product identifier.
    Status string
    Type string

    Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE.

    The following arguments are optional:

    acceptLanguage String
    Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.
    description String
    Description of the constraint.
    owner String
    Owner of the constraint.
    parameters String
    Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.
    portfolioId String
    Portfolio identifier.
    productId String
    Product identifier.
    status String
    type String

    Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE.

    The following arguments are optional:

    acceptLanguage string
    Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.
    description string
    Description of the constraint.
    owner string
    Owner of the constraint.
    parameters string
    Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.
    portfolioId string
    Portfolio identifier.
    productId string
    Product identifier.
    status string
    type string

    Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE.

    The following arguments are optional:

    accept_language str
    Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.
    description str
    Description of the constraint.
    owner str
    Owner of the constraint.
    parameters str
    Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.
    portfolio_id str
    Portfolio identifier.
    product_id str
    Product identifier.
    status str
    type str

    Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE.

    The following arguments are optional:

    acceptLanguage String
    Language code. Valid values: en (English), jp (Japanese), zh (Chinese). Default value is en.
    description String
    Description of the constraint.
    owner String
    Owner of the constraint.
    parameters String
    Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.
    portfolioId String
    Portfolio identifier.
    productId String
    Product identifier.
    status String
    type String

    Type of constraint. Valid values are LAUNCH, NOTIFICATION, RESOURCE_UPDATE, STACKSET, and TEMPLATE.

    The following arguments are optional:

    Import

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

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

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi