Quantcast
Viewing all articles
Browse latest Browse all 3

how to implement "sticky" variables in terraform?

I'd like to have a Terraform variable with these properties:

  • if it has never been set, use a default value
  • if no value is provided, use the value from the previous run
  • if a value is provided, use that and remember it

The use case is for AWS ECS tags, where I want to be able to deploy a new version by changing the tag, which will cause Terraform to create a new task definition and modify the service definition. If I run "terraform apply", though, without passing a new value I'd like nothing to happen, i.e., terraform remembers the value from the previous run.

Suggestions welcome!


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>