v2Multi-modeZero infra option
소개
CC-on-Bedrock 은 AWS Bedrock 을 활용한 멀티유저 Claude Code 개발 플랫폼입니다. EC2-per-user DevEnv 와 Local Governance 두 모드를 모두 지원하며, 같은 클러스터에 공존할 수 있습니다.
1. 두 가지 배포 프로파일
| 모드 | 사용 방식 | 인프라 비용 | 거버넌스 |
|---|---|---|---|
| EC2-per-user DevEnv | 사용자별 전용 EC2 (ARM64) + 브라우저 code-server | EC2 + EBS 시간당 | 동일 |
| Local Governance | 사용자 PC에서 claude 직접 실행, /local 페이지에서 STS 자격증명 발급 | 0 (Bedrock 호출만 과금) | 동일 |
두 모드는 같은 플랫폼에서 공존 가능. 인프라는 Terraform(HCL)을 기준으로 배포합니다.
2. 주요 특징
- Bedrock Direct Mode: per-user IAM Role(EC2) 또는 STS 자격증명(Local)으로 Bedrock 직접 호출 — proxy 없음
- 사용자별 IAM 사전 프로비저닝: Cognito 사용자 가입 시 EventBridge로 IAM role + Cognito custom 속성 사전 생성, 첫 로그인 race condition 제거
- 하이브리드 AI: 대시보드는 Converse API(빠른 스트리밍 + 5 tool), Slack/외부 채널은 AgentCore Runtime + per-department MCP Gateway
- 7계층 보안: CloudFront → ALB/NLB → Cognito → Security Groups (DLP 3-tier) → VPC Endpoints → DNS Firewall → IAM Permission Boundary
- 이중 거버넌스: USD 예산(budget-check 5분 주기) + Normalized 토큰 한도(token-limit-enforcer, usage table Stream 소비)
- 서버리스 사용량 추적: Bedrock invocation logging → CloudWatch Logs → Subscription Filter →
bedrock-usage-trackerLambda → DynamoDB
3. Bedrock 모델
기본 inference profile (ap-northeast-2):
| 모델 | Inference Profile ID |
|---|---|
| Claude Opus 4.7 | global.anthropic.claude-opus-4-7 |
| Claude Opus 4.8 | global.anthropic.claude-opus-4-8 |
| Claude Sonnet 5 | global.anthropic.claude-sonnet-5 |
| Claude Haiku 4.5 | global.anthropic.claude-haiku-4-5-20251001-v1:0 |
Wildcard IAM
IAM은 wildcard Claude family ARN으로 부여돼 신규 Claude 모델이 추가되면 IAM 변경 없이 즉시 사용 가능합니다.
4. 8 스택 구조
| # | 스택 | 주요 리소스 |
|---|---|---|
| 01 | Network | VPC · Subnets · NAT · VPC Endpoints · DNS Firewall · Route 53 |
| 02 | Security | Cognito · ACM · KMS · Secrets Manager · IAM Roles + Permission Boundary |
| 03 | Usage Tracking | Bedrock invocation logging + tracker / budget-check / ec2-idle-stop / audit / gateway-manager Lambdas |
| 04 | ECS Dashboard infra | NLB + Nginx Fargate + DynamoDB routing table |
| 05 | Dashboard | Next.js standalone + Unified CloudFront + Lambda@Edge (session-validator + origin-router) |
| 06 | WAF | CLOUDFRONT-scope WebACL (us-east-1) |
| 07 | EC2 DevEnv | Launch Template (ARM64) · DLP SGs (open/restricted/locked) · Hibernation |
| 08 | Local Governance | STS Issuer Lambda · cc-on-bedrock-limits · token-limit-enforcer · UserRoleProvisioner |
배포 명령bash
terraform -chdir=terraform init
terraform -chdir=terraform validate
terraform -chdir=terraform plan
terraform -chdir=terraform apply