Skip to main content

Command Palette

Search for a command to run...

Part 2:Practical Guide: Continuous Integration in AWS with CodePipeline + CodeBuild

Updated
2 min read
Part 2:Practical Guide: Continuous Integration in AWS with CodePipeline + CodeBuild
S

🌱 Just a fresher, vibin’ through tech life. ☁️ Cloud & DevOps rookie, tryna get my hands dirty with real stuff. 🛠️ Writing blogs in my own chill style ’cause most guides feel way too pro-level. 🚀 Learning, breaking, fixing, and sharing my journey—no sugarcoat, just raw curiosity.

Hello techies!!
I’m back with the practical part of AWS CI/CD. In this post, we’ll implement Continuous Integration (CI) using CodePipeline to invoke a CodeBuild process.

So why wait? Let’s dive in!

Prerequisites

Step 1: Create a CodeBuild Project

  1. Log in to the AWS Console.

  2. Navigate to CodeBuild → Create project.

  3. Follow the steps as specified in the picture:

Connect GitHub account (for source).

Enable the editor and paste the buildspec.yaml code from the GitHub repo.

For Service Role, choose New service role.

  • AWS will create a default role for you.
  • Click Create Project.

tep 2: Secure Credentials with Parameter Store

Hardcoding credentials inside buildspec.yaml is a bad practice—anyone with repo access can see them.
Instead, use AWS Systems Manager Parameter Store.

  1. Go to Parameter Store → Create parameter.

  2. Choose SecureString type.

  3. Create parameters (names must match env variables in buildspec.yaml):

    • /myapp/docker-credentials/username

    • /myapp/docker-credentials/password

    • /myapp/docker-registry/url

  4. Save each parameter.

👉 This way, CodeBuild fetches secrets securely at runtime.

Step 3: Attach IAM Policy

  • Go to the IAM Role created for CodeBuild.

  • Attach AmazonSSMFullAccess policy.

  • This gives CodeBuild permission to fetch parameters from the store.
    (Note: For practice, full access is okay, but in production use least-privilege.)

Step 4: Create CodePipeline

  1. Go to CodePipeline → Create pipeline.

  2. Select Custom project.

    Now specify details as mentioned in below:

Click Create.

you will see:

CI process is successful:

Output

Once you commit changes in GitHub, CodePipeline will trigger CodeBuild automatically.
You’ll see the build logs and confirm the Docker image being pushed to the registry.

Congratulations—you just implemented Continuous Integration in AWS CI/CD!

What’s Next?

In the next part, we’ll extend this CI flow to Continuous Deployment (CD) using CodeDeploy. Stay tuned!

More from this blog

DevOps for Lazy Geniuses

24 posts