Skip to main content

Package that enables deployment of AWS CDK stacks in parallel.

Project description

B.AwsCdkParallel

A python based package that enables AWS CDK parallel stack deployments.

Description

One of the biggest downsides of AWS CDK IaC tool is the sequential deployments. If you have many stacks within your project - it can take hours and hours till everything gets deployed. Wouldn't it be cool to parallelize them? According to AWS CDK tool maintainers - they are not even thinking right now to include such functionality. Hence, this project was built. This project allows you to run traditional cdk deploy * and cdk destroy * -f. But the main trick is that it can do it in parallel - massively increasing the speed of your deployments.

Remarks

Biomapas aims to modernise life-science industry by sharing its IT knowledge with other companies and the community. This is an open source library intended to be used by anyone. Improvements and pull requests are welcome.

Some techniques and inspirations were taken from this blog post:
https://taimos.de/blog/deploying-your-cdk-app-to-different-stages-and-environments

General issue is being discussed on github:
https://github.com/aws/aws-cdk/issues/1973

Related technology

  • Python 3
  • AWS CDK
  • AWS CloudFormation

Assumptions

The project assumes the following:

  • You have basic-good knowledge in python programming.
  • You have basic-good knowledge in AWS.
  • You have very good knowledge in AWS CDK.

Useful sources

Install

The project is built and uploaded to PyPi. Install it by using pip.

pip install b_aws_cdk_parallel

Or directly install it through source.

pip install .

Usage & Examples

Programmatic usage

To start deployment programmatically:

from b_aws_cdk_parallel.deployment_executor import DeploymentExecutor
from b_aws_cdk_parallel.deployment_type import DeploymentType

executor = DeploymentExecutor(
    type=DeploymentType.DEPLOY,
    path='/optional/path/to/cdk/app',
    env={
        'optional': 'os-level environment variables'
    }
)

executor.run()

To start stacks destruction programmatically:

from b_aws_cdk_parallel.deployment_executor import DeploymentExecutor
from b_aws_cdk_parallel.deployment_type import DeploymentType

executor = DeploymentExecutor(
    type=DeploymentType.DESTROY,
    path='/optional/path/to/cdk/app',
    env={
        'optional': 'os-level environment variables'
    }
)

executor.run()

CLI usage

The library also exposes CLI access.

To get usage help, simply run:

acdk -h

To deploy infrastructure, run:

acdk deploy --path /project/app/

To destroy infrastructure, run:

acdk destroy --path /project/app/

Testing

This project has integration tests based on pytest. To run tests, simply run:

pytest b_aws_cdk_parallel_test/integration/tests

Contribution

Found a bug? Want to add or suggest a new feature?
Contributions of any kind are gladly welcome. You may contact us directly, create a pull-request or an issue in github platform. Lets modernize the world together.

Release history

2.1.0

  • Expose CLI command acdk to enable deployment/destruction through CLI.

2.0.0

  • Major bug fixes for resolving stack dependencies. The algorithm for parallel stack destruction has fundamentally changed.
  • Added integration tests to test against an actual AWS environment.
  • More improvements will come for 2.1.0.

1.3.0

  • Do not rebuild assets on destroy.

1.2.0

  • Do not rebuild assets on deployment.

1.1.0

  • Add ability to control maximum parallel deployments.

1.0.0

  • Complete rework of the project. Build a dependency tree to determine what to deploy.

0.4.1

  • Raise exception in case of a failed deployment.

0.4.0

  • Cdk list command should also receive path and environment.

0.3.0

  • Add ability to specify CDK path and environment variables for processes.

0.2.0

  • Add ability to retry main deployment too.

0.1.0

  • Refactor project to make it more debug-friendly.

0.0.2

  • Upgrade dependencies.

0.0.1

  • Initial build.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

b_aws_cdk_parallel-2.1.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

b_aws_cdk_parallel-2.1.0-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file b_aws_cdk_parallel-2.1.0.tar.gz.

File metadata

  • Download URL: b_aws_cdk_parallel-2.1.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for b_aws_cdk_parallel-2.1.0.tar.gz
Algorithm Hash digest
SHA256 2939b03087c455ba72b08c4aa5ac6fb5b2990f04edec0aafb149cd3f5bcbc9fb
MD5 f396cc3fc8bfa66ae873db01c454b8f9
BLAKE2b-256 1a79ce36f8a7e617e27ffbd289bd83f0cfcaef1b8bc343a074420e6983ccbdb1

See more details on using hashes here.

File details

Details for the file b_aws_cdk_parallel-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: b_aws_cdk_parallel-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for b_aws_cdk_parallel-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a1d0b1bfa7f095e1869d44fb3f5b3d966a022e6ec1d4e17fd5da5a5e07d5974
MD5 0ed6c33169ce622367add3f97aadb820
BLAKE2b-256 7ee43bbf78d66ce2fd0a812c6be3eff7cbda4bfabfeca02036cf25d884d1931e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page