Define complex data structures in terraform by using the most flexible variable types
<p>In Terraform, there are different variable types that you can use for passing into your modules. You can also use them to define how often and with which values a resource should be deployed.</p>
<p>I’ll show you how to handle more complex data structures in Terraform in this article. I’ve created some examples using maps & lists that you can use and compare to your use case and adjust them as you need.</p>
<p><img alt="Source: https://pixabay.com/de/illustrations/muster-albert-einstein-uni-e-mc2-7221346/" src="https://miro.medium.com/v2/resize:fit:700/1*GzISq-i2NdjYVJm_TclUcg.jpeg" style="height:700px; width:700px" /></p>
<p>Source: <a href="https://pixabay.com/de/illustrations/muster-albert-einstein-uni-e-mc2-7221346/" rel="noopener ugc nofollow" target="_blank">https://pixabay.com/de/illustrations/muster-albert-einstein-uni-e-mc2-7221346/</a></p>
<h1>Simple Way: Directly pass a variable value into the module</h1>
<p>This is the simplest way of passing variables into modules. In your terraform module, you declare, which variables should be passed and what type they are of. In the module declaration you pass the variable value:</p>
<p><a href="https://medium.com/@andris_dev/terraform-how-to-define-complex-data-structures-easier-by-using-the-more-flexible-variable-types-254ac5c2aa01"><strong>Website</strong></a></p>