Closed DeGuitard closed 7 months ago
If you don't want the value change to trigger a resource recreation, you can use Terraform's lifecycle
meta-argument like this:
resource "spacelift_environment_variable" "my_secret" {
stack_id = spacelift_stack.my_stack.id
name = "my_secret"
write_only = true
lifecycle {
ignore_changes = [value]
}
}
You can read more about it here.
Since it's really a Terraform question rather than the provider one, I am going to close this ticket.
We're defining stack's environment variables this way:
They get created as intended, with a null value. Then we're setting the actual value through the UI, since we do not want our secrets to be persisted in a git repository.
The problem is that future plans give this output:
The way I read it, the code says the value should be null, so it's trying to overwrite the secret to set it back to null. So that's my problem. I've looked in the documentation, but could not find the proper way to handle this case. Am I missing something?