What are Terraform Dynamic blocks? - Part 8

preview_player
Показать описание
▬▬▬▬▬▬ 🗓️ Book Me for Consultation ▬▬▬▬▬▬

▬▬▬▬▬▬ 🙍🏻‍♂️Join Membership ▬▬▬▬▬▬
Join this channel to get access to perks:

▬▬▬▬▬▬ 🚀 Top resource to learn Cloud Computing ▬▬▬▬▬▬
▬▬▬▬▬▬ * Instruction's Guides * ▬▬▬▬▬▬

Terraform dynamic block behaves pretty much the same as for or for-each loop. It not only iterates over the value range but also creates nested dynamic blocks which can be complex.

Terraform dynamic block usually consists of three elements -

1. Name of dynamic block
2. for_each
3. content

1. Name of dynamic block - You can keep the name of the block as per your choice, terraform does not have very strict rules on defining the dynamic block names

2. for_each - Here you need to provide any collection or structural values which can be iterated

3. content - It is a terraform block or body which will be generated for each value of the for-each loop

▬▬▬▬▬▬ ⭐️ 🕘Timestamps ⭐️ ▬▬▬▬▬▬
0:00 Introduction
0:44 What is terraform dynamic block?
2:20 Terraform block syntax
5:33 Demo of Terraform dynamic block on aws
8:29 Execute terraform dynamic block
10:34 Best practices for using Terraform dynamic block

Disclaimer/Policy: All the content/instructions are solely mine. The source is completely open-source.

Video is copyrighted and can not be re-distributed on any platform.

#devops #aws #terraform #cloud
Рекомендации по теме
Комментарии
Автор

Perfect. this is the task i got now and you made my life easy. thank you very much Rahul

anilkommalapati
Автор

Thanks a lot for this concise, no BS tutorial!

ShauryeVardhan
Автор

Thank you sir because of I have started terraform tq fr teaching us.. May God provide a health and wealth God bless you

deepuShivansh
Автор

Awesome series, with clarity and concise on the topic!

dataman
Автор

Thank you sir we really appreciate your effort.

sunshockus
Автор

One change, we cannot use any name for the dynamic block, we need to name according to the resource type. For example if you use any other name other than ingress, it will throw an error.

sankaranand
Автор

Thank you!! one Q, @ 2:57 dynamic block name can be anything ? When I use an invalid block name like "ingress1" etc it says 'Blocks of type "ingress1" are not expected here.'. Works with only "ingress".

cirishafranky
Автор

great video. I just wanted to comment that in one section of the video you said dynamic block can have any name for example ingress that name will be used in the code. so if you had dynamic rahul then that block would be in the code

anoopsidhu
Автор

bro apne awesome series banaya h bs ek request h plz make some projects using terraform on aws where u will use things like elb autoscaling api gateways some realtime sceanario it could help us alot

shamstabrez
Автор

Hi Rahul thanks for this nice video. Dynamic block provides functionality to cater looping for attributes which are defined within resource object as we can use for_each and count for resources directly but not for blocks inside resources. Otherwise if it had been resource just to_set(port) and each.value could have been done but this will not be applicable to ingress/egress block within SG. Correct me if I am wrong . 🙏

cricmania
Автор

How can we use credentials which is fetch from role in provider block?

narendernls
Автор

could you please upload share the .txt file of this lab <dynamic block>

zubandesi
visit shbcf.ru