Skip to content

AWS DevOps — CodePipeline, CodeBuild, CodeDeploy

AWS provides a native set of DevOps tools that together form a complete CI/CD pipeline. They can also be combined with GitHub Actions, Jenkins, or any third-party tool.

In Azure terms: AWS DevOps tools ≈ Azure DevOps Pipelines (all-in-one)

ServiceRoleAzure Equivalent
CodeCommitGit repository hostingAzure Repos
CodeBuildManaged build serviceAzure Pipelines (build stage)
CodeDeployAutomated deployment to EC2, ECS, LambdaAzure Pipelines (release stage)
CodePipelineOrchestrates the full CI/CD workflowAzure Pipelines (full pipeline)
CodeArtifactPackage repository (npm, Maven, NuGet, PyPI)Azure Artifacts
CodeGuruAI-powered code review and profilingGitHub Copilot / Azure DevOps reviews
AWS CDKDefine infrastructure in code (TypeScript, Python…)Bicep / ARM Templates
CloudFormationDeploy infrastructure via YAML/JSON templatesARM Templates

CodePipeline is the pipeline orchestrator — it connects your source, build, test, and deploy stages:

Source (GitHub/CodeCommit)
Build (CodeBuild)
Test (CodeBuild or Lambda test runner)
Deploy Staging (CodeDeploy / ECS)
↓ Manual Approval
Deploy Production (CodeDeploy / ECS)
StageExample Actions
SourceCodeCommit, GitHub, Bitbucket, S3
BuildCodeBuild, Jenkins
TestCodeBuild, AWS Device Farm
DeployCodeDeploy, ECS, Elastic Beanstalk, CloudFormation, S3
InvokeLambda function
ApprovalManual approval gate

CodeBuild is a fully managed build service — no Jenkins servers to maintain. It compiles code, runs tests, and produces build artifacts.

Every CodeBuild project uses a buildspec.yml at the repo root:

version: 0.2
phases:
install:
runtime-versions:
nodejs: 20
commands:
- npm install
pre_build:
commands:
- echo "Running tests..."
- npm test
build:
commands:
- echo "Building application..."
- npm run build
- docker build -t my-app .
- docker tag my-app:latest $ECR_URI:$CODEBUILD_RESOLVED_SOURCE_VERSION
post_build:
commands:
- aws ecr get-login-password | docker login --username AWS --password-stdin $ECR_URI
- docker push $ECR_URI:$CODEBUILD_RESOLVED_SOURCE_VERSION
artifacts:
files:
- imagedefinitions.json
RuntimeVersions
Node.js18, 20
Python3.11, 3.12
Java11, 17, 21
.NET6, 8
Go1.21
Ruby3.2
DockerAvailable in all environments

CodeDeploy automates application deployments to EC2, on-premises servers, Lambda, and ECS.

StrategyDescriptionDowntime
In-placeUpdate existing instances (stop, deploy, start)Brief
RollingUpdate instances in batchesMinimal
Blue/GreenShift traffic from old (blue) to new (green)Zero
CanaryRoute 10% traffic to new, then 100%Zero
LinearGradually shift traffic over timeZero
version: 0.0
os: linux
files:
- source: /
destination: /var/www/html
hooks:
BeforeInstall:
- location: scripts/stop-server.sh
AfterInstall:
- location: scripts/start-server.sh
ValidateService:
- location: scripts/health-check.sh

Many teams use GitHub Actions as the CI/CD engine instead of AWS native tools. This is fully supported:

.github/workflows/deploy.yml
name: Deploy to AWS
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write # for OIDC
contents: read
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials (OIDC — no stored secrets)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::123456789012:role/github-deploy-role
aws-region: us-east-1
- name: Login to ECR
uses: aws-actions/amazon-ecr-login@v2
- name: Build and push Docker image
run: |
docker build -t $ECR_REGISTRY/my-app:$GITHUB_SHA .
docker push $ECR_REGISTRY/my-app:$GITHUB_SHA
- name: Deploy to ECS
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: task-def.json
service: my-service
cluster: my-cluster
FeatureAWSAzure
Git repoCodeCommit (or GitHub)Azure Repos (or GitHub)
CI buildCodeBuildAzure Pipelines build
CD deployCodeDeployAzure Pipelines release
PipelineCodePipelineAzure Pipelines
ArtifactsCodeArtifactAzure Artifacts
IaCCloudFormation / CDKARM / Bicep / Terraform
Container registryECRACR
SecretsSecrets Manager / SSMAzure Key Vault