Skip to content
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

fix backup selection re-creation #49

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

tchernomax
Copy link
Contributor

fix #48

@@ -16,6 +16,9 @@ resource "aws_backup_selection" "ab_selection" {
value = lookup(selection_tag.value, "value", null)
}
}

not_resources = []
Copy link
Owner

Choose a reason for hiding this comment

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

@tchernomax thanks for the PR. It seems this new feature was introduced in the AWS provider version 3.72.0.

I see it fixes the issue but I would a moe dynamic solution, similar to the resources attribute:

resources = lookup(element(local.selections, count.index), "resources", null)
not_resources = lookup(element(local.selections, count.index), "not_resources", null)

And include the following to the locals:

  # Selection
  selection = var.selection_name == null ? [] : [
    {
      name           = var.selection_name
      resources      = var.selection_resources
      not_reesouces  = var.selection_not_resources
      conditions     = var.selection_conditions
      selection_tags = var.selection_tags
    }
  ]

And something similar for condition. I'm going to merge your code and implement a dynamic behaviour.

@lgallard lgallard merged commit da79dba into lgallard:master Jan 25, 2022
@tchernomax tchernomax deleted the backup_selection_fix branch May 12, 2022 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform re-creates backup selection everytime.
2 participants