Terraform IaC for no-dept knowledge debt bot.
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만 참조)
.\scripts\build_backend.ps1cd terraform
Copy-Item terraform.tfvars.example terraform.tfvars
notepad terraform.tfvars # github_app_id 등 채우기terraform init
terraform plan
terraform apply.\scripts\deploy_dashboard.ps1- GitHub → Settings → Developer settings → OAuth Apps → New OAuth App
- Authorization callback URL:
{dashboard_url}/auth/callback - client_id, client_secret를 terraform.tfvars에 넣고
terraform apply재실행
- Terraform state를 S3 + DynamoDB 락으로 이동 (versions.tf 주석 참조)
- backend Lambda가 환경변수 대신 Secrets Manager 런타임 fetch하도록 변경
- event-pipeline SQS 큐에 DLQ 연결
- CloudWatch 알람 (Lambda 에러율, DLQ 메시지 수 등)
- 커스텀 도메인 + ACM 인증서