[CHORE] TF State 버킷 파라미터화 (#488)#489
Conversation
- backend.tf: partial backend config 적용 (하드코딩 버킷명 제거) - terraform.yml: TF_STATE_BUCKET secret 사용 (init, tfvars, deploy-config) - deploy.yml, deploy-dev.yml: TF_STATE_BUCKET secret 사용 - 마이그레이션 시 코드 변경 없이 GitHub Secrets만 교체하면 전환 가능
Summary of ChangesHello @IISweetHeartII, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 GCP 프로젝트 마이그레이션 프로세스를 대폭 간소화하기 위해 Terraform State 버킷 참조 방식을 개선합니다. 기존에 하드코딩되어 있던 프로젝트 ID 의존성을 제거하고, GitHub Secrets를 통해 필요한 정보를 주입함으로써, 향후 프로젝트 전환 시 코드 변경 없이 설정만으로 대응할 수 있도록 인프라 관리의 유연성을 높였습니다. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Terraform Format and Style 🖌
|
There was a problem hiding this comment.
Code Review
이 PR은 Terraform 상태(state) 버킷을 파라미터화하여 하드코딩된 값을 제거하고, GitHub Secrets를 통해 관리하도록 변경합니다. 이로써 코드 변경 없이 GCP 프로젝트를 마이그레이션할 수 있게 되어 인프라 유지보수성이 향상됩니다. infra/backend.tf의 변경 사항은 부분 백엔드 구성(partial backend configuration)을 올바르게 적용하고 있습니다.
다만, 이 변경으로 인해 관련 문서인 docs/infra/TERRAFORM_OPERATIONS.md 파일 내에 이전의 하드코딩된 버킷 이름(finders-487717-tf-state)이 여러 곳에 여전히 남아있는 것을 확인했습니다. 향후 개발자들의 혼동을 방지하고 문서와 코드의 일관성을 유지하기 위해, 해당 문서도 함께 업데이트하는 것을 강력히 권장합니다.
Terraform Format and Style 🖌
|
Summary
GCP 프로젝트 마이그레이션 시 코드 변경 없이 GitHub Secrets만으로 전환 가능하도록 TF State 버킷 참조를 파라미터화합니다.
변경 전: 프로젝트 ID가 5곳에 하드코딩 → 마이그레이션마다 코드 수정 필요
변경 후: GitHub Secrets 4개만 변경하면 마이그레이션 완료 (코드 변경 0)
Changes
infra/backend.tf: partial backend config 적용 — 하드코딩된 버킷명 제거,terraform init -backend-config="bucket=..."방식으로 전환.github/workflows/terraform.yml:TF_STATE_BUCKETSecret으로 GCS 버킷 참조 파라미터화 (tfvars 다운로드, terraform init, deploy-config 업로드).github/workflows/deploy.yml:TF_STATE_BUCKETSecret으로 deploy-config.json 경로 파라미터화.github/workflows/deploy-dev.yml: 동일TF_STATE_BUCKETGitHub Secret 설정 완료 (finders-487717-tf-state)Type of Change
Related Issues
Closes #488
Checklist
Additional Notes
마이그레이션 시 필요한 GitHub Secrets (4개)
GCP_PROJECT_IDTF_STATE_BUCKET${NEW_PROJECT}-tf-stateWIF_PROVIDERWIF_SERVICE_ACCOUNTterraform-ci@${NEW_PROJECT}.iam...이 PR이 머지되면
terraform.yml이TF_STATE_BUCKETSecret을 사용합니다.Secret은 이미 설정되어 있으므로 (
finders-487717-tf-state) 정상 동작합니다.로컬에서 Terraform 실행 시:
terraform init -backend-config="bucket=finders-487717-tf-state"