Book Image

AWS CDK in Practice

By : Mark Avdi, Leo Lam
3.5 (2)
Book Image

AWS CDK in Practice

3.5 (2)
By: Mark Avdi, Leo Lam

Overview of this book

As cloud applications are becoming more complex, multiple tools and services have emerged to cater to the challenges of running reliable solutions. Although infrastructure as code, containers, and orchestration tools, such as Kubernetes, have proved to be efficient in solving these challenges, AWS CDK represents a paradigm shift in building easily developed, extended, and maintained applications. With AWS CDK in Practice, you’ll start by setting up basic day-to-day infrastructure while understanding the new prospects that CDK offers. You’ll learn how to set up pipelines for building CDK applications on the cloud that are long-lasting, agile, and maintainable. You’ll also gain practical knowledge of container-based and serverless application development. Furthermore, you’ll discover how to leverage AWS CDK to build cloud solutions using code instead of configuration files. Finally, you’ll explore current community best practices for solving production issues when dealing with CDK applications. By the end of this book, you’ll have practical knowledge of CDK, and you’ll be able to leverage the power of AWS with code that is simple to write and maintain using AWS CDK.
Table of Contents (17 chapters)
1
Part 1: An Introduction to AWS CDK
4
Part 2: Practical Cloud Development with AWS CDK
9
Part 3: Serverless Development with AWS CDK
12
Part 4: Advanced Architectural Concepts

What this book covers

Chapter 1, Getting Started with IaC and AWS CDK, will cover setting up your local machine for CDK development, introduce you to AWS CDK, and dive into its inner workings.

Chapter 2, A Starter Project and Core Concepts, will cover CDK integration using the monorepo model and core CDK concepts such as constructs, creating custom constructs, and community-maintained and construct libraries.

Chapter 3, Building a Full Stack Application with CDK, will guide you through building a full stack application using AWS CDK, Node.js, Express.js, React, ECS, and DynamoDB. You’ll learn how to create a backend API with Express.js, connect it to a React frontend, and deploy it using AWS CDK. Additionally, you’ll see how AWS CDK simplifies the process of building and deploying Docker images to AWS ECS.

Chapter 4, Complete Web Service Deployment with AWS CDK, will cover how to set up DNS for frontend and backend URLs with Route 53, create an AWS RDS MySQL database using AWS CDK and secure endpoints with AWS ACM TLS certificates, and set up CloudFront distribution for frontend assets.

Chapter 5, Continuous Delivery with CDK-Powered Apps, will provide an introduction to CI/CD and AWS’s toolset, creating different environments for our application, and using AWS’s CodeBuild and CodePipeline to implement a robust CI/CD process. We will also go over running the build for various branches and getting notifications of the build status.

Chapter 6, Testing and Troubleshooting AWS CDK Applications, will cover automated testing for AWS CDK applications. We’ll cover different types of tests, strategies for writing effective tests, and best practices for integrating testing into your AWS CDK development workflow.

Chapter 7, Serverless Application Development with AWS CDK, will cover creating a serverless application using AWS CDK. Topics include setting up an API Gateway, Lambda functions, a Step Functions state machine, and a DynamoDB table.

Chapter 8, Streamlined Serverless Development, will cover common serverless development issues and explore solutions for running Lambda application logic and AWS services locally. We’ll use tools such as LocalStack to simulate AWS services and integrate our Lambda functions with a local express server.

Chapter 9, Indestructible Serverless Application Architecture (ISAA), will talk about the Indestructible Serverless Application Architecture (ISAA), which uses AWS CDK to create highly resilient, scalable, and maintainable cloud applications. The principles of ISAA include a fuller stack, a serverless architecture, simplicity, a single-table design, and an event-driven architecture. This chapter is mostly theoretical and covers the principles of ISAA, technical requirements, and example scenarios.

Chapter 10, The Current CDK Landscape and Outlook, will give you an idea of the current landscape and outlook for AWS CDK, including how it has revolutionized the IaC landscape and enabled dynamic provisioning. This chapter also covers the use of AWS CDK in large organizations and explores CDK alternatives, such as Pulumi and CDKTF, as well as CDK-inspired projects such as CDK8S.