# CloudFormationProduct

A Service Catalog Cloudformation Product.

Extends: [Construct](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Construct.html) › [Resource](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Resource.html) › [Product](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_servicecatalog.Product.html) › CloudFormationProduct
Implements: [IResource](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResource.html), [IProduct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_servicecatalog.IProduct.html), [IEnvironmentAware](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.IEnvironmentAware.html), [ICloudFormationProductRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_servicecatalog.ICloudFormationProductRef.html), IConstruct, IDependable

- CloudFormation: [`AWS::ServiceCatalog::CloudFormationProduct`](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-servicecatalog-cloudformationproduct.html)
- L1 type: [`CfnCloudFormationProduct`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_servicecatalog.CfnCloudFormationProduct.html)
- Source: [`aws-servicecatalog/lib/product.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-servicecatalog/lib/product.ts#L191)
- Type last changed: v2.196.0 · 16 May 2025

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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"))
    } }
});
```

Golang:

```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

TypeScript:

```ts
new CloudFormationProduct(scope: Construct, id: string, props: CloudFormationProductProps)
```

Python:

```python
CloudFormationProduct(scope: Construct, id: str, props: CloudFormationProductProps)
```

Java:

```java
new CloudFormationProduct(Construct scope, String id, CloudFormationProductProps props)
```

C# / .NET:

```csharp
new CloudFormationProduct(Construct scope, string id, CloudFormationProductProps props)
```

Golang:

```go
NewCloudFormationProduct(Scope Construct, Id *string, Props CloudFormationProductProps)
```

## Construct Props

- `description`: string — The description of the product.

  **Default:** No description provided

- `distributor`: string — The distributor of the product.

  **Default:** No distributor provided

- `messageLanguage`: [MessageLanguage](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_servicecatalog.MessageLanguage.html) = English — The language code.

  Controls language for logging and errors.

- `owner`: string (required) — The owner of the product.

- `productName`: string (required) — The name of the product.

- `productVersions`: [CloudFormationProductVersion](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_servicecatalog.CloudFormationProductVersion.html)[] (required) — The configuration of the product version.

- `replaceProductVersionIds`: boolean = false — Whether to give provisioning artifacts a new unique identifier when the product attributes or provisioning artifacts is updated.

- `supportDescription`: string — The support information about the product.

  **Default:** No support description provided

- `supportEmail`: string — The contact email for product support.

  **Default:** No support email provided

- `supportUrl`: string — The contact URL for product support.

  **Default:** No support URL provided

- `tagOptions`: [TagOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_servicecatalog.TagOptions.html) — TagOptions associated directly to a product.

  **Default:** No tagOptions provided

## Properties

- `assetBuckets`: [IBucket](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.IBucket.html)[] — The asset bucket of a product created via product stack.

  **Default:** Empty - no assets are used in this product

- `cloudFormationProductRef`: [CloudFormationProductReference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_servicecatalog.CloudFormationProductReference.html) — A reference to a CloudFormationProduct resource.

- `env`: [ResourceEnvironment](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) — The environment this resource belongs to.

  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.

- `node`: [Node](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `productArn`: string — The ARN of the product.

- `productId`: string — The id of the product.

- `PROPERTY_INJECTION_ID`: string (static) — Uniquely identifies this class.

- `stack`: [Stack](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Stack.html) — The stack in which this resource is defined.

## Methods

- `applyCrossStackReferenceStrength(strength: ReferenceStrength): void` — Override the cross-stack reference strength for this resource.

  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**

  - `strength` — - The reference strength to use for this resource.

- `applyRemovalPolicy(policy: RemovalPolicy): void` — Apply the given removal policy to this resource.

  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): void` — 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` (static) — Creates a Product construct that represents an external product.

  **Parameters**

  - `scope` — The parent creating construct (usually `this`).
  - `id` — The construct's name.
  - `productArn` — Product Arn.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  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**

  - `x` — Any object.

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

- `isOwnedResource(construct: IConstruct): boolean` (static) — Returns true if the construct was created by CDK, and false otherwise.

- `isResource(construct: IConstruct): boolean` (static) — Check whether the given construct is a Resource.

- `toString(): string` — Returns a string representation of this construct.

- `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.
