AWS DevOps Services
AWS offers managed building blocks for CI/CD, infrastructure as code and operations. Many teams combine them with GitHub Actions.
On this page · 5 min · Advanced
On this page
- Learning objectives
- Explanation
- Code example
- Step by step
- Real-world use
- Common mistakes
- Best practices
- Remember this
- Practice exercise
- Mini quiz
- Related topics
- My notes
- Reading time
- 5 min
- Difficulty
- Advanced
- Updated
- Oct 29, 2026
Related tutorials
Learning objectives#
- Name the core AWS DevOps services
- Choose between CodePipeline and GitHub Actions
- Deploy to AWS from GitHub with OIDC
- Know the operations tools
Explanation#
CodeBuild runs builds; CodePipeline orchestrates stages; CodeDeploy handles in-place and blue/green deployments to EC2, ECS and Lambda.
CloudFormation and the CDK define infrastructure; ECR stores images; CloudWatch monitors; Systems Manager runs commands and stores parameters.
GitHub Actions can deploy to AWS using an IAM role trusted via OIDC — no access keys in GitHub.
Code example: Deploy a container to ECS from GitHub Actions#
permissions: { id-token: write, contents: read }
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::123456789012:role/github-deploy
aws-region: ap-south-1
- uses: aws-actions/amazon-ecr-login@v2
id: ecr
- run: |
IMAGE=${{ steps.ecr.outputs.registry }}/shop-api:${{ github.sha }}
docker build -t $IMAGE . && docker push $IMAGE
echo "image=$IMAGE" >> $GITHUB_OUTPUT
id: build
- uses: aws-actions/amazon-ecs-render-task-definition@v1
id: td
with: { task-definition: taskdef.json, container-name: api, image: '${{ steps.build.outputs.image }}' }
- uses: aws-actions/amazon-ecs-deploy-task-definition@v2
with: { task-definition: '${{ steps.td.outputs.task-definition }}', cluster: shop, service: shop-api, wait-for-service-stability: true }
The workflow assumes an IAM role, pushes the image to ECR, updates the ECS service and waits until the new tasks are healthy.
This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.
Step-by-step explanation#
- OIDC exchanges a GitHub token for temporary AWS credentials.
- The image is tagged with the commit SHA and pushed to ECR.
- The task definition is updated with the new image.
- ECS rolls out the new tasks and the job waits for stability.
Real-world use case#
A team keeps code and CI in GitHub while running production on AWS ECS Fargate.
Common mistakes#
Use OIDC and an IAM role restricted to the repo and branch.
The pipeline reports success while the new tasks are crashing.
Best practices#
- OIDC roles scoped to repo and branch
- Infrastructure in CloudFormation/CDK or Terraform
- Deployment circuit breaker with rollback on ECS
- CloudWatch alarms on every service
Remember this#
CodeBuild builds, CodePipeline orchestrates, CodeDeploy deploys.
GitHub → AWS via OIDC role.
Wait for stability before declaring success.
Practice exercise#
Your task: Which AWS service would run your unit tests in a fully AWS-native pipeline?
Show solution
AWS CodeBuild (orchestrated by CodePipeline).
Mini quiz#
How should GitHub Actions authenticate to AWS?
Want more? Practise all DevOps MCQs · DevOps interview questions
My notes#
Saved in this browser.