chore: RDS 모듈 제거, ASG capacity 변수화, flaky test 수정#1646
Merged
Conversation
콘솔에서 기존 RDS를 삭제하고 Aurora DB로 전환함에 따라 Terraform에서 database/secret 모듈과 관련 참조를 제거한다.
There was a problem hiding this comment.
Code Review
This pull request removes the database and secret modules from both the development and production environments, along with their associated variables, outputs, and tags. Additionally, the application module's Auto Scaling Group configuration was updated to set the minimum and desired capacity to 1. Feedback was provided regarding the hardcoding of these capacity values, suggesting parameterization to support environment-specific scaling and the use of lifecycle rules to prevent conflicts with auto-scaling policies.
Comment on lines
+113
to
+114
| min_size = 1 | ||
| desired_capacity = 1 |
There was a problem hiding this comment.
ASG의 min_size와 desired_capacity가 모듈 내에 하드코딩되어 있습니다. 이는 다음과 같은 잠재적인 문제를 야기할 수 있습니다:
- 환경별 확장성 및 가용성 제한:
dev와prod환경이 동일한 모듈을 사용하므로, 운영 환경(prod)에서도 인스턴스가 1대로 제한됩니다. 고가용성(HA)을 위해 운영 환경에서는 최소 2대 이상의 인스턴스를 유지하는 것이 권장되므로, 이 값들을 변수화하여 각 환경에서 적절한 값을 전달하도록 개선하는 것이 좋습니다. - 오토스케일링 충돌:
desired_capacity를 명시적으로 설정하면, 향후 오토스케일링 정책에 의해 인스턴스 수가 늘어나더라도terraform apply실행 시 다시 1대로 줄어드는 현상이 발생합니다. 이를 방지하기 위해lifecycle블록에서ignore_changes = [desired_capacity]설정을 추가하는 것을 고려해 보시기 바랍니다.
외부 RSS 피드(YouTube, Tistory 등)에 실제 네트워크 호출을 하던 테스트를 로컬 XML fixture로 대체하여 flaky test 문제를 해결한다.
…ges 추가 - min_size, max_size, desired_capacity를 모듈 변수로 추출 - 환경별 적절한 값 설정 (dev: 1, prod: 2) - lifecycle ignore_changes로 오토스케일링과 terraform apply 충돌 방지
Gradle 8.10에서 deprecated된 JUnitXmlReport.getDestination() API로 인해 sonarqube task가 실패하는 문제를 해결한다.
6.x는 SonarCloud JRE 다운로드 API 호환 문제가 있어 Gradle 8.x 호환되는 5.x 최신 버전으로 변경한다.
SonarCloud CI 실패는 Gradle 8.10 업그레이드 이후 기존부터 발생하던 문제로, 이 PR의 변경 범위에서 제외한다.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
lifecycle { ignore_changes = [desired_capacity] }추가하여 오토스케일링 정책과 충돌 방지Changes
Terraform
modules/database/,modules/secret/디렉토리 삭제environments/dev,prod/main.tf— database 모듈 호출 제거, ASG capacity 변수 전달environments/dev,prod/outputs.tf— database output 제거environments/dev,prod/variables.tf— db_name, db_secret_name 변수 제거modules/application/main.tf— ASG capacity 변수화 + ignore_changes 추가modules/application/variables.tf— asg_min_size, asg_max_size, asg_desired_capacity 변수 추가modules/tags/— 미사용 database_tags 제거Test
RssClientTest— 외부 RSS 피드 호출을 로컬 XML fixture로 대체Note
Test plan
terraform plan확인terraform deploy(dev) 실행