RE: count in tfvars
Had a thought, though count
is not supported in tfvars files, could pass a variable like create_resource = true
and then use that to set count = 0
or count = 1
in the db/main.tf
. A tfvars file would still be generated, but the db module would not be instantiated.
RE: all or common environment output references
Yes. Would like this. Dug into it a while back and it’s a bit complex. Will consider PRs. Again, no sweat either way
There are also Terraspace Custom Helpers. So you can extend Terraspace and add your own methods. In this case, could add a method that provides the common stack outputs info.
The remote_state
is another approach. When used it, it feels a little too coupled, but that’s may just be a matter of opinion.
Maybe deploy the common stack first. And then just manually assign the values to the tfvars. It’s probably the simplest approach and allows the stack code to be a little more decoupled.