We have a Terraform provider to manipulate TXT domain record. A TXT record can contain a list of values.
A user would like to partially manage this TXT resource with Terraform: some values have been manually added, and this user would like to add (and manage) some other values of this TXT record with Terraform.
The user doesn’t want to manage all values of this TXT record with Terraform: a Terraform destroy doesn’t have to destroy manually added values (so, the goal is to avoid a
It is definitely possible to implement this. However, i’m a bit skeptical about allowing such behavior.
A trade-off would be to add an option to this resource, something such as a
mutable flags (defaulting to
false). When the flag is
true, Terraform would allow inserting new values in a existing resource.
I’m pretty sure some other providers encounter the same need and I would like to know how they address it, if they allowed it.
- Would you allow such behavior?
- If yes, do you have a better idea than
mutablefor the resource flag name?
- Is there an example of a provider doing such kind of things?
FYI, the provider GitHub issue provides all usecase details.