You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new remote state functionality in 0.9 is interesting, but leaves me (and presumably others) in a somewhat unfortunate situation. To minimize the number of things touched in a terraform run we group things logically across a somewhat sprawling directory structure. Our remote state and locking setup mirrors these same paths.
I was already using similar functionality from the "terragrunt" wrapper tool, which also provides me with two very useful helper functions for managing those remote state details called "find_in_parent_folders()" and "path_relative_to_include()". Working together, these functions establish the path between the root of the terraform tree and this one, giving me a relative path to use for the key details in each of my terraform configuration directories. That means the configuration only has to be applied once (in the root) and everywhere else I can just copy the basic configuration.
Without this, the configuration has to be constructed manually each time which is an error-prone practice. It looks like the new state code has checks to make sure you don't accidentally overwrite a statefile with a different lineage (thank you for that) but it would still be nice to avoid this repetitive work with a similar capability in core.
The text was updated successfully, but these errors were encountered:
Hear, hear! This would be a great enhancement for S3 backend users. I get that Terraform has more backends than just "S3." But if your using S3 backend currently you end up with little init.sh scripts or makefile strewn throughout your repo to set the S3 key path. It's anti DRY and KISS.
A top level config for an S3 backend for this feature might look like this:
A key value of auto-tree would tell Terraform to determine pwd and set it as key value. Feel free to bike shed auto-tree or expand and refine the basic Terragrunt config concept.
The new remote state functionality in 0.9 is interesting, but leaves me (and presumably others) in a somewhat unfortunate situation. To minimize the number of things touched in a terraform run we group things logically across a somewhat sprawling directory structure. Our remote state and locking setup mirrors these same paths.
I was already using similar functionality from the "terragrunt" wrapper tool, which also provides me with two very useful helper functions for managing those remote state details called "find_in_parent_folders()" and "path_relative_to_include()". Working together, these functions establish the path between the root of the terraform tree and this one, giving me a relative path to use for the key details in each of my terraform configuration directories. That means the configuration only has to be applied once (in the root) and everywhere else I can just copy the basic configuration.
Without this, the configuration has to be constructed manually each time which is an error-prone practice. It looks like the new state code has checks to make sure you don't accidentally overwrite a statefile with a different lineage (thank you for that) but it would still be nice to avoid this repetitive work with a similar capability in core.
The text was updated successfully, but these errors were encountered: