ProductStackHistory

class aws_cdk.aws_servicecatalog.ProductStackHistory(scope, id, *, current_version_locked, current_version_name, product_stack, description=None, directory=None, validate_template=None)

Bases: Construct

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

ExampleMetadata:

infused

Example:

import aws_cdk.aws_s3 as s3
import aws_cdk.core as cdk


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

        s3.Bucket(self, "BucketProductV2")

product_stack_history = servicecatalog.ProductStackHistory(self, "ProductStackHistory",
    product_stack=S3BucketProduct(self, "S3BucketProduct"),
    current_version_name="v2",
    current_version_locked=True
)

product = servicecatalog.CloudFormationProduct(self, "MyFirstProduct",
    product_name="My Product",
    owner="Product Owner",
    product_versions=[
        product_stack_history.current_version()
    ]
)
Parameters:
  • scope (Construct) –

  • id (str) –

  • current_version_locked (bool) – If this is set to true, the ProductStack will not be overwritten if a snapshot is found for the currentVersionName.

  • current_version_name (str) – The current version name of the ProductStack.

  • product_stack (ProductStack) – The ProductStack whose history will be retained as a snapshot.

  • description (Optional[str]) – The description of the product version. Default: - No description provided

  • directory (Optional[str]) – The directory where template snapshots will be stored. Default: ‘product-stack-snapshots’

  • validate_template (Optional[bool]) – Whether the specified product template will be validated by CloudFormation. If turned off, an invalid template configuration can be stored. Default: true

Methods

current_version()

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

Return type:

CloudFormationProductVersion

to_string()

Returns a string representation of this construct.

Return type:

str

version_from_snapshot(product_version_name)

Retrieves a CloudFormationProductVersion from a previously deployed productVersionName.

Parameters:

product_version_name (str) –

Return type:

CloudFormationProductVersion

Attributes

node

The construct tree node associated with this construct.

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool