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

Executing the pipeline

We need to make a couple of changes to the source code before we execute the pipeline specific to our environment:

  1. We need to create a ecs-appsepc.yml file in our source code to specify how CodeDeploy will deploy the containers to the ECS cluster. We need to make sure that the task definition Amazon Resource Names (ARN) matches what we have in our environment:
Figure 11.29 – ecs-appspec.yml

Figure 11.29 – ecs-appspec.yml

  1. Another file we need to create is the taskdef.json file, based on which ECS service will create the containers. This task definition is part of the GitHub repository source code; you just need to make sure that the task definition ARN and the image URL match your environment:
Figure 11.30 – taskdef.json

Figure 11.30 – taskdef.json

  1. Once you check these files into your CodeCommit repository, aws-code-pipeline, AWS CodePipeline will start the execution. Alternatively, you can start the build by clicking on...