Implementing Blue/Green Deployment for Dockerized Applications with AWS ECS/ECR | AWS Certified DevOps Engineer - Professional Exam

Blue/Green Deployment with AWS ECS/ECR

Prev Question Next Question

Question

A company just started to use AWS ECS/ECR for its dockerized applications.

They are looking for a pipeline service with a source stage that can deploy a container application to the ECS cluster using a blue/green deployment.

At the moment, all docker images are already stored in the ECR service which will be used in the pipelines as artifactories.

What is the quickest way to implement this pipeline?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer - D.

The question asks for the quickest way.

So it is possible that multiple answers may work.

However, we should find out the answer which is the most fit in this scenario without unnecessary efforts.

Option A is incorrect: Because CodePipeline is better in this case since it already provides a way for ECS blue/green deployment.

Option B is incorrect: Because using CloudFormation to deploy blue/green ECS services needs more effort and CodePipeline has already provided support for ECS deployment.

Option C is incorrect: Because AWS CodeDeploy cannot constitute a complete pipeline.

The pipeline needs a source stage.

When a new image is uploaded to Amazon ECR, the pipeline can automatically deploy container images.

Option D is CORRECT: Because a two-stages CodePipeline service can meet the need.

In its deployment stage, the action provider can be selected as Amazon ECS (Blue/Green):

y Access management
Service access report

Review access activity to learn when a principal within the organizational entity last accessed a service. Data is available for services that are allowed by directly attached SCPs only. Recent activity usually appears within 4 hours. Data is stored for a
Users maximum of 365 days. Learn more [7

Groups

Rol
oes Q Search services < 123 4 5 6 7 .. 28
Policies
Identity providers Service Vv Last accessed
Account settings
AWS Organizations Today
y Access reports
AWS Identity and Access Management Today
Access analyzer
Archive rules ‘Amazon CloudWatch Today
Analyzers Amazon DynamoDB. Today
Settings
AWS Health APIs and Notifications Today
Credential report
‘Amazon CloudWatch Logs Today
Organization activity
AWS Trusted Advisor Today

Service control policies (CPs)

The correct answer is D. In AWS CodePipeline, add a source stage for ECR docker image and a deployment stage for ECS where the deployment runs with a CodeDeploy application and deployment group.

Explanation: AWS CodePipeline is a fully managed continuous delivery service that helps you automate your release pipelines for fast and reliable application and infrastructure updates. In this scenario, the quickest way to implement the pipeline is by using AWS CodePipeline.

Option A, creating a Jenkins server in the EC2 instance, requires manual configuration and maintenance of the Jenkins server, which can be time-consuming and resource-intensive.

Option B, using AWS CodePipeline with AWS CodeBuild and CloudFormation, is a possible solution, but it involves more steps than necessary. CodePipeline with CodeBuild is used for building and testing applications, but since the company is already using ECR, it would be more efficient to use that as the artifact store.

Option C, using AWS CodeDeploy, is also a possible solution, but it is designed for deploying code rather than containers, and it is more complex than necessary.

Option D, using AWS CodePipeline with a source stage for ECR and a deployment stage for ECS with a CodeDeploy application and deployment group, is the quickest and most efficient way to implement the pipeline.

To implement this pipeline using AWS CodePipeline, you can follow these steps:

  1. Create an AWS CodePipeline pipeline with a source stage and a deployment stage.

  2. Configure the source stage to use the ECR repository as the artifact store.

  3. Configure the deployment stage to use CodeDeploy to deploy the container to the ECS cluster using a blue/green deployment.

  4. Configure the CodeDeploy application and deployment group to use the ECS service as the deployment target.

  5. Configure the CodeDeploy deployment group to use the ECR repository as the source of the container image.

  6. Configure the CodeDeploy deployment group to use a blue/green deployment strategy to deploy the new container to the ECS service.

Once you have configured the pipeline, any changes to the container image stored in the ECR repository will trigger the pipeline, which will then deploy the new container to the ECS cluster using a blue/green deployment.