In this section, we will create a DevOps pipeline with the following actions:
A source stage with CodeCommit action
A build stage with CodeBuild action
A deployment stage with an Amazon ECS deploy action with Blue/Green Deployment.
Sign in to the AWS Management Console and open the CodePipeline console
On the Welcome page, Getting started page, or the Pipelines page, choose Create pipeline.
In Step 1: Choose pipeline settings, in Pipeline name, enter
In Service role, Choose New service role to allow CodePipeline to create a new service role in IAM. Enter name as
In Artifact store, Choose Default location to use the default artifact store, such as the Amazon S3 artifact bucket designated as the default, for your pipeline in the region you have selected for your pipeline.
In Step 2: Add source stage, in Source provider, choose AWS CodeCommit. In Repository name, choose the name of the CodeCommit repository
tripmgmtdemo. In Branch name, choose the name of the branch that contains your latest code update
In Step 3: Add build stage, in Build provider, choose AWS CodeBuild. In Project name choose the name of the build project.
Choose Skip deploy stage and let first build complete.
Review, review the information, and then choose Create pipeline.
Add Deploy Stage
Open the CodePipeline console
default region from top section.
Select the Pipeline name, For example
Click Edit, and scroll down at bottom and “Add Stage” , give Stage name as
Click Add action group, in Action name give action name
In Action provider, choose Amazon ECS (Blue/Green).
In Input artifacts, choose SourceArtifact
In AWS CodeDeploy application name, choose CodeDeploy Application name. In AWS CodeDeploy deployment group, choose CodeDeploy Application’s Deployment Group.
In Amazon ECS task definition, choose SourceArtifact and enter
In AWS CodeDeploy AppSpec file, choose SourceArtifact and enter