DevOps · Platforms

AWS DevOps Services

AWS offers managed building blocks for CI/CD, infrastructure as code and operations. Many teams combine them with GitHub Actions.

Advanced 5 min Lesson 29 of 30
Before you start:CI/CD Fundamentals
0/30 in DevOps
On this page · 5 min · Advanced

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#

YAML.github/workflows/aws-deploy.yml Illustrative
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 }
Expected output
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#

  1. OIDC exchanges a GitHub token for temporary AWS credentials.
  2. The image is tagged with the commit SHA and pushed to ECR.
  3. The task definition is updated with the new image.
  4. 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#

AWS access keys stored as GitHub secrets

Use OIDC and an IAM role restricted to the repo and branch.

Not waiting for service stability

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
Text Illustrative
AWS CodeBuild (orchestrated by CodePipeline).

Mini quiz#

AWS DevOps Services quizMultiple choice Question 1 of 1

How should GitHub Actions authenticate to AWS?

Score so far: 0/0

Want more? Practise all DevOps MCQs · DevOps interview questions

My notes#

Saved in this browser.

Progress is saved in this browser. Sign in to sync.