The ECS Continuous Deployment reference architecture demonstrates how to achievecontinuous deployment of an application to AmazonElastic Container Service (Amazon ECS) using AWS CodePipeline and AWSCodeBuild. With continuous deployment, software revisions are deployed to aproduction environment automatically without explicit approval from a developer,making the entire software release process automated.
Launching this AWS CloudFormation stack provisions a continuous deploymentprocess that uses AWS CodePipeline to monitor a GitHub repository for newcommits and AWS CodeBuild to create a new Docker container image and to push itinto Amazon Elastic Container Registry (Amazon ECR).
When creating this stack, you can opt to deploy the service onto AWSFargate or Amazon EC2. AWS Fargate allows you to run containerswithout managing clusters or services. If you choose Amazon EC2, an Auto Scalinggroup of t2.micro instances will be created to host your service.
Fork the Amazon ECS sampleapp GitHub repository intoyour GitHub account.
From your terminal application, execute the following command (make sure toreplace <your_github_username>
with your actual GitHub username):
git clone https://github.com/<your_github_username>/ecs-demo-php-simple-app
This creates a directory named ecs-demo-php-simple-app
in your currentdirectory, which contains the code for the Amazon ECS sample app.
Deploy | Region Name | Region | Launch Types |
---|---|---|---|
|
US East (N. Virginia) | us-east-1 | Fargate, EC2 |
|
US East (Ohio) | us-east-2 | EC2 |
|
US West (N. California) | us-west-1 | EC2 |
|
US West (Oregon) | us-west-2 | EC2 |
|
EU (Ireland) | eu-west-1 | EC2 |
|
EU (London) | eu-west-2 | EC2 |
|
EU (Frankfurt) | eu-central-1 | EC2 |
|
Asia Pacific (Singapore) | ap-southeast-1 | EC2 |
|
Asia Pacific (Sydney) | ap-southeast-2 | EC2 |
|
Asia Pacific (Tokyo) | ap-northeast-1 | EC2 |
|
Asia Pacific (Seoul) | ap-northeast-2 | EC2 |
|
Canada (Central) | ca-central-1 | EC2 |
This reference architecture can only be deployed to Regions which have allnecessary services available. See the RegionTablefor information about service availability.
The CloudFormation template requires the following parameters:
Cluster Configuration
GitHub Configuration
The CloudFormation stack provides the following output:
After the CloudFormation stack is created, the latest commit to the GitHubrepository is run through the pipeline and deployed to ECS. Open thePipelineUrl to watch the first revision run through the CodePipelinepipeline. After the deploy step turns green, open the URL from ServiceUrlwhich loads a page similar to this:
To test continuous deployment, make a change to src/index.php in theecs-demo-php-simple-app repository and push it to GitHub. CodePipeline detectsthe change, builds the new application, and deploys it to your clusterautomatically. After the pipeline finishes deploying the revision, reload thepage to see the changes made.
To remove all resources created by this example, do the following:
Delete the main CloudFormation stack which deletes the substacks and resources.
Manually delete resources which may contain content:
The following sections explains all of the resources created by theCloudFormation template provided with this example.
Resources that compose the deployment pipeline include the CodeBuild project,the CodePipeline pipeline, an S3 bucket for deployment artifacts, and allnecessary IAM roles used by those services.
An ECS task definition, service, IAM role, and ECR repository for the sampleapplication. This template is used by the CodePipeline pipeline to deploy thesample service continuously.
An ECS cluster optionally backed by an Auto Scaling group of EC2 instancesrunning the Amazon ECS-optimized AMI for the EC2 launch type.
An Application Load Balancer to be used for traffic to the sample application.
A VPC with two public subnets on two separate Availability Zones, an internetgateway, and a route table with a default route to the public internet.
This reference architecture sample is licensed under Apache 2.0.
Serverless Reference Architecture: Web Application README Languages:PT Introduction The Web Application reference architecture is a general-purpose, event-driven, web application back-end that uses AW
Yarn can easily be used in various continuous integration systems. To speed up builds, the Yarn cache directory can be saved across builds. AppVeyor Yarn is preinstalled on AppVeyor, so you don’t need
Lab: Build a Continuous Deployment Pipeline with Jenkins and Kubernetes For a more in depth best practices guide, go to the solution posted here. Introduction This guide will take you through the step
Question lintcode: (402) Continuous Subarray Sum Problem Statement Given an integer array, find a continuous subarray where the sum of numbers is the biggest. Your code should return the index of the
Question lintcode: (403) Continuous Subarray Sum II Maximum circular subarray sum - GeeksforGeeks Problem Statement Given an integer array, find a continuous rotate subarray where the sum of numbers i
Question lintcode: (397) Longest Increasing Continuous subsequence Problem Statement Give you an integer array (index from 0 to n-1, where n is the size of this array),find the longest increasing cont