What are the basics of AWS deployment?
Choosing a deployment service
EC2 gives you virtual machines, so you manage the operating system and app setup yourself. Elastic Beanstalk takes uploaded code and handles much of the server setup for common languages. ECS and EKS run containers, with ECS being AWS-specific and EKS running managed Kubernetes.
Lambda runs functions on demand, and App Runner can run containers or source code with less configuration. Pick the simplest option that fits how your app runs.
- EC2: full control, more maintenance
- Elastic Beanstalk: simpler web app hosting
- ECS or EKS: container-based services
- Lambda or App Runner: less server management
The basic deployment steps
Start by building your application into a deployable artifact, such as a zip file or container image. Store container images in Amazon ECR or artifacts in S3, then point your service at that version. Use a load balancer when you need traffic spread across several instances.
Set up networking with a VPC, subnets and security groups so only the ports you need are open. Give the service an IAM role with only the permissions it requires.
Costs and limits
AWS uses pay-as-you-go pricing, and costs vary by service, region and usage. Free tier offers exist, but their terms and amounts change, so check the AWS Free Tier page and pricing calculator before you launch.
Tear down test resources when you finish. Idle load balancers, NAT gateways and unused volumes are common sources of unexpected charges.
Common mistakes
- Opening security groups to all traffic during setup and forgetting to tighten them later.
- Using broad admin permissions for the app instead of a narrow IAM role.
