4 Commits

Author SHA1 Message Date
dghubble-renovate[bot]
060e9dbfbc Bump provider util from 0.2.2 to v0.3.0 2024-06-23 03:21:46 +00:00
dghubble-renovate[bot]
b738772721 Bump Terraform util from 0.2.0 to v0.2.2 2024-04-21 22:35:59 -07:00
Dalton Hubble
373096af65 Rename register set field to content
* The noun `content` is a better field name than the verb `set`
2022-03-30 09:24:28 -07:00
Dalton Hubble
da83c2d114 Add util_register resource for storing a value
* Set a register value to persist in state, even after
the value is no longer set in the Terraform resource
* Setting the value to `null` or "" (empty string)
won't alter the resource value (or show a diff)
* Allow the value to be updated (plan shows a diff)

This differs from conditional expressions that check that
a value isn't null or default to a value (which may be a
data reference to the old value):

```tf
locals {
  out = var.foo == null ? data.old_foo : var.foo
}

data "old_foo" ...
```

Instead, it allows a Terraform resource value to retain
a value from a previous declarative state. This can be
useful in cases where querying and referencing the value
again is expensive and the value cannot change externally.

```tf
resource "util_register" "example" {
  set = null         # previously "bar"
}

output "out" {
  value = util_register.example.value  # "bar"
}
```
2022-03-29 20:32:08 -07:00