AWS CDK in Practice - Mark Avdi - E-Book

AWS CDK in Practice E-Book

Mark Avdi

0,0
35,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

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.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB

Seitenzahl: 217

Veröffentlichungsjahr: 2023

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



AWS CDK in Practice

Unleash the power of ordinary coding and streamline complex cloud applications on AWS

Mark Avdi

Leo Lam

BIRMINGHAM—MUMBAI

AWS CDK in Practice

Copyright © 2023 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Manager: Preet Ahuja

Publishing Product Manager: Niranjan Naikwadi

Content Development Editor: Sujata Tripathi

Technical Editor: Rajat Sharma

Copy Editor: Safis Editing

Project Coordinator: Ashwin Dinesh Kharwa

Proofreader: Safis Editing

Indexer: Tejal Daruwale Soni

Production Designer: Shankar Kalbhor

Marketing Coordinator: Rohan Dobhal

First published: June 2023

Production reference: 1180523

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-80181-239-9

www.packtpub.com

To my beloved daughter Olivia, you are the light of my life and the source of my inspiration. Your unwavering love and boundless curiosity inspire me to be a better person every day. To my parents, Nasrin and Fahim, I am forever grateful for your unwavering belief in me and for instilling in me the values of hard work, determination, and perseverance. This book is a tribute to your unwavering love and guidance, and I dedicate it to you with all my heart.

– Mark Avdi

Thank you to each and every one of the hardworking individuals at Westpoint, who have fully invested in our motto, “Build, deliver, and grow.”

And a very special thanks to Rico, Logan, and Roman; you give me the daily drive to be the best version of myself I can be. Thank you.

– Leo Lam

Contributors

About the authors

Mark Avdi is a seasoned technologist with a passion for building scalable cloud solutions and improving software productivity. In addition, he has extensive experience in software engineering, having worked in various industries such as finance, automotive, and education. Throughout his career, Mark has led and delivered numerous complex software solutions. His expertise and knowledge have been invaluable to the success of the Westpoint team and the technical direction of the company. As the chief technical officer (CTO) of Westpoint Software Solutions, Mark is responsible for overseeing the technical aspects of the company and guiding the development of cutting-edge software solutions.

We would like to extend our appreciation to all members of the Westpoint team whose dedication and hard work continue to inspire us to push the boundaries of what’s possible. Special thanks go to Hugo Bonatto and Gabriel Correia for their contributions to the book, which were invaluable in making it a success.

Leo Lam is a rugby player, coach, and team builder. A solutions architect by trade, Leo has utilized his expertise in the world of complex software architecture to that of an architect of technology teams. Drawing from the disciplined, hardworking, and delivery-focused ethos of the rugby teams he has played in and coached, Leo has implemented such values in the dedicated group of engineers at Westpoint where he is the team operations lead.

Leo has extensive experience within the world of cloud development and architecture, specifically AWS and AWS Cloud Development Kit (CDK). He has been on a mission to infuse the already knowledgeable team of engineers at Westpoint with efficient and modernized ways of development using infrastructure as code. This has allowed the Westpoint team to efficiently and effectively deliver highly complex and large-scale enterprise solutions at warp speed.

Nothing means more to Leo than a team that has discipline, accountability, and focus to deliver exactly what needs to be delivered.

About the reviewers

Dhiraj Khodade is an experienced, hands-on software architect and cloud engineer involved in the end-to-end architecture, design, and implementation of cloud-native applications. He has received a bachelor’s degree in computer science from the University of Pune in India. He has been in the IT space for 10 years.

Having started working on AWS CDK close to its inception, he loves the concept of Infrastructure as Code (IaC) using object-oriented programming and has used it to provision and maintain enterprise cloud platforms.

Dhiraj is a technophile who focuses on cutting-edge technologies and new platforms to stay at the forefront of the IT industry. Dhiraj likes to travel. He sometimes writes technology blogs. He lives with his wife in Tokyo, Japan.

I would like to thank my parents and my wife, Anjali, for their support. And special thanks to the AWS CDK open source community and experts for constantly putting their best foot forward each day, which has helped me avoid the tangled mess of CloudFormation and its maintenance nightmare.

Igor Soroka is the co-founder of and a consultant at Soroka Tech. He has spent the last three years working with serverless projects on AWS as a hands-on consultant, technical lead, and coach. Igor is a versatile cloud professional helping teams and companies of various sizes to change their ways of developing and deploying web applications. He prioritizes cost optimization, security, and high availability in his work. Igor has worked with start-ups, scale-ups, and Fortune 500 companies. Also, he shares his knowledge through blogs, talks, and podcasts as an AWS Community Builder.

Thank you to my family, who have been a pillar of strength, encouraging me every step of the way and providing me with the love and support that has helped me to achieve my goals. I also want to thank my cat, who has been a constant source of joy and comfort. His affectionate purrs and playful antics have made me smile even on the most challenging days, and I am grateful for his companionship.

Mischa Spiegelmock is a technical co-founder of multiple successful software start-ups in San Francisco, with experience in the tech industry since beginning his career at LiveJournal in 2005. He co-founded DoctorBase in 2009, a healthcare technology start-up, and JetBridge in 2017, a software consultancy focusing on building cloud-native applications and connecting top engineers worldwide with Silicon Valley start-ups. Mischa is a regular open source contributor and the author of the Leap Motion Essentials book from Packt, and has written and spoken on various technical topics to educate others.

Table of Contents

Preface

Part 1: An Introduction to AWS CDK

1

Getting Started with IaC and AWS CDK

Technical requirements

Introduction to AWS CDK

Setting up your local environment and writing your first CDK app

Setting up the AWS CLI and profile

Setting up the AWS CDK CLI

Creating a containerized web application in AWS CDK using Docker

Understanding the inner workings of AWS CDK

Summary

2

A Starter Project and Core Concepts

Technical requirements

The CDK monorepo model

High-level separation of concepts

CDK concepts

A CDK app

The organization of constructs

The Construct Hub

Summary

Part 2: Practical Cloud Development with AWS CDK

3

Building a Full Stack Application with CDK

Setting up and building the stack

Frontend

Backend

Fixing the frontend code

Examining the CDK code

DynamoDB table

S3 bucket

ECS setup

Summary

4

Complete Web Application Deployment with AWS CDK

Technical requirements

DNS with Route 53

Configuring the project

Completing the AWS console journey

MySQL powered by AWS RDS

Storing secrets

ACM certificate

Glue code

Summary

5

Continuous Delivery with CDK-Powered Apps

Introduction to CI/CD

What is continuous integration (CI)?

What is continuous delivery (CD)?

AWS’s CI/CD toolset

Technical requirements

GitHub personal access token

Slack integration steps

Creating various environments

Implementing a robust CI/CD process

Summary

6

Testing and Troubleshooting AWS CDK Applications

Technical requirements

Understanding the terms of testing

Various ways of testing CDK apps

Running the tests

Configuring the environments

Assertion tests

Snapshot tests

Examining CDK deployment logs

Debugging CDK apps using VSCode

Troubleshooting common problems with CDK

Bootstrapping

IAM permissions

Too many resources on the CloudFormation template

Non-deleted resources

Summary

Part 3: Serverless Development with AWS CDK

7

Serverless Application Development with AWS CDK

Technical requirements

Configuring the project

What is serverless?

Creating an API with AWS Lambda and API Gateway

Creating a health check path

Lambda function integration

Completing and deploying the serverless backend

Creating a GET and POST route to perform DynamoDB operations

Simplifying the Lambda integration

Creating and configuring a DynamoDB instance

Introduction to Step Functions

Summary

8

Streamlined Serverless Development

Technical requirements

Configuring the project

Common problems with serverless development

Running Lambda application logic locally

Using LocalStack to simulate AWS services

Installing LocalStack

Starting LocalStack

Configuring DynamoDB to work with LocalStack

Limitations of LocalStack

Summary

Part 4: Advanced Architectural Concepts

9

Indestructible Serverless Application Architecture (ISAA)

Technical requirements

What is ISAA?

ISAA principles

A fuller stack

Serverless

Simplicity

Event-driven architecture

Challenges with ISAA

Runaway costs

Lack of openness

Advantages of ISAA

Summary

10

The Current CDK Landscape and Outlook

Advanced ways that CDK is leveraged

Creating multiple CDK stacks

Dynamic provisioning

CDK for larger organizations

CDK for other platforms

Pulumi

CDKTF

CDK8S

Serverless Stack Toolkit

ISAA on Kubernetes

Where to go from here

Summary

Index

Other Books You May Enjoy

Part 1: An Introduction to AWS CDK

This part introduces AWS Cloud Development Kit (CDK) as a cloud provisioning tool. We will immediately get into the action by provisioning a container service on AWS using CDK, and then we will cover some of the core concepts before delving further into more advanced topics. This part has the following chapters:

Chapter 1, Getting Started with IaC and AWS CDKChapter 2, A Starter Project and Core Concepts