Metadata-Version: 2.1
Name: cdk-bootstrapless-synthesizer
Version: 0.8.3
Summary: Generate directly usable AWS CloudFormation template.
Home-page: https://github.com/aws-samples/cdk-bootstrapless-synthesizer.git
Author: wchaws
License: Apache-2.0
Project-URL: Source, https://github.com/aws-samples/cdk-bootstrapless-synthesizer.git
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: JavaScript
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Typing :: Typed
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE

# cdk-bootstrapless-synthesizer

[![npm version](https://img.shields.io/npm/v/cdk-bootstrapless-synthesizer)](https://www.npmjs.com/package/cdk-bootstrapless-synthesizer)
[![PyPI](https://img.shields.io/pypi/v/cdk-bootstrapless-synthesizer)](https://pypi.org/project/cdk-bootstrapless-synthesizer)
[![npm](https://img.shields.io/npm/dw/cdk-bootstrapless-synthesizer?label=npm%20downloads)](https://www.npmjs.com/package/cdk-bootstrapless-synthesizer)
[![PyPI - Downloads](https://img.shields.io/pypi/dw/cdk-bootstrapless-synthesizer?label=pypi%20downloads)](https://pypi.org/project/cdk-bootstrapless-synthesizer)

A bootstrapless stack synthesizer that is designated to generate templates that can be directly used by AWS CloudFormation

## Usage

```python
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from cdk_bootstrapless_synthesizer import BootstraplessStackSynthesizer

# ...
app = cdk.App()

# You can set arguments directly
MyWidgetServiceStack(app, "MyWidgetServiceStack",
    synthesizer=BootstraplessStackSynthesizer(
        template_bucket_name="cfn-template-bucket",
        image_asset_repository_name="ecr-repo-name",

        file_asset_bucket_name="file-asset-bucket-${AWS::Region}",
        file_asset_region_set=["us-east-1"],
        file_asset_prefix="file-asset-prefix/latest/",

        image_asset_tag="docker-image-tag",
        image_asset_region="us-east-1",
        image_asset_account_id="1234567890"
    )
)

# Or by environment variables
# export BSS_TEMPLATE_BUCKET_NAME="cfn-template-bucket"
# export BSS_IMAGE_ASSET_REPOSITORY_NAME="ecr-repo-name"
# export BSS_FILE_ASSET_BUCKET_NAME="file-asset-bucket-\${AWS::Region}"
# export BSS_FILE_ASSET_REGION_SET="us-east-1,us-west-1"
# export BSS_FILE_ASSET_PREFIX="file-asset-prefix/latest/"
# export BSS_IMAGE_ASSET_TAG="docker-image-tag"
# export BSS_IMAGE_ASSET_REGION="us-east-1"
# export BSS_IMAGE_ASSET_ACCOUNT_ID="1234567890"
MyWidgetServiceStack(app, "MyWidgetServiceStack",
    synthesizer=BootstraplessStackSynthesizer()
)
```

Synth AWS CloudFormation templates, assets and upload them

```shell
$ cdk synth
$ npx cdk-assets publish -p cdk.out/MyWidgetServiceStack.assets.json -v
```

In your template

```json
{
  // ...
  "MyLayer38944FA5": {
    "Type": "AWS::Lambda::LayerVersion",
    "Properties": {
      "Content": {
        "S3Bucket": {
          "Fn::Sub": "file-asset-bucket-${AWS::Region}"
        },
        "S3Key": "file-asset-prefix/latest/8104f93f351dd2d4e69b0ab2ebe9ccff2309a573660bd75ca920ffd1808522e0.zip"
      }
    }
  }
  // ...
}
```

## Sample Project

See [Sample Project](./sample/README.md)

## API Reference

See [API Reference](./API.md) for API details.


