Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 940 Bytes

deploy_with_cdk.md

File metadata and controls

56 lines (38 loc) · 940 Bytes

Deploy with CDK using Python

Bootstrap CDK

cd cdk-my-api-python

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

cdk bootstrap

Deploy

cdk deploy

Test

export CDK_URL=<URL from the CDK deployment output>
export CDK_LOG_GROUP=<URL from the CDK deployment output>

curl "${CDK_URL}/"

curl "${CDK_URL}/mike"

curl -X POST -H "Content-Type: application/json" \
  -d @../events/event.container.predict.json \
  "${CDK_URL}/predict"

View the Logs

aws logs tail $CDK_LOG_GROUP --follow
aws logs tail $CDK_LOG_GROUP --since 5m
aws logs tail $CDK_LOG_GROUP --filter-pattern "sepal"

Cleanup

If you are done experimenting with the API you can tear down the resources by deleting the CloudFormation stack from the AWS Console, or using the command:

cdk destroy

You can now return to the project root.

cd ..