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:
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 provideddirectory (
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:
- 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:
Attributes
- node
The tree node.
Static Methods
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
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 classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
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 theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.