Skip to content

AWS Deployment

πŸ”πŸ› οΈ Overview

Amazon Web Services (AWS) is a comprehensive cloud computing platform that offers services for computing, storage, deployment, and more. It's widely used for deploying containerized applications at scale using services like ECR, ECS, and Route 53.

πŸ’‘ Key Features

  • Elastic Container Registry (ECR) for secure Docker image storage
  • Elastic Container Service (ECS) to manage and scale containers
  • Load Balancers for traffic routing
  • Route 53 for domain management and DNS
  • IAM for fine-grained access control

πŸš€ Use Cases

  • Hosting containerized applications via ECS
  • Managing domain names with Route 53
  • Deploying static sites with S3 + CloudFront
  • Automating deployments with GitLab CI/CD

βš™οΈ Setup & Configuration

AWS CLI Configuration

Install AWS CLI and run:

aws configure

Then input:

  • Access Key ID

  • Secret Access Key

  • Default Region

  • Default Output Format

Pushing Docker Images to ECR

  1. Create a repository in AWS ECR with AWS CLI
aws ecr create-repository --repository-name <your-repository-name> --region <your-region>
  1. Authenticate Docker to AWS ECR
aws ecr get-login-password --region <your-region> | docker login --username AWS --password-stdin <aws_account_id>.dkr.ecr.<your-region>.amazonaws.com
  1. Tag Docker Image
docker tag <your-local-image-name>:<tag> <aws_account_id>.dkr.ecr.<your-region>.amazonaws.com/<your-repository-name>:<tag>
  1. Push image
docker push <aws_account_id>.dkr.ecr.<your-region>.amazon

πŸ’‘ Tip: Make sure your IAM user has the AmazonEC2ContainerRegistryFullAccess policy attached. You can assign it via the IAM Console or CLI.

ECS & Load Balancer Setup

To deploy the container:

  • Create an ECS Cluster
  • Define a Task and a Service
  • Use an Application Load Balancer (ALB)
  • Configure a Target Group linked to the ALB
  • Ensure proper security groups:
  • One for the ALB (open on HTTP/S)
  • One for the service (allow inbound from ALB security group)

πŸ’‘ Tip: Health checks are criticalβ€”set them up properly for your target group.

Route 53 Domain + Cognito

  • Use Route 53 to purchase/manage a domain
  • Attach custom domain to Cognito user pool
  • Ensure certificates are validated via ACM for HTTPS access

πŸ“š Resources

🧠 Notes & Tips

  • Networking is key: security groups and VPC subnets must allow communication
  • ECS with Fargate simplifies setup but limits customizability
  • Test services locally with Docker before pushing
  • IAM permissions are often a blockerβ€”grant exact rights needed for minimal privileges
  • Always monitor with CloudWatch for logs and performance insights