AWS CI: Creating End-to-End Pipeline with CodePipeline & CodeBuild with AWS Services

Sureshpasam
4 min readJun 18, 2024

--

Explore the detailed guide on implementing continuous integration on AWS using managed services. Learn about AWS CodePipeline, CodeBuild, GitHub integration, and more.

Services: AWS CI, continuous integration, AWS CodePipeline, AWS CodeBuild

ProjectDiagram

Mastering AWS CI with Real-Time Projects

Introduction:

Embark on a journey to understand how to create an end-to-end continuous integration pipeline on AWS using managed services. Dive into the details of AWS CodePipeline, CodeBuild, GitHub integration, and more.

Setting Up the Repository

Start by creating a Flask-based python application and setting up the repository. Learn to create a basic Docker file and understand its structure. Copy the requirements.txt and flask source code in the Docker file to prepare for the next steps.

Use this Git Repo: https://github.com/sureshpasam/aws-devops-zero-to-hero/blob/main/day-14/simple-python-app/app.py

AWS CodeBuild and IAM Roles

Understand the importance of IAM roles for AWS CodeBuild. Learn how to provide permissions, configure service roles, and manage access effectively. Create a build project in AWS CodeBuild and navigate the environment settings.

Steps to create Code Build Project:

  1. Goto Aws console and goto the AWS Code Build service -> create code build project

Enter the name of the project, source1 section select source provider — git hub

2. Click on connect and should be select connect to Github with connect using OAuth — Enter credentials of the Github then click on confirm

After Github connected displaying like this then add your repo and project

Goto Environment section like this:

Goto Build Spec File- write below like this — its already there in the project

https://github.com/sureshpasam/aws-devops-zero-to-hero/blob/main/day-14/simple-python-app/buildspec.yml

Note: Above Build spec file — Parameter- store — I was mentioned the creational in the AWS System Manager service, Above mentioned the naming format.

Storing Sensitive Information

Discover the best practices for storing sensitive information in AWS Systems Manager Parameter Store. Create parameters for Docker credentials and follow a standard format to enhance security and manage secrets efficiently.

Steps:

  1. goto to AWS System Manager -> Parameter Store and create parameter and type as secure string.
  2. In the value — you can add sensitive info like password etc

these key and values store under parameter store in the SSM
/myapp/docker-credentials/username = ur docker username
/myapp/docker-credentials/password = docker pwd
/myapp/docker-registry/url = docker.io

Here check pipeline manually trigger:

If we get above error manuall triggering the job — you need to give the permission for code Build tot the AWS System Manager service

Navigation: Goto-> IAM-> Roles->CodePipeRole choose-> Add permissions and attach the full access for system manage then

Come back to code build service and retry Build then build is succeed

Integrating AWS CodePipeline :

Learn how AWS CodePipeline acts as an orchestrator, automating AWS CodeBuild processes. Explore the seamless integration between GitHub and CodePipeline, enabling automated triggers for code changes and enhancing the CI workflow.

Steps:

  1. Goto Codepipeline service — Create pipeline with confiration

Click on Next, Fill the fields like below and click on next

Step3: Here we can select build provider and project name which we created AWS Code build project name

Step4: Click on above Next and click on skip deploy

currently we did the only CI Process

Total configuration details preview display below like this and click create pipeline.

Fillnally created pipelines display here and click on pipeline

If we commit do any commit in your source CI Process automatically trigger.

Conclusion:

By mastering AWS CI with real-time projects, you can streamline your development processes, automate workflows, and ensure efficient code deployment. Embrace the power of continuous integration on AWS for enhanced productivity.

--

--