Skip to content

Add docs on how to set a list value using set or set_sensitive #20

@nitrocode

Description

@nitrocode

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

There are times that you may want to add a list of values using a set operation. For example, if the list of values were sensitive. You would want to use set_sensitive and generally keep sensitive values out of set and values. By keeping secrets out of those inputs, the user will be able to see the full list of values (minus secrets) in the terraform plan. If secrets remain in set or values, then the plan will be hidden from the user under (sensitive).

See references for how to do this.

locals {
  # simple list
  fruits = join(",", [
    "banana",
    "apple",
    "strawberry",
  ])
  # list where some items contain a comma and those commas need to be escaped via a double backslash
  fruits_commas = join(",", [
    "banana\\,pears\\,grapes:somevalue",
    "apple\\,strawberry:somevalue",
  ])
}

resource helm_release default {
  # ...

  set_sensitive {
    name  = "controller.service.loadBalancerSourceRanges"
    value = "{${local.fruits}"
  }

  set_sensitive {
    name  = "controller.service.loadBalancerSourceRanges"
    value = "{${local.fruits_commas}"
  }
}

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions