This is a Python CDK project.
To start developing you can use our Taskfile to run run install or run env
Or you can do this step by step:
python3 -m venv venvUse the following to activate the newly created virtualenv:
source venv/bin/activateIf you are using Windows platform, you would activate the virtualenv like this:
venv\Scripts\activate.batOnce the virtualenv is activated, you can install the required dependencies:
pip install pip-tools
pip-syncAt this point you can now synthesize the CloudFormation template for this project:
cdk synthThis project is using black to handle formatting.
Install black:
brew install blackFormat all files:
black .There are also editor integrations available. The file watcher for PyCharm/Intellij works well for auto-formatting on file save.
If you are a frequent contributor, you should setup the pre-commit integration. From within this project's directory, run:
brew install pre-commit
pre-commit installNow various checks, import sorting and formatting will be done on git commit. To run manually on all files, use this:
pre-commit run --all-filesIf you want to know where pre-commit installs the tools it uses, see this
section on how pre-commit handles caching.
This project uses pip-tools to manage dependencies. The following commands require the virtualenv to be active:
source venv/bin/activateThere are two primary workflows, update and sync.
To update dependencies, modify requirements.in file. Generally requirements get pinned
in this file for simplicity. After that, run:
pip-compile --upgrade --no-emit-index-urlThis will update requirements.txt.
The sync command will sync requirements.txt with the virtualenv:
pip-synccdk lslist all stacks in the appcdk synthemits the synthesized CloudFormation templatecdk deploydeploy this stack to your default AWS account/regioncdk diffcompare deployed stack with current statecdk docsopen CDK documentation