EC2 인스턴스
클라우드의 가상 서버. 구매 옵션 선택이 곧 비용 문제의 정답
이게 뭔가요? / What is this?
EC2는 실제로 만질 수 있는 물리 서버가 아니라 가상 컴퓨팅 자원입니다. AWS가 가진 거대한 물리 서버 한 대를 여러 고객이 논리적으로 나눠 쓰는데, 그중 내 몫으로 떼어진 "가상의 컴퓨터 한 대"가 EC2 인스턴스입니다. 내 노트북에 운영체제를 깔고 프로그램을 설치하듯, 원격에 있는 이 가상 컴퓨터에 접속해 운영체제를 고르고 프로그램을 설치·실행한다고 생각하면 됩니다.
개요 / Overview
EC2는 필요한 만큼 가상 머신을 빌려 쓰는 IaaS입니다. 시험에서 EC2 문제는 대부분 "어떤 인스턴스 타입인가"가 아니라 "어떤 구매 옵션이 가장 저렴한가", "어떻게 가용성을 확보하는가"를 묻습니다. 단독 EC2는 거의 정답이 아니며, ALB + Auto Scaling Group + 다중 AZ 조합이 기본형입니다.
동작 원리 / How it works
EC2 인스턴스는 AWS가 운영하는 물리 서버 위에서 Nitro 하이퍼바이저가 잘라낸 가상 머신입니다. 인스턴스를 시작하면 AMI(디스크 이미지)가 EBS 볼륨으로 복제되고, 지정한 서브넷에 ENI(가상 네트워크 카드)가 붙고, 그 ENI에 보안 그룹이 적용됩니다. 즉 인스턴스는 "컴퓨팅 + 디스크 + 네트워크 인터페이스"의 조립품이며, 시험 문제는 이 세 조각 중 어디가 병목이거나 잘못 묶였는지를 묻습니다.
중요한 물리적 사실 하나: 인스턴스는 하나의 가용 영역(AZ)에 존재하고 EBS 볼륨도 같은 AZ에 묶입니다. 그래서 "AZ가 죽으면 어떻게 되는가"가 곧 EC2 아키텍처 문제의 출발점입니다. 인스턴스를 여러 AZ에 흩뿌리고(ASG), 앞에 로드 밸런서를 두고, 상태는 인스턴스 밖(S3·EFS·RDS·ElastiCache)으로 빼는 구조가 나오는 이유가 이것입니다.
시험은 무엇을 보는가 / What the exam is testing
시험은 EC2를 통해 두 가지 판단력을 봅니다. 첫째는 비용 판단 — 워크로드의 시간적 성격(중단 가능한가, 상시인가, 예측 가능한가)을 읽고 구매 옵션을 고르는 능력입니다. 둘째는 결합도 판단 — 무엇을 인스턴스에 두고 무엇을 밖으로 빼야 하는지입니다. EC2가 등장하는 319문제 중 대부분은 이 둘 중 하나이며, 인스턴스 타입 스펙을 외우는 문제는 거의 없습니다.
시험 포인트 / Exam points
On-Demand(유연, 비쌈) / Spot(최대 90% 할인, 2분 전 중단 경고, 무상태·내결함성 배치용) / Reserved·Savings Plans(1~3년 약정, 최대 72% 할인, 예측 가능한 상시 워크로드) / Dedicated Host(물리 서버 점유, BYOL 라이선스·규제 준수). "중단되어도 괜찮다" → Spot, "24시간 꾸준히 돈다" → RI/Savings Plans.
Cluster는 단일 AZ에 인스턴스를 물리적으로 밀집시켜 최저 지연시간과 최대 100Gbps를 얻습니다(HPC). Spread는 인스턴스마다 별도 랙에 분산해 동시 장애를 막습니다(AZ당 최대 7개). Partition은 파티션 단위로 하드웨어를 격리해 HDFS·Cassandra 같은 대규모 분산 시스템에 씁니다.
EC2에서 S3·DynamoDB에 접근해야 할 때 액세스 키를 인스턴스에 저장하는 선택지는 항상 오답입니다. 인스턴스 프로파일에 IAM 역할을 붙이면 임시 자격 증명이 자동 교체되며 배포됩니다.
여러 EC2가 각자 EBS에 파일을 쓰면 사용자마다 다른 결과를 봅니다. 공유 파일은 EFS, 객체는 S3, 세션은 ElastiCache 또는 DynamoDB로 빼는 것이 정석 패턴입니다.
자주 틀리는 함정 / Common traps
액세스 키를 인스턴스에 저장하거나 사용자 데이터에 넣는 선택지 — 자격 증명이 AMI·스냅샷·로그로 새어 나가고 교체가 불가능합니다. 정답은 항상 인스턴스 프로파일에 IAM 역할을 붙이는 것입니다.
"더 큰 인스턴스로 교체"로 확장성 문제를 푸는 선택지 — 수직 확장은 상한이 있고 재시작이 필요합니다. 부하가 변동한다면 ASG로 수평 확장하는 쪽이 정답입니다.
각 인스턴스의 EBS에 사용자 업로드를 저장하는 구성 — 로드 밸런서가 요청을 분산하면 사용자가 새로고침마다 다른 파일 집합을 보게 됩니다. 공유 스토리지(EFS)나 객체 스토리지(S3)로 빼야 합니다.
헷갈리는 것 구분하기 / Telling them apart
워크로드가 중단을 견디는가로 갈립니다. 견디면 Spot(최대 90% 할인), 못 견디고 상시 가동이면 약정 할인(최대 72%). 둘은 배타적이 아니어서 ASG 혼합 정책으로 함께 쓸 수 있습니다.
Dedicated Host는 물리 서버 자체를 점유해 소켓·코어 수가 보이므로 코어 단위 BYOL 라이선스를 충족할 수 있습니다. Dedicated Instance는 하드웨어를 독점하지만 어느 물리 서버인지 통제하지 못해 BYOL 요구를 만족하지 못합니다.
권장 아키텍처 패턴 / Reference pattern
Amazon EC2
Virtual servers in the cloud; the purchase option is usually the answer
이게 뭔가요? / What is this?
EC2 is not a physical server you can touch — it is a virtual compute resource. AWS slices one giant physical machine into logically separate shares for many customers, and the share assigned to you is an EC2 instance. It works like installing an OS and programs on your own laptop, except the "computer" is remote: you connect to it, pick an OS, and install and run software on it.
개요 / Overview
EC2 rents virtual machines on demand. Exam questions rarely turn on instance families; they turn on which purchase option is cheapest and how availability is achieved. A lone EC2 instance is almost never the answer — ALB + Auto Scaling Group across multiple AZs is the default shape.
동작 원리 / How it works
An EC2 instance is a virtual machine carved out of AWS-operated physical hardware by the Nitro hypervisor. Launching one clones an AMI onto an EBS volume, attaches an ENI in your chosen subnet, and applies security groups to that ENI. An instance is therefore an assembly of compute plus disk plus network interface, and exam questions ask which of those three is the bottleneck or wrongly coupled.
One physical fact drives everything: an instance lives in a single Availability Zone, and its EBS volume is pinned to the same AZ. So "what happens when the AZ dies" is the starting point of every EC2 architecture question. That is why the answers keep converging on spreading instances across AZs with an ASG, fronting them with a load balancer, and moving state outside the instance into S3, EFS, RDS, or ElastiCache.
시험은 무엇을 보는가 / What the exam is testing
The exam uses EC2 to test two judgements. First, cost: read the temporal shape of the workload — interruptible, steady, predictable — and pick the purchase option. Second, coupling: decide what belongs on the instance and what must move off it. Most of the 319 EC2 questions are one of those two; almost none require memorising instance-type specifications.
시험 포인트 / Exam points
On-Demand (flexible, priciest) / Spot (up to 90% off, 2-minute interruption notice, for stateless fault-tolerant batch) / Reserved & Savings Plans (1–3 year commit, up to 72% off, steady-state) / Dedicated Host (physical tenancy for BYOL licensing and compliance). "Interruption is fine" → Spot. "Runs 24/7" → RI or Savings Plans.
Cluster packs instances into one AZ for lowest latency and up to 100 Gbps (HPC). Spread puts each instance on distinct racks to avoid correlated failure (max 7 per AZ). Partition isolates hardware per partition for large distributed systems like HDFS or Cassandra.
Any option that stores access keys on the instance is wrong. Attach an IAM role via an instance profile — temporary credentials are delivered and rotated automatically.
If each EC2 writes to its own EBS volume, users see inconsistent data. Move shared files to EFS, objects to S3, and sessions to ElastiCache or DynamoDB.
자주 틀리는 함정 / Common traps
Storing access keys on the instance or in user data — credentials leak into AMIs, snapshots, and logs, and cannot be rotated. The answer is always an IAM role via an instance profile.
Solving a scalability question by "move to a larger instance" — vertical scaling has a ceiling and needs a restart. Variable load calls for horizontal scaling with an ASG.
Writing user uploads to each instance's own EBS volume — once a load balancer spreads requests, users see a different subset of files on every refresh. Move to shared storage (EFS) or object storage (S3).
헷갈리는 것 구분하기 / Telling them apart
Decided by whether the workload tolerates interruption. If yes, Spot (up to 90% off); if not and it runs continuously, a commitment discount (up to 72%). They are not exclusive — an ASG mixed-instances policy uses both.
A Dedicated Host gives you the physical server with visible sockets and cores, satisfying per-core BYOL licensing. A Dedicated Instance is single-tenant but you do not control which host, so it cannot satisfy BYOL.
권장 아키텍처 패턴 / Reference pattern
AWS SAA Hub Pro는 독립 학습 자료이며 Amazon Web Services, Inc.의 공식 서비스가 아닙니다. 시험 정책과 서비스 사양은 AWS 공식 문서를 기준으로 확인하세요.