Using For_Each in a Terraform Module with Azure VNets and Bastion Host

Ғылым және технология

Yet another in a series on Terraform and Azure. This one goes into detail on using loops in a Terraform Module. We deploy an Azure VNet and Bastion host with a module, looping through a variable number of subnets with a for_each statement. Then, we output the subnet IDs and public IP of the Bastion host.
00:00 - Start
03:30 - Create the Module
05:19 - Create a For_Each Loop
09:56 - Referencing a For_Each Instance
13:49 - Apply the Configuration
Links
Zero to Hero with Azure Virtual Desktop
www.udemy.com/course/zero-to-...
Hybrid Identity with Windows AD and Azure AD
www.udemy.com/course/hybrid-i...
Terraform Playlist
• Getting Started with T...
Code on Github
github.com/tsrob50/TerraformE...
Blog
www.ciraltos.com/use-for_each...

Пікірлер: 20

  • @D-Weezy2284
    @D-Weezy2284Ай бұрын

    I really appreciate this playlist. I've watched many videos on how to learn Terraform and your examples and explanations have worked wonders for me in understanding the material and able to retain and work on it on my own.

  • @rajeshchowdary3532
    @rajeshchowdary35328 күн бұрын

    I loved this playlist

  • @callsfromthebeyond6237
    @callsfromthebeyond62372 жыл бұрын

    Really enjoying these terraform tutorials Travis. Hope you will continue doing these!

  • @Ciraltos

    @Ciraltos

    2 жыл бұрын

    Thanks! I have a few more to come.

  • @pardistavakkoli4525
    @pardistavakkoli45252 жыл бұрын

    Many thanks Travis for the video. you explain simply. perfect for those who are new to Terraform. I really enjoyed watching it and learning Terraform.

  • @Ciraltos

    @Ciraltos

    2 жыл бұрын

    Glad it was helpful!

  • @jasric89
    @jasric89 Жыл бұрын

    Your Videos are amazing, there were a couple of things I have struggled to get my head around with Terraform over the four years of using it and that was Modules and For Each. Your Video literally made light bulb moments go off. I was like oh that's how that is done, as I could never work it our from the documentation and I'm Terraform Certified too I wish I came across you earlier as time to prep for the exam would have shot down.

  • @MCSLTD_io
    @MCSLTD_io8 ай бұрын

    Agree the amount of times I've spent trying to fix an issue. I step away for an hour and fix it within 5 minutes 😅

  • @Ulashigopal
    @Ulashigopal Жыл бұрын

    Thanks a ton Travis this really helped this was something which was bothering me yesterday whole day

  • @s.chandrasekhar8667
    @s.chandrasekhar86672 жыл бұрын

    Sir, You are really my god!!

  • @Ciraltos

    @Ciraltos

    2 жыл бұрын

    Happy to help

  • @ncvman
    @ncvman5 ай бұрын

    You the man. Enjoying all your terraform videos. Where do you get all your awesome shirts from? terraform fmt command is great help to fix indentation/formatting.

  • @pavan3040
    @pavan30402 жыл бұрын

    Great Content !!!

  • @Ciraltos

    @Ciraltos

    2 жыл бұрын

    Appreciate it!

  • @ginatube2026
    @ginatube2026 Жыл бұрын

    Hi Travis, I learned Terraform quickly because of your videos. Could you make a video about 2 VMS with different detail and their nic, and how to connect it to vnet and bastion host.

  • @masoudkooranloo908
    @masoudkooranloo908 Жыл бұрын

    Thank you!

  • @RajeshKumar-mv7ly
    @RajeshKumar-mv7ly Жыл бұрын

    Great content, but here you are using predefined subnet variable. What if we are creating subnet by using terraform, and the only thing known will be the count of subnets and instances. Using for_each in that case gives error: How to solve this? "The "for_each" map includes keys derived from resource attributes that cannot be determined until apply, and so Terraform cannot │ determine the full set of keys that will identify the instances of this resource."

  • @kayoutube690
    @kayoutube69010 ай бұрын

    how to pick up 1 value on the for_each loop instead picking up all the values?

  • @gouthamkamre2039
    @gouthamkamre20392 жыл бұрын

    @Travis Roberts can you make a video on child modules to create multiple resources with loop

  • @vivertsri
    @vivertsri Жыл бұрын

    Hi Travis, can I trouble you with a query around for_each loop? Pls let me know a place to draft an e-mail about it.

Келесі