Skip to content
v2.275.0

CloudFormationProduct L2 construct ​

A Service Catalog Cloudformation Product.

Example ​

ts
import * as cdk from 'aws-cdk-lib';

class S3BucketProduct extends servicecatalog.ProductStack {
  constructor(scope: Construct, id: string) {
    super(scope, id);

    new s3.Bucket(this, 'BucketProduct');
  }
}

const product = new servicecatalog.CloudFormationProduct(this, 'Product', {
  productName: "My Product",
  owner: "Product Owner",
  productVersions: [
    {
      productVersionName: "v1",
      cloudFormationTemplate: servicecatalog.CloudFormationTemplate.fromProductStack(new S3BucketProduct(this, 'S3BucketProduct')),
    },
  ],
});
python
import aws_cdk as cdk


class S3BucketProduct(servicecatalog.ProductStack):
    def __init__(self, scope, id):
        super().__init__(scope, id)

        s3.Bucket(self, "BucketProduct")

product = servicecatalog.CloudFormationProduct(self, "Product",
    product_name="My Product",
    owner="Product Owner",
    product_versions=[servicecatalog.CloudFormationProductVersion(
        product_version_name="v1",
        cloud_formation_template=servicecatalog.CloudFormationTemplate.from_product_stack(S3BucketProduct(self, "S3BucketProduct"))
    )
    ]
)
java
import software.amazon.awscdk.*;


public class S3BucketProduct extends ProductStack {
    public S3BucketProduct(Construct scope, String id) {
        super(scope, id);

        new Bucket(this, "BucketProduct");
    }
}

CloudFormationProduct product = CloudFormationProduct.Builder.create(this, "Product")
        .productName("My Product")
        .owner("Product Owner")
        .productVersions(List.of(CloudFormationProductVersion.builder()
                .productVersionName("v1")
                .cloudFormationTemplate(CloudFormationTemplate.fromProductStack(new S3BucketProduct(this, "S3BucketProduct")))
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK;


class S3BucketProduct : ProductStack
{
    public S3BucketProduct(Construct scope, string id) : base(scope, id)
    {

        new Bucket(this, "BucketProduct");
    }
}

var product = new CloudFormationProduct(this, "Product", new CloudFormationProductProps {
    ProductName = "My Product",
    Owner = "Product Owner",
    ProductVersions = new [] { new CloudFormationProductVersion {
        ProductVersionName = "v1",
        CloudFormationTemplate = CloudFormationTemplate.FromProductStack(new S3BucketProduct(this, "S3BucketProduct"))
    } }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import cdk "github.com/aws/aws-cdk-go/awscdk"


type s3BucketProduct struct {
	ProductStack
}

func newS3BucketProduct(scope Construct, id *string) *s3BucketProduct {
	this := &s3BucketProduct{}
	servicecatalog.NewProductStack_Override(this, scope, id)

	s3.NewBucket(this, jsii.String("BucketProduct"))
	return this
}

product := servicecatalog.NewCloudFormationProduct(this, jsii.String("Product"), &CloudFormationProductProps{
	ProductName: jsii.String("My Product"),
	Owner: jsii.String("Product Owner"),
	ProductVersions: []CloudFormationProductVersion{
		&CloudFormationProductVersion{
			ProductVersionName: jsii.String("v1"),
			CloudFormationTemplate: servicecatalog.CloudFormationTemplate_FromProductStack(newS3BucketProduct(this, jsii.String("S3BucketProduct"))),
		},
	},
})

Initializer ​

ts
new CloudFormationProduct(scope: Construct, id: string, props: CloudFormationProductProps)
python
CloudFormationProduct(scope: Construct, id: str, props: CloudFormationProductProps)
java
new CloudFormationProduct(Construct scope, String id, CloudFormationProductProps props)
csharp
new CloudFormationProduct(Construct scope, string id, CloudFormationProductProps props)
go
NewCloudFormationProduct(Scope Construct, Id *string, Props CloudFormationProductProps)

Construct Props ​

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
The description of the product.

Default: No description provided

distributoroptionalstringdistributoroptionalstrdistributoroptionalStringDistributoroptionalstringDistributoroptional*string#
The distributor of the product.

Default: No distributor provided

messageLanguageoptionalMessageLanguagemessage_languageoptionalMessageLanguagemessageLanguageoptionalMessageLanguageMessageLanguageoptionalMessageLanguageMessageLanguageoptionalMessageLanguage= English#
The language code.

Controls language for logging and errors.

ownerstringownerstrownerStringOwnerstringOwner*stringrequired#
The owner of the product.
productNamestringproduct_namestrproductNameStringProductNamestringProductName*stringrequired#
The name of the product.
productVersionsCloudFormationProductVersion[]product_versionstyping.List[CloudFormationProductVersion]productVersionsList<CloudFormationProductVersion>ProductVersionsCloudFormationProductVersion[]ProductVersions*[]CloudFormationProductVersionrequired#
The configuration of the product version.
replaceProductVersionIdsoptionalbooleanreplace_product_version_idsoptionalboolreplaceProductVersionIdsoptionalBooleanReplaceProductVersionIdsoptionalboolReplaceProductVersionIdsoptional*bool= false#
Whether to give provisioning artifacts a new unique identifier when the product attributes or provisioning artifacts is updated.
supportDescriptionoptionalstringsupport_descriptionoptionalstrsupportDescriptionoptionalStringSupportDescriptionoptionalstringSupportDescriptionoptional*string#
The support information about the product.

Default: No support description provided

supportEmailoptionalstringsupport_emailoptionalstrsupportEmailoptionalStringSupportEmailoptionalstringSupportEmailoptional*string#
The contact email for product support.

Default: No support email provided

supportUrloptionalstringsupport_urloptionalstrsupportUrloptionalStringSupportUrloptionalstringSupportUrloptional*string#
The contact URL for product support.

Default: No support URL provided

tagOptionsoptionalTagOptionstag_optionsoptionalTagOptionstagOptionsoptionalTagOptionsTagOptionsoptionalTagOptionsTagOptionsoptionalTagOptions#
TagOptions associated directly to a product.

Default: No tagOptions provided

Properties ​

assetBucketsIBucket[]asset_bucketstyping.List[IBucket]assetBucketsList<IBucket>AssetBucketsIBucket[]AssetBuckets*[]IBucket#
The asset bucket of a product created via product stack.

Default: Empty - no assets are used in this product

cloudFormationProductRefCloudFormationProductReferencecloud_formation_product_refCloudFormationProductReferencecloudFormationProductRefCloudFormationProductReferenceCloudFormationProductRefCloudFormationProductReferenceCloudFormationProductRefCloudFormationProductReference#
A reference to a CloudFormationProduct resource.
The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

nodeNodenodeNodenodeNodeNodeNodeNodeNode#
The tree node.
productArnstringproduct_arnstrproductArnStringProductArnstringProductArn*string#
The ARN of the product.
productIdstringproduct_idstrproductIdStringProductIdstringProductId*string#
The id of the product.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringstatic#
Uniquely identifies this class.
stackStackstackStackstackStackStackStackStackStack#
The stack in which this resource is defined.

Methods ​

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

associateTagOptions(tagOptions: TagOptions): voiddef associate_tag_options(self, tag_options: TagOptions) -> Nonepublic void associateTagOptions(TagOptions tagOptions)public void AssociateTagOptions(TagOptions tagOptions)func AssociateTagOptions(TagOptions TagOptions)#
Associate Tag Options.

A TagOption is a key-value pair managed in AWS Service Catalog. It is not an AWS tag, but serves as a template for creating an AWS tag based on the TagOption.

fromProductArn(scope: Construct, id: string, productArn: string): IProduct@staticmethod def from_product_arn(scope: Construct, id: str, product_arn: str) -> IProductpublic static IProduct fromProductArn(Construct scope, String id, String productArn)public static IProduct FromProductArn(Construct scope, string id, string productArn)func FromProductArn(Scope Construct, Id *string, ProductArn *string) IProductstatic#
Creates a Product construct that represents an external product.
3 parameters

Parameters

  • scopescopescopescopeScope — The parent creating construct (usually this).
  • ididididId — The construct's name.
  • productArnproduct_arnproductArnproductArnProductArn — Product Arn.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.