npm install -g aws-cdk
https://docs.aws.amazon.com/cdk/api/latest/python/index.html
Create App - AWS Reference
mkdir hello-cdk
cd hello-cdk
cdk init app --language python
source .venv/bin/activate
python -m pip install -r requirements.txt
pip install aws-cdk.aws-s3
Replace the first import statement in hello_cdk_stack.py in the hello_cdk directory with the following code.
from aws_cdk import (
aws_s3 as s3,
core as cdk
)
bucket = s3.Bucket(self,
"MyFirstBucket",
versioned=True,)
cdk synth
cdk deploy