Skip to content

AWS CodePipeline Video Streaming App

Level:Intermediate
Time:2-3 hours
Cost:medium
Works locally:No
Cloud creds:Yes
Cleanup:No
Reviewed:2026-05-30
Validation:npm run build

Video streaming app with AWS developer tools deployment files.

Outcome Passing pipeline run plus scan/deploy evidence
Tools used React, Vite, Docker, CodePipeline, CodeBuild, CodeDeploy, AWS, AWS CodePipeline
Best fit Intermediate - 2-3 hours
Student workstation Repository files CI/CD pipeline AWS account Validation proof
  • Install or review: React, Vite, Docker, CodePipeline, CodeBuild, CodeDeploy, AWS, AWS CodePipeline.
  • Use your own cloud account credentials and keep them out of commits.
  • This project expects cloud resources, so verify budget alerts and cleanup first.
  • Open the safety guide before running commands that create infrastructure.
Cost and credential stance

Cost risk is medium. Cloud target: AWS. Cloud credentials needed: Yes. Always use your own account, never commit secrets, and confirm cleanup before creating paid infrastructure.

Use this flow before you run commands:

  1. Read the cost and credential warning above.
  2. Review the validation, troubleshooting, cleanup, and portfolio proof sections below.
  3. Follow the original project guide preserved near the bottom of this page.
  4. Return to the validation and cleanup checks before you capture portfolio evidence.

Run the project validation command before and after meaningful changes:

Terminal window
npm run build
  • Run npm run build first so local tooling issues are visible early.
  • If a command fails, check tool versions, working directory, and required environment variables.
  • For cloud failures, confirm account identity, region, quotas, and least-privilege IAM.
  • For pipeline failures, check repository secrets, runner permissions, and pinned action versions.

No dedicated cleanup command was detected in the project README. Treat this as a warning: before provisioning anything, write down the exact delete, destroy, or rollback steps for your environment.

  • Validation command output: npm run build
  • Screenshot or terminal proof: Passing pipeline run plus scan/deploy evidence
  • Notes explaining what changed, what failed, and how you fixed it
  • Cleanup evidence, especially for cloud or Kubernetes resources

The original README content is preserved here for lab-specific commands and context. Headings are intentionally demoted so the page outline stays focused on the standard lab flow.

In This Project, we are Developing and Deploying a video streaming application on EC2 using Docker and AWS Developers Tools.

  • CodeCommit: For Source Code Management

  • CodeBuild: For building and testing our code in a serverless fashion

  • CodeDeploy: To deploy our code

  • CodePipeline: To streamline the CI/CD pipeline

  • System Manager: To store Parameters

  • DockerHub: To store Docker Images in a Repository

  • Identity and Access Management (IAM) for creating a Service Role

  • S3 for artifact storing

  • EC2 for Deployment

Clone this Repository

git clone https://github.com/devcloudninjas/DevOps-Projects.git
🛡️ 2026 DevSecOps Enhancements (What You Will Learn)
Section titled “🛡️ 2026 DevSecOps Enhancements (What You Will Learn)”

This repository’s buildspec.yml and Dockerfile have been heavily refactored from standard CI/CD scripts into a hardened DevSecOps pipeline:

  1. Unprivileged Containers: The container build no longer relies on the vulnerable nginx:stable-alpine image running as root. We have migrated to nginxinc/nginx-unprivileged:alpine, shifting the execution context to a safe, non-root user.
  2. Automated Vulnerability Scanning: A mandatory Trivy Image Scan gate now blocks the AWS CodeBuild pipeline from proceeding if CRITICAL or HIGH vulnerabilities are detected before pushing to DockerHub.
  3. Semantic Branch Versioning: We eradicated the latest Docker tag anti-pattern. The registry push uses the dynamic ${CODEBUILD_BUILD_NUMBER} to ensure every execution is uniquely traceable and immutable.
External image reference Source image
  • Create a Repository
External image reference Source image
  • Go to the IAM console and create a user.

  • Click on Create User -> User details -> Next.

  • Add Permission for full access to CodeCommit.

External image reference Source image
  • Click on Create for the user.

  • Click on the user and go to the security credentials section

  • Now we are going to create SSH credentials for this user.

  • Go to the terminal and run this command

ssh-keygen
  • Keep all the default values.

  • Copy the public key using cat ~/.ssh/id_rsa.pub. Paste it into the security credentials, and SSH public key for the CodeCommit section, and copy the SSH key id.

  • Go back to the repository and copy the URL for the git connection.

  • Now run

cd ~/.ssh
touch config
  • Host git-codecommit.*.amazonaws.com

  • User <paste the id of ssh key (can find after you paster your key in aws )-> IdentityFile ~/.ssh/id_rsa

  • Now we can connect to this repo.

  • Run this command now

git clone <SSH URL>
  • Now copy all the content from my git repository to your code commit repository.

  • And do a git push.

External image reference Source image
External image reference Source image
  • Click on Create build project

  • Follow this steps

External image reference Source image
External image reference Source image
External image reference Source image
  • CodeBuild will need buildspec.yml to build a project.

  • The buildspec.yml file is in the repository root folder.

  • Also, This project will containerize so that select the Enable this flag if you want to build Docker images or want your builds to get elevated privileges.

External image reference Source image
  • In this project, we will build and push a Docker image to the DockerHub repository.

  • So, We need DockerHub credentials like Username and Password.

  • Also, we are using a free API to consume movie/TV data in this Project. TMDB.

Using AWS System Manager for storing secrets

Section titled “Using AWS System Manager for storing secrets”
  • Goto AWS System Manager dashboard.

  • Click on Parameter Store -> Create parameter

  • In Parameter details

Add DockerHub Username

Name: /myapp/docker-credentials/username

Type: SecureString

Value: Add Your DockerHub Username

Add DockerHub Password

Name: /myapp/docker-credentials/password

Type: SecureString

Value: Add Your DockerHub Password or secret token

Add TMDB API Key

Name: /myapp/api/key

Type: SecureString

Value: Add Your TMDB API key

  • Also, Add Permission in CodeBuild Created Role to assess Parameters from CodeBuild to System Manager

  • For this, Create an inline policy.

{
"Sid": "Statement1",
"Effect": "Allow",
"Action": [
"ssm:GetParameters"
],
"Resource": [
"arn:aws:ssm:*:{AWS Account ID 12 Digit}:parameter/*"
]
}
External image reference Source image
External image reference Source image
External image reference Source image
External image reference Source image
External image reference Source image
External image reference Source image
  • Just for Test

  • Pull this Docker Image is locally using docker run -n netflix -p 8080:80 dhruvdarji123/netflix-react-app

External image reference Source image

In the CodeBuild console Click on Edit button -> Artifacts -> Type: “S3” -> put Uplode Location.

  • Create Application and Compute platform is EC2/On-premises

Create Service role (Give permissions -

1.AmazonEC2FullAccess

2.AmazonEC2RoleforAWSCodeDeploy

3. AmazonS3FullAccess

4.AWSCodeDeployeFullAccess

5.AWSCodeDeployRole

6.AmazonEC2RoleforAWSCodeDeployLimitaccesstoS3

External image reference Source image

Click Launch Instances

  • Amazon Linux -> t2.micro

  • Also, Create a Service Role for EC2 to access s3 & CodeDeploy

  • Goto IAM Dashboard -> Create Role -> Service Role -> EC2

  • Add this permission

  1. AmazonEC2FullAccess

  2. AmazonEC2RoleforAWSCodeDeploy

  3. AmazonS3FullAccess

  4. AWSCodeDeployFullAccess

External image reference Source image
  • Give Role name -> Click on Create Role
External image reference Source image
  • Give This Service Role here.
External image reference Source image
External image reference Source image
  • Add this Script to the User Data section.

  • Or Just run it manually.

  • For Amazon Linux

#!/bin/bash
sudo yum -y update
sudo yum install -y docker
sudo service docker start
sudo usermod -aG docker ec2-user
sudo yum -y install ruby
sudo yum -y install wget
cd /home/ec2-user
wget https://aws-codedeploy-ap-south-1.s3.ap-south-1.amazonaws.com/latest/install
sudo chmod +x ./install
sudo ./install auto
  • For Ubuntu
#!/bin/bash
sudo apt update
sudo install docker.io
sudo apt install ruby-full
wget cd /home/ubuntu wget https://aws-codedeploy-ap-south-1.s3.ap-south-1.amazonaws.com/latest/install
chmod +x ./install
sudo ./install auto
sudo service codedeploy-agent status
External image reference Source image
  • Create a CodeDeploy Group using the following Steps.
External image reference Source image
External image reference Source image
  • Click On Create Deployment

  • Start Deployment

External image reference Source image
  • Step 1: Choose pipeline setting -> PipelineName > Service role

  • Step 2: Add source stage -> CodeCommit > RepoName > BranchName > Select CodePipeline periodically for changes(For automation)

  • Step 3: Add build stage -> BuildProvider > Region > ProjectName > Single build

  • Step 4: Add deploy stage -> DeployProvider > Region > AppName > Deployment group

  • Step 5: Review

External image reference Source image
External image reference Source image
External image reference Source image

CodeDeploy

External image reference Source image
External image reference Source image
External image reference Source image

Thank you for taking the time to work on this tutorial/labs. Let me know what you thought!

Ensure to follow me on GitHub. Please star/share this repository
Section titled “Ensure to follow me on GitHub. Please star/share this repository”
External image reference Source image
Use the guide first.

The full learning flow stays on this page. Open GitHub only when a step asks you to inspect code, fork the lab, or download source assets.