Open lorenyu opened 1 month ago
Somewhat related, but should ultimately be split into a separate issue:
The script should check .terraform/terraform.tfstate | jq .backend.config to see if it is already the correct backend config and skip initialization if so to speed up terraform commands.
Can we make jq
a requirement for working with the platform templates? It would simplify a lot of our scripts.
Can we make jq a requirement for working with the platform templates? It would simplify a lot of our scripts.
Yeah I was avoiding adding dependencies at first but I realize now that it's a light, common, and robust enough dependency that it's worth it at this point given how much it'd simplify things
The Makefile commands that wrap terraform are nice but pretty limited which forces devs to use the terraform commands sometimes. This makes it a leaky abstraction and also not as convenient. It would be nice to have a more flexible wrapper that can handle most or all of terraform's functionality.
Design and implementation notes
Adding all of it to Makefile would probably make the Makefile unweildy as Make isn't designed for that. Consider something like a
bin/infra
script that can be used like:Speeding up terraform by skipping initialization when possible
it would be nice if the script checked
.terraform/terraform.tfstate | jq .backend.config
to see if it is already the correct backend config and skip initialization if so to speed up terraform commands.Autocomplete
autocomplete would be nice too: