Thank you for those great insights !
Indeed I’d like to be able to blindly run terraspace all up
.
It would be great if we could decide the instantiation of a stack at the stack level.
For instance:
stacks/db/base.tfvars
contains count = 0
stacks/db/prod.tfvars
contains count = 1
This way, at a glance, you can see that there is no db
instance in dev
environment, since no dev/tfvars
file
Since Terraform 0.13, count
metadata is available in modules and could solve this, but at first sight, it cannot be set with tfvars
.
In my current setup, in the dev
module, there is no instantiation of the db
module (no db
module declaration).
Another issue I’m facing is that, sometimes, there is a stack common for all environments. Let’s say I have an ElasticSearch cluster (a quite expensive service !) and I want to instantiate this stack only once.
Could it be solved by creating an all
or common
environment, instantiating ES in this environment, and access it this from the other environments with remote_state
data sources ?
When I use the output
helper, say output('vpc.vpc_id')
, I understand this as fetch the vpc_id
output value in the vpc stack
belonging to the same environment i’m running the output helper, is this correct ?
Perhaps it would make sense to have an option like this:
output('vpc.vpc_id', environment: 'common')
Sorry for all those questions !