Skip to content

Commit

Permalink
Merge pull request #5 from BetterWorks/ignoring_changes
Browse files Browse the repository at this point in the history
fix: Ignoring changes in db parameters and options
  • Loading branch information
NamelessHH authored Oct 12, 2021
2 parents df69bc8 + 0b1e7db commit c9e5952
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,19 @@ resource "aws_db_instance" "default" {
monitoring_interval = var.monitoring_interval
monitoring_role_arn = var.monitoring_role_arn
performance_insights_enabled = var.performance_insights_enabled
lifecycle {
ignore_changes = [parameter_group_name, db_subnet_group_name]
}
}

resource "aws_db_parameter_group" "default" {
count = length(var.parameter_group_name) == 0 && var.enabled == "true" ? 1 : 0
name = module.label.id
family = var.db_parameter_group
tags = module.label.tags
lifecycle {
ignore_changes = [parameter]
}
dynamic "parameter" {
for_each = var.db_parameter
content {
Expand Down Expand Up @@ -106,6 +112,7 @@ resource "aws_db_option_group" "default" {

lifecycle {
create_before_destroy = true
ignore_changes = [option]
}
}

Expand Down

0 comments on commit c9e5952

Please sign in to comment.