Getting Started with AWS

Create Continuous Delivery Pipeline

Set up a git repo, deploy a sample web app, and create a continuous delivery pipeline

Module 5: Finalize Pipeline and Test

In this module you will add a review stage to your countinuous delivery pipeline using AWS CodePipeline.

Introduction

In this module, you will use AWS CodePipeline to add a review stage to your countinuous delivery pipeline.

As part of this process, you can add an approval action to a stage at the point where you want the pipeline execution to stop so someone can manually approve or reject the action. Manual approvals are useful to have someone else review a change before deployment. If the action is approved, the pipeline execution resumes. If the action is rejected—or if no one approves or rejects the action within seven days—the result is the same as the action failing, and the pipeline execution does not continue.

What You Will Learn

  • Add a review stage to your pipeline
  • Manually approve a change before it is deployed

Key Concepts

Approval Action Type of pipeline action that stops the pipeline execution until someone approves or rejects it.

Pipeline Execution Set of changes, such as a merged commit, released by a pipeline. Pipeline executions traverse the pipeline stages in order. Each pipeline stage can only process one execution at a time. To do this, a stage is locked while it processes an execution.

Failed Execution If an execution fails, it stops and does not completely traverse the pipeline. The pipeline status changes to "Failed" and the stage that was processing the execution is unlocked. A failed execution can be retried or replaced by a more recent execution.

 Time to Complete

5 minutes

 Services Used

Implementation

  • Create review stage in pipeline
    1. Open the AWS CodePipeline Console.
    2. You should see the pipeline we created in Module 4, which was called "Pipeline-DevOpsGettingStarted." Click on this pipeline.
    3. Click the white "Edit" button near the top of the page.
    4. Click the white "Add stage" button between the "Build" and "Deploy" stages.
    5. In the "Stage name" field type "Review."
    6. Click the orange "Add stage" button.
    7. In the "Review" stage, click the white "Add action group" button.
    8. Under "Action name" type "Manual_Review."
    9. From the "Action provider" select "Manual approval."
    10. Confirm that the optional fields have been left blank.
    11. Click the orange "Done" button.
    12. Click the orange "Save" button at the top of the page.
    13. Click the orange "Save" button to confirm the changes. You will now see your pipeline with four stages: "Source," "Build," "Review," and "Deploy."
  • Push a new commit to your repo
    1. In your favorite code editor open the "app.js" file from Module 1.
    2. Change the message in Line 5.
    3. Save the file.
    4. Open your preferred Git Client.
    5. Navigate to the folder created in Module 1.
    6. Commit the change with the following commands:
    git add app.js
    git commit -m "Full pipeline test"

    7. Push the local changes to the remote repo hosted on GitHub with the following command:

    git push
  • Monitor the pipeline and manually approve the change
    1. Navigate to the AWS CodePipeline Console.
    2. Click on the pipeline named "Pipeline-DevOpsGettingStarted." You should see the "Source" and "Build" stages switch from blue to green.
    3. When the "Review" stage switches to blue, click on the white "Review" button.
    4. Write an approval comment in the "Comments" text box.
    5. Click the orange "Approve" button.
    6. Wait for the "Review" and "Deploy" stages to switch to green.
    7. Click on the AWS Elastic Beanstalk link in the "Deploy" stage. A new tab listing your Elastic Beanstalk environments will open.
    8. Click the URL on the "Devopsgettingstarted-env" row. You should see a web page with a white background and the text you had in your most recent GitHub commit.

    Congratulations! You have a fully functional continuous delivery pipeline hosted on AWS.

Application Architecture

With all modules now completed, here is the architecture of what you built:

Module-5

We have used AWS CodePipeline to add a review stage with manual approval to our continuous delivery pipeline. Now, our code changes will have to be reviewed and approved before they are deployed to AWS Elastic Beanstalk.

Clean up resources

  • Delete AWS Elastic Beanstalk application
    1. In a new browser window, open the AWS Elastic Beanstalk Console.
    2. In the left navigation menu, click on "Applications." You should see the "DevOpsGettingStarted" application listed under "All applications."
    3. Select the radio button next to "DevOpsGettingStarted."
    4. Click the white dropdown "Actions" button at the top of the page.
    5. Select "Delete application" under the dropdown menu.
    6. Type "DevOpsGettingStarted" in the text box to confirm deletion.
    7. Click the orange "Delete" button.
  • Delete pipeline in AWS CodePipeline
    1. In a new browser window, open the AWS CodePipeline Console.
    2. Select the radio button next to "Pipeline-DevOpsGettingStarted."
    3. Click the white "Delete pipeline" button at the top of the page.
    4. Type "delete" in the text box to confirm deletion.
    5. Click the orange "Delete" button.
  • Delete pipeline resources from Amazon S3 bucket
    1. In a new browser window, open the Amazon S3 Console.
    2. You should see a bucket named "codepipeline-us-west-2" followed by your AWS account number. Click on this bucket. Inside this bucket, you should see a folder named "Pipeline-DevOpsGettingStarted."
    3. Select the checkbox next to the "Pipeline-DevOpsGettingStarted" folder.
    4. Click the white "Actions" button from the dropdown menu.
    5. Select "Delete" under the dropdown menu.
    6. Click the blue "Delete" button.
  • Delete build project in AWS CodeBuild
    1. In a new browser window, open the AWS CodeBuild Console.
    2. In the left navigation, click on "Build projects" under "Build." You should see the "Build-DevOpsGettingStarted" build project listed under "Build project."
    3. Select the radio button next to "Build-DevOpsGettingStarted."
    4. Click the white "Delete build project" button at the top of the page.
    5. Type "delete" in the text box to confirm deletion.
    6. Click the orange "Delete" button.

Was this module helpful?

Thank you
Please let us know what you liked.
Close
Sorry to disappoint you
Is something out-of-date, confusing or inaccurate? Please help us improve this tutorial by providing feedback.
Close

Congratulations!

You successfully built a continuous delivery pipeline on AWS! As a great next step, dive deeper into specific AWS technologies and take your application to the next level.