Skip to content

Commit

Permalink
Fixes the bug with upgrading engine version (#16)
Browse files Browse the repository at this point in the history
Recently we were encountering the described error here:
terraform-aws-modules/terraform-aws-rds-aurora#118
when we were upgrading from 10.11 to 10.14. It dropped the instances and then stopped right in the middle with a 400 - leaving everything in pieces behind :(.
I tried the fix locally by modifying the `terraform/apps/oma/.terraform/eu01/stg02-de/modules/oma.db/main.tf` adding the changes and it seems to work as expected.
  • Loading branch information
vghero authored Mar 5, 2021
1 parent d3935ed commit 14856d6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ resource "aws_rds_cluster_instance" "instance" {
performance_insights_kms_key_id = var.performance_insights_kms_key_id
ca_cert_identifier = var.ca_cert_identifier
tags = var.tags

# Updating engine version forces replacement of instances, and they shouldn't be replaced
# because cluster will update them if engine version is changed
lifecycle {
ignore_changes = [
engine_version
]
}
}

resource "aws_rds_cluster_instance" "data_reader" {
Expand All @@ -97,6 +105,14 @@ resource "aws_rds_cluster_instance" "data_reader" {
performance_insights_kms_key_id = var.performance_insights_kms_key_id
ca_cert_identifier = var.ca_cert_identifier
tags = merge(var.tags, var.data_reader_tags)

# Updating engine version forces replacement of instances, and they shouldn't be replaced
# because cluster will update them if engine version is changed
lifecycle {
ignore_changes = [
engine_version
]
}
}

resource "random_id" "snapshot_identifier" {
Expand Down

0 comments on commit 14856d6

Please sign in to comment.