Thank you for this great video, It was a great help in understanding how for_each works, and some great ways to do some testing on my own without having to build anything in AWS.
Thank you for this detailed explanation, I've a little question, can we get an index (integer value) from for_each ? for example can we write each.key.index ?
so if i wnna use for_each then i need to manual write 1-100 server for it to properly map the resource and work ?, if i delete then if i run it again , it creates for the number i defined , so i need to manually delete it.. too much of work ...
Hey Mani, not sure I follow. If you need ~100 nearly identical servers, then count is probably the way to go. If you have to provision 100 servers that are substantially different, you would need a set or map with 100 entries. That could come from an external file in json or yaml. Does that help?
You are cool mate. I am not going to say what everyone else says “like your content, explanation blah blah. I really liked the way you ended saying “subscribe you might like it” it was never compelling like others. Of course the topic and content was also helpful. I’m at the mid level so looking for a terraform real-time project implementation with AWS. Do you have anything on your channel please?
Thanks Arzlan! I tend to do most of my examples with Azure, since everyone else seems to focus on AWS. That being said, I do have a course on Pluralsight that is called "Implementing Terraform on AWS" that you might find useful.
Pluto actually! I prefer the atmosphere. Seriously though, I am working on migrating my website off wordpress to a static web app. Just need to find the time to export all the posts.
For referencing a resource, for loop with filter "item.content == ..." works now because you set file content as a set key, but if you had random content in your file and want to lookup resource by key, then I think that method would not work.
I hate count with a passion ..... but for_each needs `-target` alot of the time and that sucks if you want to bring somthing up but you have to target first :(