Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

no-dept infra

Terraform IaC for no-dept knowledge debt bot.

자원 구성 (Option A — event-pipeline은 수동 유지)

Terraform 관리:

  • DynamoDB × 6 (users, repos, projects, quizzes, answers, stats)
  • Secrets Manager: no-dept/jwt-secret, no-dept/github-oauth-client-secret 신규 생성
  • Lambda × 2: no-dept-backend-api (FastAPI/Mangum), no-dept-backend-worker (SQS consumer)
  • API Gateway HTTP no-dept-api (dashboard → backend)
  • S3 + CloudFront: dashboard 호스팅
  • S3: Lambda 코드 zip 보관
  • IAM roles, CloudWatch log groups, SQS event source mapping

Terraform 미관리 (기존 수동 자원):

  • Lambda event-pipeline-webhook
  • API Gateway HTTP event-pipeline-api (https://7rr6ncg8u6.execute-api.ap-northeast-2.amazonaws.com/webhook)
  • SQS no-dept-event-pipeline
  • Secrets Manager github-webhook-secret, no-dept/github-app-private-key
  • (data source로 ARN만 참조)

배포 순서

1. Backend Lambda zip 빌드

.\scripts\build_backend.ps1

2. Terraform 변수 설정

cd terraform
Copy-Item terraform.tfvars.example terraform.tfvars
notepad terraform.tfvars  # github_app_id 등 채우기

3. Terraform apply

terraform init
terraform plan
terraform apply

4. Dashboard 빌드 & 배포

.\scripts\deploy_dashboard.ps1

5. GitHub OAuth App 설정 (dashboard 로그인용)

  • GitHub → Settings → Developer settings → OAuth Apps → New OAuth App
  • Authorization callback URL: {dashboard_url}/auth/callback
  • client_id, client_secret를 terraform.tfvars에 넣고 terraform apply 재실행

운영 권장사항 (TODO)

  • Terraform state를 S3 + DynamoDB 락으로 이동 (versions.tf 주석 참조)
  • backend Lambda가 환경변수 대신 Secrets Manager 런타임 fetch하도록 변경
  • event-pipeline SQS 큐에 DLQ 연결
  • CloudWatch 알람 (Lambda 에러율, DLQ 메시지 수 등)
  • 커스텀 도메인 + ACM 인증서

About

AWS SAM templates

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages