Aws Ecs With Spring Boot And Aws Cdk
Published 2/2024
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz
Language: English | Size: 9.20 GB | Duration: 24h 6m
Published 2/2024
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz
Language: English | Size: 9.20 GB | Duration: 24h 6m
Create microservices using AWS ECS, Spring Boot and AWS CDK in Java. Learn how to use SNS, SQS, DynamoDB, S3 and more.
What you'll learn
Build microservices in Spring Boot and Java, using AWS ECS and Fargate, the Serverless compute for containers from AWS, using DynamoDB, SNS topics and more;
Build the infrastructure on AWS using Java code with the AWS Cloud Development Kit (CDK);
Build API with AWS API Gateway, with query string parameters and request body validations;
AWS CloudFormation and resources organized in stacks;
Model and provision resources on AWS with the AWS Cloud Development Kit (CDK) in Java;
Create microservices using AWS Fargate without having to create infrastructure like machine instances;
Create clusters with AWS ECS service to control the application tasks' execution;
Use AWS S3 to create an event-based file processing mechanism, integrated with AWS ECS services;
Balance the requests between the application instances using the AWS Application Load Balancer service;
Monitor microservices execution with the AWS X-Ray;
Create subnets and network security rules using AWS VPC, to protect the application containers;
Monitor application health using the AWS Target Groups, fully integrated with AWS ECS services;
Create tables in AWS DynamoDB with a composite primary key;
Learn how to query items from AWS DynamoDB tables using a composite primary key;
Configure AWS DynamoDB tables in provisioned mode and with auto scaling;
Configure AWS DynamoDB tables in on-demand mode;
Monitor consumption graphs in AWS DynamoDB console;
View logs from the microservices in AWS CloudWatch Insights;
Publish messages to topics on AWS SNS via microservices;
Consume AWS SQS messages from the microservices in a Spring Boot application;
Subscribe AWS SQS queues to AWS SNS topics with message filtering;
Import files using AWS S3, consuming its events from AWS SQS queues;
Store the application Docker images in private repositories using the AWS ECR;
Monitor application logs, parameters, and resource events for alarm generation with AWS CloudWatch Alarms;
Create a Dead-Letter Queue engine with AWS SQS;
Control costs through resource tags in AWS Cost Explorer;
Control access permissions for specific DynamoDB items with AWS IAM policies;
Requirements
No prior knowledge of AWS is required;
Object-oriented programming;
REST services;
You will not need to install any paid software to follow the course;
Free AWS account.
Description
In this course you will create several microservices in Java, using the Spring Boot framework and Docker containers, building a backend application to interact with Amazon Web Services resources, as the mentioned below. These resources will be created in AWS using the AWS Cloud Development Kit (CDK), a modern way to model and provision infrastructure in AWS. The AWS CDK is one of the best infrastructure as code, or IaC, tools for AWS;Spring Boot is a powerful Java framework to build server-side applications with annotations, controllers, services, request interceptors and much more.This course will cover the following AWS resources and tools with practical exercises:AWS ECS: the Elastic Container Service is the AWS container orchestration service. With this service it's possible to manage the Docker based microservices containers execution in a robust and scalable way. And with the AWS Fargate, the Serverless compute for containers from Amazon Web Services, it isn't necessary create EC2 instances, reducing the operating cost of container based applications;AWS ECR: with the Elastic Container Registry from AWS it's possible to create private repositories to store the microservices' container Docker images;AWS VPC: with the Virtual Private Cloud it's possible to secure the infrastructure with private subnets and network security policies for inbound and outbound traffic rules;AWS ALB: the Application Load Balancer from AWS allows the incoming HTTP traffic to be balanced between all the available application instances, and with the integrated target groups, each instance can be monitored to only receive traffic if it is healthy;API Gateway REST: with the AWS API Gateway it's possible to protect the application REST API, as well as performing query string parameter and requests' body validation;CloudWatch Logs: responsible for concentrating applications logs and its metrics;CloudWatch Alarms: with the alarms from CloudWatch it will be possible to monitor the abnormal occurrences from the applications and AWS resources;CloudWatch Container Insights: with the Container Insights it's possible to aggregate monitoring information from the applications running in AWS ECS, including its logs;DynamoDB: the DynamoDB is a powerful NoSQL and non-relational database managed service;SQS: the SQS, or Simple Queue Service, is a queue service which allows asynchronous communication between applications, in order to exchange messages and events;SNS: with the SNS, or Simple Notification Service, it's possible to create topics and publish messages to be received by several resources and applications;S3: the S3, or Simple Storage Service, has a file storage with no server provisioning. Also, the S3 generates notifications when files are added to it;X-Ray: the AWS X-Ray is a service which allows analysis and debugging of distributed applications;IAM: the Identity and Access Management from AWS allows roles and permissions management, granted to users and services to access other AWS resources;AWS Cost Explorer: with the Cost Explorer from AWS it's possible to generate cost graphs about resource consumption, split by resource types and tags, which can identify applications and their parts.These resources will be created on AWS using the AWS Cloud Development Kit - CDK, a modern way of modeling and provisioning infrastructure on AWS using the Java language. The AWS CDK is ideal if you want to work in the DevOps and in the infrastructure as code fields.If you already have AWS certification and are looking for hands-on experience, you can get that with this course, through the exercises that will be offered here.This course has a good balance between theoretical and practical exercises. You can expect detailed explanations with diagrams and well-guided implementations, always with a well-defined purpose.Note: This course is not intended to prepare you for an AWS certification exam. There are other courses that are specific to AWS certifications.Also included in the package, when you buy this course:Student support, through the platform answers and questions section;Project source code to help you at the beginning of the course;Quizzes to test your knowledge about course topics;Practical exercises to let you practice, with detailed solutions offered by the instructor;About the instructor:I've been worked daily with the presented technologies in this course since 2016, acting as an AWS hosted solutions developer;I've been a profesor in cloud computing and mobile subjects, including AWS, in a postgraduate course for almost 10 years;I have published books on the subject;I am part of the AWS Community Builder since 2020, a global community created by Amazon Web Services.Credits for the music used in the course presentation: Bensound - License code: 8XYDILY4RHGNN6VB
Overview
Section 1: Introduction
Lecture 1 Course presentation
Lecture 2 ECommerce backend project presentation
Lecture 3 AWS concepts
Lecture 4 Preparing then AWS account
Lecture 5 Preparing the development environment
Section 2: AWS CloudFormation introduction
Lecture 6 AWS CloudFormation introduction
Lecture 7 Analyzing stacks, events, resources and properties
Lecture 8 Deleting a stack
Section 3: Creating the infrastructure project with AWS CDK
Lecture 9 AWS Cloud Development Kit introduction
Lecture 10 Creating the AWS IAM user to be used by the AWS CDK
Lecture 11 Creating the infrastructure project with AWS CDK
Lecture 12 Analyzing the CDK project structure
Section 4: Creating the first Spring Boot project: ProductsService
Lecture 13 Spring Boot introduction
Lecture 14 The first Spring Boot microservice: ProductsService
Lecture 15 Creating the ProductsService Spring Boot project
Lecture 16 Preparing the IntelliJ IDEA
Lecture 17 Executing the application for the first time
Lecture 18 Creating the first controller
Lecture 19 Creating the Dockerfile
Lecture 20 Generating the Docker image
Lecture 21 Running the Docker image locally
Section 5: Creating the AWS ECR image repository with AWS CDK
Lecture 22 AWS ECR introduction
Lecture 23 Creating the first CloudFormation stack in the CDK project
Lecture 24 Creating the AWS ECR repository with AWS CDK
Lecture 25 Organizing the stack in the CDK project
Lecture 26 Bootstrapping the AWS account
Lecture 27 Deploying the stack with its ECR repository
Lecture 28 Pushing the ProductsService Docker image to the AWS ECR repository
Section 6: Creating the AWS VPC with AWS CDK
Lecture 29 AWS VPC introduction
Lecture 30 Multiple Availability Zones
Lecture 31 Security Groups
Lecture 32 Subnets
Lecture 33 Internet Gateway
Lecture 34 NAT Gateway
Lecture 35 Without NAT Gateway
Lecture 36 With NAT Gateway
Lecture 37 AWS PrivateLink
Lecture 38 Creating the AWS VPC with AWS CDK
Lecture 39 Organizing the stacks
Lecture 40 Deploying the AWS VPC
Lecture 41 Analyzing the created AWS VPC resources using AWS console
Lecture 42 [OPTIONAL] - Destroying the infrastructure to save costs
Section 7: Creating the AWS ECS cluster with AWS CDK
Lecture 43 AWS ECS concepts, including clusters, task definitions and services.
Lecture 44 vCPU and Memory allocation
Lecture 45 AWS ECS task definition
Lecture 46 AWS ECS task
Lecture 47 AWS ECS service
Lecture 48 AWS ECS Auto Scaling
Lecture 49 AWS ECS Multi Availability Zones
Lecture 50 Creating the AWS ECS cluster with AWS CDK
Lecture 51 Organizing the stacks
Lecture 52 Deploying the ECS Cluster with AWS CDK
Lecture 53 Analyzing the created AWS ECS cluster using the AWS console
Section 8: Creating the AWS ECS infrastructure to hold the services
Lecture 54 AWS Application Load Balancer introduction and the ECS integration strategy
Lecture 55 Target Group
Lecture 56 Health Check mechanism
Lecture 57 Security Group
Lecture 58 Creating the stack to hold the resources to be shared with other stacks
Lecture 59 Creating the AWS Network Load Balancer using AWS CDK
Lecture 60 Creating the AWS VPC Link with AWS CDK
Lecture 61 Creating the AWS Application Load Balancer with AWS CDK
Lecture 62 Organizing the stacks
Lecture 63 Deploying the new stack
Lecture 64 Analyzing the create AWS resources using the AWS console
Section 9: Creating the ECS service with AWS CDK
Lecture 65 Strategy to create the ECS service and the remaining resources
Lecture 66 Creating the new stack for the ProductsService
Lecture 67 Creating the ECS task definition
Lecture 68 Creating the service log driver
Lecture 69 Adding the service container to the task definition
Lecture 70 Adding a new listener to the AWS Application Load Balancer
Lecture 71 Creating the AWS Fargate service
Lecture 72 [OPTIONAL] - Assigning public IP addresses to the instances
Lecture 73 Configuring the AWS ALB target group and the health check mechanism
Lecture 74 Configuring the AWS Network Load Balancer
Lecture 75 Organizing the stacks
Lecture 76 Deploying the created resources and the ProductsServices
Lecture 77 [IMPORTANT] - ECS troubleshooting
Lecture 78 Analyzing the created resources using AWS console
Lecture 79 [OPTIONAL] - Destroying the infrastructure to save costs
Section 10: Creating the AWS API Gateway with AWS CDK
Lecture 80 Introduction to AWS API Gateway
Lecture 81 Integration between API Gateway and AWS ECS services through AWS VPC Link
Lecture 82 Creating the new stack for the API Gateway resources
Lecture 83 Creating the API Gateway resource
Lecture 84 Creating the products resource and its first method
Lecture 85 Organizing the stacks
Lecture 86 Testing the integration between the API Gateway and the AWS ECS service
Section 11: Creating the AWS DynamoDB products table with AWS CDK
Lecture 87 Introduction to AWS DynamoDB tables
Lecture 88 Basic concepts about AWS DynamoDB tables.
Lecture 89 Creating the AWS DynamoDB table with AWS CDK
Lecture 90 Granting permission to ProductsService to access the DynamoDB table
Lecture 91 Creating the REST operation to create new products
Lecture 92 Creating the REST operation to update a product by its id
Lecture 93 Creating the REST operation to get a product by its id
Lecture 94 Creating the REST operation to delete a product by its id
Lecture 95 Adding the AWS SDK dependencies to ProductsService project
Lecture 96 Creating the products model to represent it in the new DDB table
Lecture 97 Creating the DynamoDB configuration class
Lecture 98 Creating the product repository
Lecture 99 Creating the method to find all products
Lecture 100 Creating the method to find a product by its id, using the primary key
Lecture 101 Creating the method to create a new product
Lecture 102 Creating the method to delete a product
Lecture 103 Creating the method to update a product
Lecture 104 Creating the product DTO
Lecture 105 Creating the operation to get all products
Lecture 106 Creating the operation to get a product by its id
Lecture 107 Creating the operation to create a new product
Lecture 108 Creating the operation to delete a product
Lecture 109 Creating the operation to update a product
Lecture 110 Executing the deployment to test the implementation
Lecture 111 Using CloudWatch Logs to analyze and fix exceptions in our Products Service
Lecture 112 Adding a new field to the products model
Lecture 113 Testing the implementation
Section 12: Instrumenting AWS ECS services with AWS X-Ray
Lecture 114 Introduction to AWS X-Ray
Lecture 115 Preparing the ProductsService Spring Boot project to use the AWS X-Ray
Lecture 116 Creating the sampling rules file
Lecture 117 Creating the X-Ray inspector
Lecture 118 Adding the X-Ray interceptor to the DynamoDB client
Lecture 119 Instrumenting the products controller
Lecture 120 Adding a X-Ray container sidecar to the ProductsServices task definition
Lecture 121 Testing the implementation
Section 13: Generating AWS API Gateway logs
Lecture 122 Setting up the AWS API Gateway resource to generate logs to AWS CloudWatch Logs
Lecture 123 Controlling the application log level and its format
Lecture 124 Capturing the unique request id from AWS API Gateway with an interceptor
Lecture 125 Creating the interceptor configuration
Lecture 126 Generating logs in the products context
Lecture 127 Forwarding the unique request identifier using the AWS API Gateway
Lecture 128 Testing the implementation
Section 14: Spring Boot controller advice with exception handlers
Lecture 129 Strategy to capture exceptions with exception handlers
Lecture 130 Creating an enum to represent the errors
Lecture 131 Creating a custom exception
Lecture 132 Creating the error response DTO
Lecture 133 Creating the products exception handler
Lecture 134 Changing the products controller operations to use the custom exception
Lecture 135 Testing the implementation
Section 15: AWS API Gateway request body validation
Lecture 136 AWS API Gateway request body validation concepts and why they should be used
Lecture 137 Creating the product request validator and its model
Lecture 138 Adding the product validator to the operation to create a product
Lecture 139 Testing the implementation and analyzing the AWS API Gateway resource
Section 16: AWS DynamoDB queries using Global Secondary Indexes
Lecture 140 AWS DynamoDB Global Secondary Index concepts
Lecture 141 AWS DynamoDB read and write capacity units
Lecture 142 Strategy to use GSI in the products DynamoDB table
Lecture 143 Creating the GSI into the products table using AWS CDK
Lecture 144 Using the DynamoDbSecondaryPartitionKey annotation
Lecture 145 Adding the product code as a non-required parameter in the API Gateway resource
Lecture 146 Creating a method to check if a product's code exists
Lecture 147 Getting a product by its code
Lecture 148 Updating the creation and updating methods to check the products code first
Lecture 149 Testing implementation with AWS X-Ray
Section 17: Publishing product events with AWS SNS topics
Lecture 150 AWS SNS topics concepts
Lecture 151 Strategy to use AWS SNS topics in ProductsService
Lecture 152 Permission to access a SNS topic
Lecture 153 Integration between SNS topic and SQS queues
Lecture 154 Creating the AWS SNS topic using AWS CDK
Lecture 155 Granting permission to ProductsService to publish messages to the SNS topic
Lecture 156 Creating the product event models
Lecture 157 Creating the SNS topic client using the AWS SDK
Lecture 158 Creating the events publisher service, using the created SNS client
Lecture 159 Creating the method to public product events
Lecture 160 Publishing the product deletion event
Lecture 161 Publishing the product updating event
Lecture 162 Publishing the product creation event, in an asynchronous way.
Lecture 163 Testing the implementation
Lecture 164 Creating the product failure event models
Lecture 165 Creating the method to publish the product failure event
Lecture 166 Publishing the product failure event
Lecture 167 Testing the implementation
Section 18: Creating the AuditService Spring Boot project
Lecture 168 The AuditService strategy
Lecture 169 Creating the AuditService Spring Boot project
Lecture 170 Creating the Dockerfile
Lecture 171 Preparing the build.gradle file
Lecture 172 Creating the configuration files
Lecture 173 Creating the DynamoDB client configuration class
Lecture 174 Creating the X-Ray client configuration classes
Lecture 175 Creating a new ECR repository
Lecture 176 Uploading the first AuditService Docker image
Lecture 177 Creating the AuditService stack with its main resources
Lecture 178 Organizing the stack and deploying it
Lecture 179 Analyzing the created infrastructure
Lecture 180 [OPTIONAL] - Destroying the infrastructure to save costs
Section 19: Consuming AWS SQS messages
Lecture 181 AWS SQS queues concepts
Lecture 182 Product events strategy using AWS SQS queues
Lecture 183 Dead-letter Queue strategy
Lecture 184 Creating the AWS SQS product events queue and its DLQ with AWS CDK
Lecture 185 Subscribing the AWS SQS product events queue to the AWS SNS topic
Lecture 186 Granting permission to AuditService to consume messages from the AWS SQS queue
Lecture 187 Creating the AWS SQS client configuration class
Lecture 188 Creating the event models to represent the messages
Lecture 189 Creating the product models to represent its events
Lecture 190 Creating the product event consumer
Lecture 191 Creating the method to consume product events
Lecture 192 Testing the implementation
Lecture 193 Testing the AWS SQS DLQ in action
Section 20: AWS SNS subscription filter
Lecture 194 AWS SNS subscription filter concepts
Lecture 195 Adding a subscription filter to the product events queue subscription
Lecture 196 Creating the product failure events queue, subscribing it with a filter
Lecture 197 Creating the product failure event consumer
Lecture 198 Creating the method to consume product failure messages
Lecture 199 Testing the implementation
Section 21: Composite primary key - persisting product events in a single DDB table
Lecture 200 The events AWS DynamoDB table strategy
Lecture 201 Creating the events DDB table with AWS CDK
Lecture 202 Creating the product event model
Lecture 203 Creating the product event repository
Lecture 204 Creating the method to persist product events
Lecture 205 Persisting the product events from its consumer
Lecture 206 Creating the product failure event model
Lecture 207 Creating the product failure event repository
Lecture 208 Creating the method to persist product failure events
Lecture 209 Persisting the product failure events from its consumer
Lecture 210 Testing the implementation
Section 22: AWS X-Ray and AWS SQS integration
Lecture 211 Challenges to use AWS X-Ray while consuming messages from AWS SQS queues
Lecture 212 Capture AWS X-Ray segments in product events consumer
Lecture 213 Capture AWS X-Ray segments in product failure events consumer
Lecture 214 Testing the implementation and checking AWS X-Ray traces from queue consumers
Section 23: AWS ECS services with auto scaling
Lecture 215 Auto scaling strategy in the ProductsService and AuditServices
Lecture 216 Enabling the auto scaling in the ProductsService and in the AuditService
Lecture 217 Deploying the changes and analyzing the configuration in the ECS console
Lecture 218 Preparing the load test tools
Lecture 219 Analyzing the load test effects
Section 24: AWS DynamoDB provisioned mode with auto scaling
Lecture 220 AWS DynamoDB provisioned mode with auto scaling concepts
Lecture 221 Analyzing the previous load test, in terms of the DynamoDB table metrics
Lecture 222 Enabling the auto scaling in the products DDB table
Lecture 223 Testing and analyzing the impacts on DDB tables, ECS services and SQS queues
Section 25: AWS DynamoDB table in on demand mode
Lecture 224 AWS DynamoDB table in on demand mode concepts
Lecture 225 Enabling the on demand mode in the products DDB table
Lecture 226 Testing and analyzing the impacts on DDB tables, ECS services and SQS queues
Lecture 227 Enabling the on demand mode in the events DDB table
Lecture 228 Testing and analyzing the impacts on DDB tables, ECS services and SQS queues
Section 26: Queries on DynamoDB tables using composite keys
Lecture 229 Strategy of using composite primary keys for queries
Lecture 230 Creating the product event DTO for the events API
Lecture 231 Adding the method to query products by event type, with pagination
Lecture 232 Adding the method to query products by event type and time range, and pagination
Lecture 233 Creating the product events controller
Lecture 234 Instrumenting the composite primary key query operations using AWS X-Ray
Lecture 235 Creating the product events resource in the API Gateway
Lecture 236 Testing the implementation
Section 27: Creating the InvoicesService Spring Boot project
Lecture 237 The InvoicesService strategy
Lecture 238 Creating the InvoicesService Spring Boot project
Lecture 239 Preparing the Dockerfile and the build.gradle file
Lecture 240 Creating the configuration files
Lecture 241 Creating the DynamoDB client configuration class
Lecture 242 Creating the X-Ray client configuration classes
Lecture 243 Creating a new ECR repository
Lecture 244 Uploading the first InvoicesService Docker image
Lecture 245 Creating the InvoicesService stack with its main resources
Lecture 246 Organizing the stack and deploying it
Lecture 247 Analyzing the created infrastructure
Lecture 248 [OPTIONAL] - Destroying the infrastructure to save costs
Section 28: Event-based file processing with AWS S3
Lecture 249 AWS S3 introduction
Lecture 250 Strategy to process file using the AWS S3 bucket
Lecture 251 Creating the invoices DynamoDB table
Lecture 252 Creating the AWS S3 bucket with the AWS CDK
Lecture 253 Creating the AWS SQS queue to receive the notification from the AWS S3 bucket
Lecture 254 Configuring the S3 bucket event notification to this queue
Lecture 255 Creating the invoice resource in the AWS API Gateway
Lecture 256 Creating the operation to check the invoice file transaction
Lecture 257 Creating the operation to get all invoices from a customer email
Lecture 258 Checking the created infrastructure
Lecture 259 Creating the S3 client configuration class
Lecture 260 Creating the pre-signed URL response model
Lecture 261 Creating the invoices service
Lecture 262 Creating the method to generate the pre-signed URL to access the AWS S3 bucket
Lecture 263 Creating the invoice file transaction model
Lecture 264 Creating the invoice file transaction repository
Lecture 265 Creating the method to persist an invoice file transaction
Lecture 266 Creating the method to update an invoice file transaction
Lecture 267 Creating the method to get an invoice file transaction
Lecture 268 Creating the request intercetor
Lecture 269 Configuring the request interceptor
Lecture 270 Creating the invoices controller
Lecture 271 Creating the operation to generate the pre-signed URL
Lecture 272 Testing the implementation
Lecture 273 Creating the S3 invoice notification consumer
Lecture 274 Creating the method to delete SQS messages
Lecture 275 Creating the method to consume SQS messages
Lecture 276 Creating the method to process the S3 event notification records
Lecture 277 Testing the implementation
Lecture 278 Creating the invoice file DTO
Lecture 279 Creating the invoice transaction model
Lecture 280 Creating the invoice transaction repository
Lecture 281 Creating the method to persist an invoice transaction
Lecture 282 Creating the invoice model
Lecture 283 Creating the invoice repository
Lecture 284 Creating the method to persist an invoice
Lecture 285 Creating the method to get all invoices from a customer by his email
Lecture 286 Creating the method to process an invoice
Lecture 287 Testing the implementation
Lecture 288 Creating the method to check an invoice file transaction by its transactionId
Lecture 289 Creating the invoice DTO to be used by the new API
Lecture 290 Creating the operation to get all invoices from a customer, using his email
Lecture 291 Testing the implementation
Lecture 292 Testing with an invalid invoice file
Lecture 293 Testing the AWS S3 bucket lifecycle rule
Section 29: AWS CloudWatch Alarms
Lecture 294 Strategy to generate alarms based on application logs
Lecture 295 Creating the AWS CloudWatch alarm to monitor the application error log
Lecture 296 Strategy to generate alarms based on infrastructure parameters
Lecture 297 Creating the alarm to monitor the number of throttled events from the events DDB
Lecture 298 Testing the alarm based on application logs
Lecture 299 Testing the alarm based on infrastructure parameter
Section 30: AWS Cost Explorer
Lecture 300 AWS Cost Explorer concepts
Lecture 301 Analyzing the AWS Cost Explorer graphs and reports
Section 31: Conclusion
Lecture 302 Thank you!
Developers who want to learn about building microservice based applications on AWS;,Cloud computing beginners, with or without prior knowledge, who want to learn more about AWS.,Professionals with AWS certifications who want to get hands-on experience with AWS services,DevOps professionals who want to learn how to build container infrastructure on AWS,Professionals who want hands-on experience with infrastructure as code, or IaC