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

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

Open
nitrocode opened this issue Dec 27, 2021 · 0 comments
Open

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

nitrocode opened this issue Dec 27, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@nitrocode
Copy link
Member

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

@nitrocode nitrocode added the bug 🐛 An issue with the system label Dec 27, 2021
@Nuru Nuru added enhancement New feature or request and removed bug 🐛 An issue with the system labels Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants