Purpose |
Command |
Explanation |
Initial Project Setup |
pip install -r requirements.txt |
Installs the Python dependencies listed in requirements.txt using pip. |
cdk bootstrap aws:/// |
Bootstraps the environment with the necessary resources like an S3 bucket for deployment assets. |
Deployment |
cdk synth |
Generates the CloudFormation template based on your CDK app, allowing you to review it before deployment. |
cdk deploy |
Deploys the stack(s) defined in your CDK app to your AWS account. |
cdk diff |
Displays the differences between the deployed stack and the changes in your CDK app. |
Future Management |
cdk deploy |
Deploys any updates or changes to your stack(s) after making modifications to your CDK app. |
cdk destroy |
Destroys the deployed stack(s) and deletes all associated resources. |
conda update --all |
Updates all packages within your Conda environment to the latest versions. |
The following are the steps that CDK performs to interpret and generate the necessary infrastructure in AWS.
What it does is the following:
- It interprets all the code that is at the
App
level.
It performs the synthesis action (cdk synth
) to generate artifacts for Cloudformation
.
- This assumes that it checks all the constructs and generates the
Cloudformation
templates.
Generate unique ids (arn) for each of the assets.
- The assets are understood as the project files (scripts, dockerfiles, etc..).
- At this point the CDK starts bootstrapping (
cdk bootstrap
) to create the environment where all the assets will be stored.
- Creates an stack (often called
CDKToolkit
) with all the necessary resources to make the deployment.
- For example, in this bucket you will store the docker image while you are converting it before loading it to ECR.
- The App is deployed.
- The App is in charge of generating the App Tree from which all its constructs will hang.
- Each construct will perform the following series to generate the CF code:
- prepare > validate > synthesize
- Start the deployment in AWS