DEV Community 👩‍💻👨‍💻

Pedro Emanoel
Pedro Emanoel

Posted on

How to build microsservices with Spring Boot and AWS with Fargate and DOCKER - Part 4

Image description

Aws CDK

If you have a personal account or paid account, you need to create a IAM user .

In this train, i will use Aws Student, where dont have the IAM User.

How i take the user on AWS Student?

make login in your student account.

in Vocaerum Labs, tap on "Account details" and copy the AWS CLI.

Then, you need install AWS-CLI

Next, you to go to the archive "Credentials" on .aws directory and paste, LIKE THAT:

Image description

Creating a project with CDK

First, Create a new Directory and put the command below:

cdk init --language java

Image description

Then, open the project on IDE

KNOWING CDK project structure

We have two classes
Image description

the class AwsSpringCdkApp is the entrypoint

What is VPC

The Virtual Private Cloud will be our virtual lan, where permit us to create our components inside it that we want still isolated. like RDS instance he will still visible to just components inside the VPC instance.

What is ECS Cluster

cluster is the architecture that will permit our have a quantity of computational resources to be utilized by our application.

The ECS is a container composer, with AWS Fargate not is necessary manage machines instances.

Task and Task Definition


to run our application inside a cluster, we need to create a Task Definition. The task definition is like a recipe, as our service will be executed. The task definition to take our docker image and to execute that image with some configurations, like how much cpu will be utilized to execute that service.

Thats it.

Top comments (0)

Our newest Hackathon

Join the DEV x MongoDB Atlas Hackathon 2022 and use your ingenuity and creativity to build an application using MongoDB's cloud based developer data platform, MongoDB Atlas.

Get Started