File: for-expression.tf

package info (click to toggle)
golang-github-hashicorp-terraform-config-inspect 0.0~git20230614.f32df32-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 472 kB
  • sloc: makefile: 2
file content (19 lines) | stat: -rw-r--r-- 319 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
variable "log_categories" {
  default = ["one", "two", "three"]
}
variable "enabled" {
  default = true
}
variable "retention_days" {
  default = 7
}

locals {
  logs = {
    for category in var.log_categories :
    category => {
      enabled        = var.enabled
      retention_days = var.retention_days
    }
  }
}