Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Aws backup plan multiple selection_tags

I have a question that I have been researching for a few hours now but still didn’t manage to get a proper answer.

I’m defining an aws_backup_plan in terraform.

module "backup" {
  count  = var.backup_enabled ? 1 : 0
  source = "somwthing/backup/aws"
    
  enabled                  = var.backup_enabled
  version                  = "0.13.1"
  namespace                = "sr"
  stage                    = var.stage
  name                     = "storage-backups"
  tags                     = var.tags
  schedule                 = "cron(0 10 ? * * *)" # At 10:00 AM, daily
  iam_role_name            = local.iam_role_name  # unique role name per region as IAM resources are global
  delete_after             = 35                   # cannot be bigger than 35 days 
  enable_continuous_backup = true
  backup_resources         = var.backup_resources
  selection_tags = [
    { type = "STRINGEQUALS", key = "backup", value = "weekly" },
    { type = "STRINGEQUALS", key = "backup", value = "daily" }
  ]
}

I have just added { type = "STRINGEQUALS", key = "backup", value = "daily" } to the selection_tags. My question is, if I tag one resource with one of the tags in the array does it get assigned the backup plan? I.e. does this array behave like an OR operator?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Well it depends on how condition was written, In this particular example it behaves like an AND statement rather an OR. This was designed to provide refined targeting mechanisms when creating plans.

Please take a look at this image from AWS backup:

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading