Book Image

Building and Delivering Microservices on AWS

By : Amar Deep Singh
4 (1)
Book Image

Building and Delivering Microservices on AWS

4 (1)
By: Amar Deep Singh

Overview of this book

Reliable automation is crucial for any code change going into production. A release pipeline enables you to deliver features for your users efficiently and promptly. AWS CodePipeline, with its powerful integration and automation capabilities of building, testing, and deployment, offers a unique solution to common software delivery issues such as outages during deployment, a lack of standard delivery mechanisms, and challenges faced in creating sustainable pipelines. You’ll begin by developing a Java microservice and using AWS services such as CodeCommit, CodeArtifact, and CodeGuru to manage and review the source code. You’ll then learn to use the AWS CodeBuild service to build code and deploy it to AWS infrastructure and container services using the CodeDeploy service. As you advance, you’ll find out how to provision cloud infrastructure using CloudFormation templates and Terraform. The concluding chapters will show you how to combine all these AWS services to create a reliable and automated CodePipeline for delivering microservices from source code check-in to deployment without any downtime. Finally, you’ll discover how to integrate AWS CodePipeline with third-party services such as Bitbucket, Blazemeter, Snyk, and Jenkins. By the end of this microservices book, you’ll have gained the hands-on skills to build release pipelines for your applications.
Table of Contents (21 chapters)
1
Part 1: Pre-Plan the Pipeline
6
Part 2: Build the Pipeline
11
Part 3: Deploying the Pipeline

What is an AppSpec file?

The CodeDeploy service uses the YAML or JSON formatted AppSpec file to provide instructions for the deployment. This file is usually referred to as the appspec.yml file and is provided with the deployment package.

When we deploy a package, the CodeDeploy agent reads this file and executes the instructions provided in the appsepc.yml file. This file has two sections – one provides information regarding where the CodeDeploy agent needs to copy the artifact or package for installation, and another section contains the hooks to execute scripts for a specific deployment lifecycle.

The appspec.yml file syntax changes a bit based on the target compute platform. In this chapter, we are focusing on deployment to EC2 instances, so we will discuss the appspec.yml file syntax specific to the EC2/on-prem instance perspective, and in later chapters, we will cover the other two compute type-specific changes. The following is the structure of the appspec.yml file...