Skip to content

[FIX] Terraform Cloud Run CI 실패 수정 (#486)#487

Merged
IISweetHeartII merged 1 commit intodevelopfrom
fix/terraform-cloudrun-ci-#486
Feb 17, 2026
Merged

[FIX] Terraform Cloud Run CI 실패 수정 (#486)#487
IISweetHeartII merged 1 commit intodevelopfrom
fix/terraform-cloudrun-ci-#486

Conversation

@IISweetHeartII
Copy link
Contributor

Summary

Cloud Run img_resizerprevent_destroy lifecycle 제거 및 ignore_changes 최소화로 Terraform CI plan 실패 수정.

Changes

  • prevent_destroy = true 제거 — CI plan에서 force-replacement 시도 시 plan 자체를 차단하던 원인
  • ignore_changes에서 template[0].containers[0].image 제거 — img-resizer는 고정 태그(:3)로 Terraform이 완전 관리
  • client, client_version만 ignore 유지 — GCP가 자동 설정하는 메타데이터

Type of Change

  • Bug fix (기존 기능에 영향을 주지 않는 버그 수정)

Related Issues

Closes #486

Checklist

  • 코드 컨벤션을 준수했습니다 (docs/CONVENTIONS.md 참고)
  • 로컬에서 빌드가 정상적으로 완료됩니다

Additional Notes

근본 원인: 마이그레이션 중 gcloud run deploy로 img-resizer를 배포하면서 Terraform state와 실제 Cloud Run 속성 사이에 drift 발생. prevent_destroy가 Terraform plan의 reconciliation을 차단.

수정 후 동작: develop 머지 시 Terraform apply가 실행되면서 state와 실제 리소스를 자동 reconcile. img-resizer 이미지 업데이트는 cloudrun.tf의 태그를 수정하여 PR로 관리.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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!

이 Pull Request는 Terraform CI 파이프라인에서 발생하는 plan 실패 문제를 해결하기 위해 Cloud Run 서비스의 Terraform 설정을 수정합니다. 주요 변경 사항은 prevent_destroy 설정을 제거하고 ignore_changes 목록을 최적화하여 Terraform이 Cloud Run 리소스의 상태를 더 정확하게 관리하고 드리프트를 자동으로 조정할 수 있도록 하는 것입니다. 이를 통해 CI/CD 워크플로우의 안정성을 높이고 수동 개입 없이 리소스 상태를 일치시킬 수 있습니다.

Highlights

  • Terraform CI Plan 실패 수정: Cloud Run img_resizer 서비스의 Terraform 설정에서 prevent_destroy = true 설정을 제거하여 CI plan에서 force-replacement 시도 시 plan이 차단되던 문제를 해결했습니다.
  • ignore_changes 설정 최적화: img_resizer 서비스의 lifecycle 블록에서 template[0].containers[0].imageignore_changes 목록에서 제거했습니다. 이는 img-resizer가 고정 태그(:3)를 사용하여 Terraform이 이미지를 완전히 관리하도록 하기 위함입니다.
  • 드리프트 문제 해결: 마이그레이션 중 gcloud run deploy로 인해 발생한 Terraform state와 실제 Cloud Run 속성 간의 드리프트를 해결하고, prevent_destroy가 Terraform plan의 조정을 방해하던 근본 원인을 제거했습니다.

🧠 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
  • infra/cloudrun.tf
    • prevent_destroy = true 설정을 제거했습니다.
    • ignore_changes 목록에서 template[0].containers[0].image를 제거했습니다.
Activity
  • 이 Pull Request는 Terraform CI plan 실패를 수정하기 위해 생성되었습니다.
  • 작성자는 prevent_destroy 제거 및 ignore_changes 최적화를 통해 문제를 해결했습니다.
  • 코드 컨벤션 준수 및 로컬 빌드 완료를 확인했습니다.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖success

Validation Output
Success! The configuration is valid.


Terraform Plan 📖success

📋 Plan details are available in the workflow logs (accessible to team members only)

Pusher: @IISweetHeartII, Action: pull_request, Workflow: Terraform

@IISweetHeartII IISweetHeartII self-assigned this Feb 17, 2026
@IISweetHeartII IISweetHeartII added bug Something isn't working 덕환 labels Feb 17, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이 PR은 img_resizer Cloud Run 서비스의 Terraform CI 실패를 해결하기 위해 prevent_destroy 라이프사이클 설정을 제거하고 ignore_changes를 수정합니다. 상태 드리프트(state drift)로 인해 발생한 문제를 해결하기 위한 올바른 방향의 수정입니다. 다만, prevent_destroy를 영구적으로 제거하는 것은 프로젝트의 운영 가이드에 위배될 수 있으며, 리소스의 안정성을 저해할 수 있습니다. 이에 대해 더 안전한 대안을 제시하는 리뷰 의견을 남겼습니다.

}

lifecycle {
prevent_destroy = true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

CI 실패 문제를 해결하기 위해 prevent_destroy를 제거하는 것은 이해됩니다. 하지만 이는 TERRAFORM_OPERATIONS.md 운영 가이드의 안전 수칙에 위배될 수 있으며, 향후 img-resizer 서비스가 의도치 않게 삭제될 위험을 만듭니다.

이 변경이 상태 드리프트(state drift) 해결을 위한 일회성 조치라면, prevent_destroy를 영구적으로 제거하는 대신 다음의 2단계 접근 방식을 고려하는 것이 더 안전합니다.

  1. 현재 PR에서 prevent_destroy를 제거하여 apply를 통해 상태를 바로잡습니다.
  2. 즉시 후속 PR을 통해 prevent_destroy = true를 다시 추가하여 리소스 보호 설정을 복원합니다.

이렇게 하면 현재 문제를 해결하면서도 장기적인 안정성을 유지할 수 있습니다.

References
  1. docs/infra/TERRAFORM_OPERATIONS.md 가이드라인(72라인)에서는 데이터 손실 및 서비스 중단을 방지하기 위해 주요 리소스의 prevent_destroy 속성 제거를 금지하고 있습니다. 이 규칙은 리소스가 실수로 삭제되는 것을 방지하는 중요한 안전장치입니다. (link)

@IISweetHeartII IISweetHeartII merged commit e2872ce into develop Feb 17, 2026
2 checks passed
@IISweetHeartII IISweetHeartII deleted the fix/terraform-cloudrun-ci-#486 branch February 17, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 덕환

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Terraform Cloud Run prevent_destroy CI 실패 수정

1 participant