Developer Tools on AWS: CodeBuild, CodeDeploy, CodePipeline, SDKs, CloudShell and Amplify for Beginners
What Is CI/CD?
| Term | Meaning |
|---|---|
| Continuous Integration | Developers merge code often, and each change is built and tested automatically |
| Continuous Delivery | Every good build is ready to release, with a manual approval |
| Continuous Deployment | Every good build is released automatically |
text
Commit ─► Source ─► Build + Test ─► (Approve) ─► Deploy ─► Monitor
Git CodeBuild CodeDeploy / CloudFormation / ECS
Services in the Chain
| Service | Role |
|---|---|
| Source control | GitHub, GitLab, Bitbucket or AWS CodeCommit (check current availability for new customers) |
| CodeBuild | Fully managed build servers. Compile, test, build container images |
| CodeDeploy | Deploy to EC2, on-premises, Lambda or ECS with rolling and blue/green strategies |
| CodePipeline | Orchestrates the stages from source to production |
| CodeArtifact | Private package repository (npm, pip, Maven) |
| ECR | Container image registry |
| X-Ray | Trace requests to find slow or failing parts |
CodeBuild buildspec.yml
yaml
version: 0.2
phases:
install:
runtime-versions: {python: 3.12}
commands: [pip install -r requirements.txt]
build:
commands:
- pytest -q
- zip -r app.zip . -x ".git/*"
artifacts:
files: [app.zip, appspec.yml, scripts/**]
CodeDeploy appspec.yml (EC2)
yaml
version: 0.0
os: linux
files:
- source: /
destination: /var/www/app
hooks:
ApplicationStop: [{location: scripts/stop.sh, timeout: 60}]
AfterInstall: [{location: scripts/install.sh, timeout: 120}]
ApplicationStart: [{location: scripts/start.sh, timeout: 60}]
ValidateService: [{location: scripts/check.sh, timeout: 60}]
- In-place deployment updates existing servers in batches
- Blue/green builds a new set, shifts traffic, and can roll back fast
- Lambda and ECS support canary and linear traffic shifting
A Simple Pipeline
- Source: your Git repository branch
main - Build: CodeBuild runs the tests and creates the package
- Approval: manual approval for production (optional)
- Deploy: CodeDeploy to an Auto Scaling group or ECS service
- Add alarms and automatic rollback if health checks fail
SDKs, CLI and CloudShell
- AWS SDKs for Python (boto3), JavaScript, Java, .NET, Go and more let your code call AWS
- AWS CLI is the command line tool
- CloudShell is a free browser terminal with the CLI and your credentials already set up
- Use IAM roles for code running on AWS, never hard-coded keys
python
import boto3
s3 = boto3.client("s3")
for b in s3.list_buckets()["Buckets"]:
print(b["Name"])
s3.upload_file("report.pdf", "my-bucket", "reports/report.pdf")
AWS Amplify
- Helps frontend and mobile developers build full-stack apps
- Amplify Hosting: connect a Git repo and get build, deploy, HTTPS and preview URLs
- Libraries for authentication (Cognito), APIs, storage and data
Practice
- Open CloudShell and run
aws sts get-caller-identity - Write a buildspec and run a CodeBuild project on a sample repo
- Create a two-stage pipeline: source and build
- Host a static site with Amplify Hosting
- Use boto3 to list your buckets
Conclusion
CI/CD automates build, test and deploy. CodeBuild builds, CodeDeploy releases, CodePipeline connects the stages, SDKs and CloudShell let you work with AWS, and Amplify speeds up frontend hosting.
Quick Summary: CI/CD; services; buildspec; appspec; pipeline; SDK; Amplify.

