Parsing Data with For Loops

Поділитися
Вставка
  • Опубліковано 27 сер 2024

КОМЕНТАРІ • 26

  • @methate
    @methate 2 роки тому +2

    I read official TF Doc, I read some articles. Nothing helped to get an idea how it's actually working. So, I'm happy that I found your video. It's perfect explanation. In fact, probably you're the best presenter that I've ever seen (and I've seen a lot of presenters). Please continue doing your good job!

  • @vibhormathpal2021
    @vibhormathpal2021 10 місяців тому +1

    This one is really a gold.

  • @dawidmandyna8635
    @dawidmandyna8635 3 роки тому +2

    Hey Ned,
    Great job on this video. I was looking for a while for a good explanation about the for_loops in Terraform, as their documentation is lacking a lot of information in that space. Now everything is much clearer! Thank you!

  • @deefdragon
    @deefdragon 2 роки тому

    This is a ridiculously good tutorial on complex data structures in terraform. This is literally exactly what I have been looking for to wrap my head around them.
    I will be honest, this is not something I would expect from someone with 3.75 K subs. More like 375K. Keep on going, cause you are awesome.
    Edit: It took all of 5 minutes after watching this tutorial to completely refactor my code to be SOOO much more readable, and actually make logical sense. So thank you again.

  • @TheXiguazhi
    @TheXiguazhi Рік тому

    Subscribed. This makes what I'm trying to do so much easier knowing what you just said here. Thank you for saving me hours of looping in my brain so I can work on looping inside my terraform files

  • @devlinthornicroft9975
    @devlinthornicroft9975 3 роки тому +1

    This video was excellent at explaining the concept. Thank you.

  • @MrNoartik
    @MrNoartik Рік тому +1

    Oh man, you save so many hours, thanks wery helpfull

  • @vonschnappi
    @vonschnappi 3 роки тому

    “Hey everybody what’s up it’s Ned…”
    Yep, imma subscribe.

  • @AniruddhaKhadkikar
    @AniruddhaKhadkikar Рік тому

    This has been a nirvana moment for me aka lots of aha's! Thanks a ton Ned! I will try to do something similar but with a yaml config and yamldecode.

  • @ayush2708
    @ayush2708 2 роки тому

    God or wut. I was always searching on how to visualise each line in documentation. And terrform console was it. Plus godly explanation. Thank you. :)

  • @MrPankajkr06
    @MrPankajkr06 2 роки тому

    This video is gold

  • @onenationunderduress8994
    @onenationunderduress8994 2 роки тому

    My anxiety level after that taco intro is through the roof!

  • @moritz473
    @moritz473 3 роки тому +1

    Great content! Thank you

  • @jafarshaik5160
    @jafarshaik5160 3 роки тому +1

    Loved it

  • @ajpatterson57
    @ajpatterson57 2 роки тому +1

    Thanks for the video. Do you know how we would loop these into a data source? So for instance how would we loop a list of userprincipalnames into azuread_users to return object ids?

  • @timsamanchi3004
    @timsamanchi3004 2 роки тому

    thank you kind sir.

  • @p.a8750
    @p.a8750 3 роки тому +1

    Great video! Been trying to get my head round this for some time and your video explains it perfectly! One question - i saw some code that had the following:
    For i in var.instances:
    “${i.name} ${i.zone}” => i
    Trying to work out if => i is making ‘i’ have the values of i.name and i.zone from each iteration in var.instances?
    Var.instances was an object containing a name value and a zone value. What does => actually mean?

    • @NedintheCloud
      @NedintheCloud  3 роки тому +2

      The syntax can be confusing:
      { for i in var.instances: "${i.name} ${i.zone}" => i }
      The curly braces indicate the resulting data type with be an object. The var. instances is the source of the for loop. I would guess that var.instances is a list of maps or objects. The "i" is the iterator for the for loop.
      As the loop iterates, "i" will load a map from the list of maps stored in var.instances. The i.name and i.zone come from the currently loaded map.
      Since we are creating an object with key value pairs, the "${i.name} ${i.zone}" is the key and the "i" is the value. The => indicates mapping a key to a value.
      Hopefully that clears things up!
      Here's the official docs too: www.terraform.io/docs/language/expressions/for.html

    • @p.a8750
      @p.a8750 3 роки тому

      @@NedintheCloud thank you for explaining this!

  • @michaelhanley7112
    @michaelhanley7112 3 роки тому

    Great Vid.
    But i have a question, Instead of managing a json file for data could a map variable work?

    • @NedintheCloud
      @NedintheCloud  3 роки тому +1

      If you are able to pass the data to Terraform as a map that would be great. Sometimes you don't have control over the input format or you want to extract a small portion of a larger data structure.

    • @michaelhanley7112
      @michaelhanley7112 3 роки тому +1

      @@NedintheCloud thank u ned

  • @mosksky
    @mosksky 3 роки тому

    TY Ned another great demo! now there is no need to declare the variables (variables.tf is not needed) no more finding appropriate type as well. Any chance you could update "terraform-Tuesday" repo as a map (Parsing Data with For Loops => 2021-01-25) just use for loop :) Really hard to trace some of old recording, like this video has been dated 01/26 but the repo folder is 01/25. I am not picky just want to share my feedback

    • @NedintheCloud
      @NedintheCloud  3 роки тому +1

      I have been thinking about updating the folder naming to the episode to make it easier. I'll see if I can fit that in before next week's episode.