This message was deleted.
# general
s
This message was deleted.
m
Would be awesome if you could give examples of how one can combine the count argument that depends on resources where Terraform doesn't know the amount yet, because they are also going to be created. An example could be that I want to create an AWS VPC resources and in the same terraform plan/apply also add one route to all created route tables from the VPC resource.
d
Could you please share your experience with using terraform_remote_state data source. Is it a good practice to rely on that? Upd: I mean that using that data source a lot in my code. Does it make my terraform code more complex and less reusable? Thank you!
m
@Hila F if can take a look at these questions?
h
I promise to go over all the questions tomorrow 🙂
The count question- I’m not sure if I fully understood the need, but if I can’t use count, then I’ll switch to a for_each and loop over a variable that has a map of all needed resources terraform_remote_state*-* We use terraform_remote_state quite a lot. it doesn’t make your code more complex. if you need data from a different state, and a regular data source is not helpful enough, then yeah- you can rely on terraform_remote_state. I would use it in the live side, and not modules, because if the remote state will change in a way that will break the module, it could have a bigger blast radius
a
We use remote state a lot to read values from other terraform resources. Eg VPC info. Keeping it all updated and connected is harder
z
This was a great session! Thanks for using Tiexin's post as a reference, Hila! For everyone else, you can find it here 😄 https://blog.gitguardian.com/9-extraordinary-terraform-best-practices
s
We use remote state a lot to read values from other terraform resources. Eg VPC info. Keeping it all updated and connected is harder
I second that - remote state lookup is the way to go