Skip to content

chore: move the AWS infrastructure out to barebones-infra - #8

Merged
iflov merged 1 commit into
mainfrom
iflov/remove-infra
Sep 1, 2026
Merged

iflov merged 1 commit into
mainfrom
iflov/remove-infra

Conversation

@iflov

@iflov iflov commented Sep 1, 2026

Copy link
Copy Markdown
Owner

왜

barebones는 스캐폴드이고, 스캐폴드가 실을 수 있는 건 템플릿이지 인스턴스가 아닙니다.

foundation service
개수 환경당 정확히 하나 서비스마다 하나
복제하면 사고 (VPC가 둘) 정상
소비자 frontend 포함 — barebones에서 안 나온 저장소들 이 서비스 하나
성격 인스턴스 템플릿

Next.js frontend는 NestJS 스캐폴드와 아무 관계가 없는데 그 VPC 정의가 여기 있었습니다.

service 층만 남기는 것도 고려했지만, foundation 없이는 못 돌아가서 반쪽만 남습니다. 그리고 ECS terraform 자체가 배포 대상에 대한 의견이라 스캐폴드가 실을 것이 아닙니다.

직전 커밋에서 변경 빈도와 blast radius로 그은 foundation/service 선이, 재사용 가능성으로 그으면 나오는 "인스턴스 / 템플릿" 선과 같았습니다. 우연이 아니라 같은 구분을 다른 각도에서 본 것이고, 그래서 양쪽이 함께 나갑니다.

남는 배포 경계

성격
Dockerfile, docker-compose*.yml 이 서비스를 어떻게 돌리나 — 클라우드 무관
.env.example, src/config/env.validation.ts 앱이 무슨 설정을 요구하나 — 계약의 원천

terraform은 그 계약의 소비자였지 원천이 아니었습니다.

어디로 갔나

iflov/barebones-infra (private). git subtree split으로 옮겨서 이 구성을 만든 커밋 3개가 함께 갔습니다:

e0acd1f refactor(terraform): draw the foundation/service seam
9fba6a0 feat(terraform): make the ECS starter apply-ready under model B
d8bf142 feat: add selectable infrastructure profiles

새 저장소에서 fmt -check / init -backend=false / validate 통과 확인했고, 자기 CI 워크플로를 붙였습니다.

함께 지운 것

  • .github/workflows/terraform.yml — 함께 이동
  • ci.yml의 paths-ignore — terraform-only 변경을 이 파이프라인에서 빼려고 있던 것이라 존재 이유가 사라졌습니다
  • .gitignore의 terraform 규칙 5줄
  • AGENTS.md의 "AWS Terraform은 기본 배포 시작점" 줄

docs/terraform-repo-boundary.md는 남깁니다 — barebones에 일어난 변화를 설명하는 기록이고, 상단에 종결 노트를 붙였습니다.

검증

  • check:scaffold(typeorm + postgres 일관), check:observability, typecheck, lint 통과
  • pnpm test → Test Files 35 passed (35) / Tests 317 passed (317)
  • 앱 코드·스크립트는 infra/를 원래 참조하지 않았습니다. 남은 infra/terraform 언급은 결정 문서(역사 기록)뿐입니다

🤖 Generated with Claude Code

https://claude.ai/code/session_01DrsDBRXt7sYCYxt5gmFMVy

This is a scaffold, and a scaffold can only ship templates. The
foundation half of infra/terraform is an instance: there is exactly one
VPC, ALB and ECS cluster per environment, a second copy is a mistake
rather than a feature, and its consumers include repositories that were
never scaffolded from here. The service half only runs against a
foundation, so keeping it alone would leave a half that cannot deploy.

The line drawn last commit by change rate and blast radius turns out to
be the same line you get from asking what is reusable, which is why
both halves leave together.

What remains is the container boundary: Dockerfile and Compose say how
to run this service, .env.example and src/config/env.validation.ts say
what configuration it requires. Both are cloud-agnostic.

Moved with git subtree split, so the three commits that shaped the
configuration went with it. docs/terraform-repo-boundary.md stays here
as the record of the decision, since it explains a change to this
repository.

Also drops the terraform CI workflow, the paths-ignore that existed only
to keep terraform-only changes off this pipeline, and the terraform
ignore rules.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DrsDBRXt7sYCYxt5gmFMVy
@iflov
iflov merged commit 7acc07e into main Sep 1, 2026
1 check passed
@iflov
iflov deleted the iflov/remove-infra branch September 1, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant