-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: DB EC2 전환을 위한 DB 유저 관리 대상 변경 #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Hexeong
merged 1 commit into
main
from
refactor/52-rds-termination-and-db-migrate-complete
Jul 10, 2026
+26
−19
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
enable_db_ec2is used while the DB instance is being created or replaced, this now schedulesmysql_user/mysql_grantin the same apply, but the only added dependency is the EC2 resource itself; Terraform considers the instance created beforemysql_setup.shhas finished starting Docker/MySQL and creating the remote root user. In that first-create/replacement path the MySQL provider can connect through the tunnel before the database is ready, making applies fail or become flaky; add an explicit cloud-init/SSM readiness check resource and depend on that before creating users.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋은 지적 감사합니다! 말씀하신 것처럼 DB EC2를 최초 생성하거나 교체하는 apply에서는
aws_instance생성 완료가 cloud-init 및 MySQL 준비 완료를 보장하지 않기 때문에, 별도의 readiness check가 필요할 수 있다고 생각합니다.다만 이번 PR에서는 DB EC2를 생성/교체하지 않고, 이미 부트스트랩과 MySQL 기동 및
scadmin인증까지 확인된 기존 DB EC2에scapp_user,scapp_flyway유저/권한만 추가하는 범위입니다. 실제 prod plan도Plan: 4 to add, 0 to change, 0 to destroy로 DB EC2 변경 없이 MySQL user/grant 생성만 잡히는 것을 확인했습니다.또한 DB EC2 생성/부트스트랩 안정화는 앞선 hotfix PR들에서 swap 추가와 root 인증 기반 readiness check로 보강했고, 이번 PR에서는 RDS 삭제도 제외하여 #61 후속 이슈에서 별도로 안전하게 처리할 예정입니다.
따라서 이번 PR에서는 추가 Terraform readiness 리소스는 넣지 않고, 향후 DB EC2 교체 자동화가 필요해지는 시점에 별도 작업으로 다루는 것이 적절하다고 판단했습니다.