File indexing completed on 2024-05-19 15:23:17
0001 <!DOCTYPE html> 0002 <html><head> 0003 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 0004 <title>test.tf</title> 0005 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (Terraform) - Theme (Breeze Light)"/> 0006 </head><body style="background-color:#ffffff;color:#1f1c1b"><pre> 0007 <span style="color:#898887;"># this is a comment</span> 0008 <span style="font-weight:bold;">terraform</span> { 0009 <span style="font-weight:bold;">required_providers</span> { 0010 <span style="color:#0057ae;">local</span> <span style="color:#ca60ca;">=</span> { 0011 <span style="font-weight:bold;">source</span> <span style="color:#ca60ca;">=</span> <span style="color:#bf0303;">"hashicorp/local"</span> 0012 } 0013 } 0014 <span style="font-weight:bold;">backend</span> <span style="color:#bf0303;">"http"</span> { 0015 } 0016 } 0017 0018 <span style="font-weight:bold;">variable</span> <span style="color:#bf0303;">"variable"</span> { 0019 type <span style="color:#ca60ca;">=</span> <span style="color:#0057ae;">list</span>(<span style="color:#0057ae;">string</span>) 0020 default <span style="color:#ca60ca;">=</span> [<span style="color:#bf0303;">"a"</span>, <span style="color:#bf0303;">"b"</span>, <span style="color:#bf0303;">"c"</span>] 0021 } 0022 0023 <span style="font-weight:bold;">locals</span> { 0024 a <span style="color:#ca60ca;">=</span> <span style="color:#b08000;">1</span> 0025 b <span style="color:#ca60ca;">=</span> <span style="color:#bf0303;">"aaaa"</span> 0026 c <span style="color:#ca60ca;">=</span> <span style="color:#0057ae;">true</span> 0027 } 0028 0029 0030 <span style="font-weight:bold;">provider</span> <span style="color:#bf0303;">"aws"</span> { 0031 } 0032 0033 <span style="font-weight:bold;">module</span> <span style="color:#bf0303;">"module_each"</span> { 0034 <span style="color:#0057ae;">for_each</span> <span style="color:#ca60ca;">=</span> <span style="color:#644a9b;font-weight:bold;">toset</span>(<span style="color:#0057ae;">local</span>.a) 0035 <span style="font-weight:bold;">source</span> <span style="color:#ca60ca;">=</span> <span style="color:#bf0303;">"module/</span><span style="color:#ff5500;">${</span><span style="color:#0057ae;">var.interpolation</span><span style="color:#ff5500;">}</span><span style="color:#bf0303;">/end"</span> 0036 } 0037 0038 <span style="font-weight:bold;">module</span> <span style="color:#bf0303;">"module_count"</span> { 0039 <span style="color:#0057ae;">depends_on</span> <span style="color:#ca60ca;">=</span> [<span style="font-weight:bold;">module</span>.module_each] 0040 <span style="color:#0057ae;">count</span> <span style="color:#ca60ca;">=</span> <span style="color:#b08000;">1</span> 0041 <span style="font-weight:bold;">source</span> <span style="color:#ca60ca;">=</span> <span style="color:#bf0303;">"module/path"</span> 0042 something <span style="color:#ca60ca;">=</span> <span style="color:#0057ae;">count</span>.<span style="color:#644a9b;font-weight:bold;">index</span> 0043 } 0044 0045 <span style="font-weight:bold;">output</span> <span style="color:#bf0303;">"output"</span> { 0046 value <span style="color:#ca60ca;">=</span> [<span style="color:#0057ae;">local</span>.a, <span style="color:#0057ae;">var</span>.a] 0047 } 0048 </pre></body></html>