AWS

AWS 서비스 연동 구조 이해 및 실습 가이드
(콘솔 + CloudFormation 버전)

◆ 핵심 개념

  1. 서비스 종속성 구조 VPC → 서브넷 → 인터넷게이트웨이 → 라우팅테이블 → 보안그룹 → EC2 (← 이 순서대로 생성, 역순으로 삭제)

  2. 필수 생성 순서
    [콘솔]
    ① VPC 생성 (10.0.0.0/16)
    ② 서브넷 생성 (10.0.1.0/24)
    ③ 인터넷 게이트웨이 연결
    ④ 라우팅 테이블에 0.0.0.0/0 규칙 추가
    ⑤ 보안그룹 생성 (22,80,443 포트 오픈)
    ⑥ EC2 배치 (퍼블릭 IP 활성화 필수)

    [CloudFormation]
    동일 순서로 YAML 템플릿 작성 후 스택 생성

◆ 실습 핵심 팁 ✓ 이름 규칙 : vpc-main / subnet-public-1a
✓ 태그 필수 적용 (Name, Env=Dev)
✓ 콘솔 작업 후 동일 구조 CloudFormation으로 재현
✓ 매 실습 후 반드시 삭제 (과금 방지)

◆ 주의사항
⚠️ 리소스 삭제 시 역순 진행
⚠️ 기본(default) 리소스 사용 금지
⚠️ 키 페어 파일 분실시 접근 불가
⚠️ 리전 일관성 확인 (서울=ap-northeast-2)

◆ 단계별 학습 방법

  1. 콘솔에서 수동 생성 → 삭제 (3회 반복)
  2. CloudFormation 템플릿 작성 → 배포
  3. 생성된 리소스 콘솔 대조 확인
  4. 템플릿 수정 → 업데이트 스택 테스트

◆ 문제 해결 가이드
Q. 리소스 삭제가 안 될 때
→ 종속성 확인: 서브넷 정리 여부 체크
→ 강제 삭제: 라우팅 테이블 연결 먼저 해제

Q. CloudFormation 배포 실패
→ 이벤트 로그 확인
→ 수동으로 충돌 리소스 제거 후 재시도

◆ 최종 목표
✅ 프리 티어 환경에서 전체 인프라 30분 내 구축
✅ 동일 설정을 콘솔/CloudFormation 양쪽으로 구현
✅ 실수로 삭제 못하는 상황 Zero 만들기

AWS Service Integration Architecture & Hands-On Guide (Console + CloudFormation Version)

◆ Core Concepts

Service Dependency Hierarchy VPC → Subnet → Internet Gateway → Route Table → Security Group → EC2 (Create in this order / Delete in reverse order)

Mandatory Creation Sequence

[Console]

① Create VPC (10.0.0.0/16)

② Create Subnet (10.0.1.0/24)

③ Attach Internet Gateway

④ Add 0.0.0.0/0 Rule to Route Table

⑤ Create Security Group (Open Ports 22, 80, 443)

⑥ Launch EC2 (Enable Public IP Assignment)

[CloudFormation] Build YAML template in the same order → Deploy stack.

◆ Key Practice Tips

✓ Naming Convention: e.g., vpc-main, subnet-public-1a

✓ Mandatory Tagging: Include Name and Env=Dev tags.

✓ Replicate console setups using CloudFormation.

✓ Always delete resources post-practice (Cost control).

◆ Critical Warnings

⚠️ Delete resources in reverse order of creation.

⚠️ Never use default resources (e.g., default VPC).

⚠️ Losing key pair files = No EC2 access.

⚠️ Verify region consistency (Seoul = ap-northeast-2).

◆ Step-by-Step Learning Path

Console Practice: Manually build → Delete (Repeat 3x).

CloudFormation: Write YAML template → Deploy stack.

Cross-Verify: Compare console resources with CFN outputs.

Advanced Testing: Modify templates → Test stack updates.

◆ Troubleshooting Guide Q. Resource deletion fails → Check dependencies (e.g., subnets still attached?). → Force-cleanup: Detach route tables first.

Q. CloudFormation deployment errors → Check stack “Events” tab for details. → Manually delete conflicting resources → Retry.

◆ Success Metrics

✅ Build full infrastructure in ≤30 mins (Free Tier).

✅ Achieve parity between Console/CloudFormation setups.

✅ Zero undeletable resources after cleanup.

© 2024 Coding Stairs. All rights reserved.