Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/app_stack/db_ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ resource "aws_instance" "db_server" {
user_data_replace_on_change = false

lifecycle {
# AMI 갱신이 운영 중인 DB EC2를 교체하지 않도록 무시하고, 인스턴스가 재생성되는 시점에 새 AMI를 적용합니다.
ignore_changes = [
ami,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Ensure replacements use the configured AMI

When db_ami_id changes and the existing instance is later recreated because of -replace, tainting, or another replacement-triggering attribute, Terraform retains the prior state value for attributes in ignore_changes; consequently, the replacement is launched with the old AMI rather than the newly configured one. This contradicts the lifecycle comment and means the planned recovery rehearsal—or an emergency rebuild after AMI drift—will not install the expected backup tooling and can fail entirely if the old AMI has been deregistered. The AMI ignore must therefore be removed or conditionally disabled before replacement, or the rollout needs another mechanism that explicitly supplies the new AMI.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

의견 감사합니다. 하지만 공식 문서를 확인해본 결과 ignore_changes는 create를 계획할 때는 해당 인자를 고려하고, update를 계획할 때만 무시한다고 되어 있습니다. 따라서 해당 의견은 반영하지 않도록 하겠습니다.

key_name,
user_data,
user_data_base64,
Expand Down
Loading