This is a project for Python development with CDK. And you must have meet requirement before to start below.
First of all we need create the Spring Boot deployment JAR using:
work/build.shThis script will all the source codes from spring-petclinic-microservices repository, and run the MVN to compile the projects.
We also manually create a virtualenv on MacOS and Linux in this project root folder:
python3 -m venv .envAfter the init process completes and the virtualenv is created, you can use the following step to activate your virtualenv.
source .env/bin/activateOnce the virtualenv is activated, you can install the required dependencies.
pip install -r requirements.txtAt this point you can now synthesize the CloudFormation template for this code.
cdk synthAfter review the CloudFormation template you can create the Docker Image which will upload to ECR Repo and deploy all the Infracture codes using:
cdk deployCheck the Spring Petclinic Application deployment is success by browse the CDK output AWS ELB url like
ecs-microservice-stack.LoadBalancer = ecs-m-EcsLb-BO36NBDANAWP-1810594841.ap-northeast-1.elb.amazonaws.comFinally you can clean up the whole stack by using:
cdk destory