ProductStackProps

class aws_cdk.aws_servicecatalog.ProductStackProps(*, asset_bucket=None, memory_limit=None, server_side_encryption=None, server_side_encryption_aws_kms_key_id=None)

Bases: object

Product stack props.

Parameters:
  • asset_bucket (Optional[IBucket]) – A Bucket can be passed to store assets, enabling ProductStack Asset support. Default: - No Bucket provided and Assets will not be supported.

  • memory_limit (Union[int, float, None]) – The amount of memory (in MiB) to allocate to the AWS Lambda function which replicates the files from the CDK bucket to the destination bucket. If you are deploying large files, you will need to increase this number accordingly. Default: 128

  • server_side_encryption (Optional[ServerSideEncryption]) – A ServerSideEncryption can be enabled to encrypt assets that are put into assetBucket. Default: - No encryption is used

  • server_side_encryption_aws_kms_key_id (Optional[str]) – For AWS_KMS ServerSideEncryption a KMS KeyId must be provided which will be used to encrypt assets. Default: - No KMS KeyId and SSE_KMS encryption cannot be used

ExampleMetadata:

infused

Example:

import aws_cdk.aws_lambda as lambda_
import aws_cdk as cdk
from aws_cdk.aws_s3 import Bucket


class LambdaProduct(servicecatalog.ProductStack):
    def __init__(self, scope, id, *, assetBucket=None, serverSideEncryption=None, serverSideEncryptionAwsKmsKeyId=None, memoryLimit=None):
        super().__init__(scope, id, assetBucket=assetBucket, serverSideEncryption=serverSideEncryption, serverSideEncryptionAwsKmsKeyId=serverSideEncryptionAwsKmsKeyId, memoryLimit=memoryLimit)

        lambda_.Function(self, "LambdaProduct",
            runtime=lambda_.Runtime.PYTHON_3_9,
            code=lambda_.Code.from_asset("./assets"),
            handler="index.handler"
        )

user_defined_bucket = Bucket(self, "UserDefinedBucket",
    bucket_name="user-defined-bucket-for-product-stack-assets"
)

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(LambdaProduct(self, "LambdaFunctionProduct",
            asset_bucket=user_defined_bucket
        ))
    )
    ]
)

Attributes

asset_bucket

A Bucket can be passed to store assets, enabling ProductStack Asset support.

Default:
  • No Bucket provided and Assets will not be supported.

memory_limit

The amount of memory (in MiB) to allocate to the AWS Lambda function which replicates the files from the CDK bucket to the destination bucket.

If you are deploying large files, you will need to increase this number accordingly.

Default:

128

server_side_encryption

A ServerSideEncryption can be enabled to encrypt assets that are put into assetBucket.

Default:
  • No encryption is used

server_side_encryption_aws_kms_key_id

For AWS_KMS ServerSideEncryption a KMS KeyId must be provided which will be used to encrypt assets.

Default:
  • No KMS KeyId and SSE_KMS encryption cannot be used