aws-cdk-lib.aws_servicecatalog.ProductStackHistory

class ProductStackHistory (construct)

LanguageType name
.NETAmazon.CDK.AWS.Servicecatalog.ProductStackHistory
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsservicecatalog#ProductStackHistory
Javasoftware.amazon.awscdk.services.servicecatalog.ProductStackHistory
Pythonaws_cdk.aws_servicecatalog.ProductStackHistory
TypeScript (source)aws-cdk-lib » aws_servicecatalog » ProductStackHistory

Implements IConstruct, IDependable

A Construct that contains a Service Catalog product stack with its previous deployments maintained.

Example

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

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

const productStackHistory = new servicecatalog.ProductStackHistory(this, 'ProductStackHistory', {
  productStack: new S3BucketProduct(this, 'S3BucketProduct'),
  currentVersionName: 'v2',
  currentVersionLocked: true
});

const product = new servicecatalog.CloudFormationProduct(this, 'MyFirstProduct', {
  productName: "My Product",
  owner: "Product Owner",
  productVersions: [
    productStackHistory.currentVersion(),
  ],
});

Initializer

new ProductStackHistory(scope: Construct, id: string, props: ProductStackHistoryProps)

Parameters

  • scope Construct
  • id string
  • props ProductStackHistoryProps

Construct Props

NameTypeDescription
currentVersionLockedbooleanIf this is set to true, the ProductStack will not be overwritten if a snapshot is found for the currentVersionName.
currentVersionNamestringThe current version name of the ProductStack.
productStackProductStackThe ProductStack whose history will be retained as a snapshot.
description?stringThe description of the product version.
directory?stringThe directory where template snapshots will be stored.
validateTemplate?booleanWhether the specified product template will be validated by CloudFormation.

currentVersionLocked

Type: boolean

If this is set to true, the ProductStack will not be overwritten if a snapshot is found for the currentVersionName.


currentVersionName

Type: string

The current version name of the ProductStack.


productStack

Type: ProductStack

The ProductStack whose history will be retained as a snapshot.


description?

Type: string (optional, default: No description provided)

The description of the product version.


directory?

Type: string (optional, default: 'product-stack-snapshots')

The directory where template snapshots will be stored.


validateTemplate?

Type: boolean (optional, default: true)

Whether the specified product template will be validated by CloudFormation.

If turned off, an invalid template configuration can be stored.

Properties

NameTypeDescription
nodeNodeThe tree node.

node

Type: Node

The tree node.

Methods

NameDescription
currentVersion()Retains product stack template as a snapshot when deployed and retrieves a CloudFormationProductVersion for the current product version.
toString()Returns a string representation of this construct.
versionFromSnapshot(productVersionName)Retrieves a CloudFormationProductVersion from a previously deployed productVersionName.

currentVersion()

public currentVersion(): CloudFormationProductVersion

Returns

  • CloudFormationProductVersion

Retains product stack template as a snapshot when deployed and retrieves a CloudFormationProductVersion for the current product version.


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


versionFromSnapshot(productVersionName)

public versionFromSnapshot(productVersionName: string): CloudFormationProductVersion

Parameters

  • productVersionName string

Returns

  • CloudFormationProductVersion

Retrieves a CloudFormationProductVersion from a previously deployed productVersionName.