Skip to content
Snippets Groups Projects
Commit 8837a5f8 authored by Goik Martin's avatar Goik Martin
Browse files

count example

parent 08033032
No related branches found
No related tags found
No related merge requests found
......@@ -2909,9 +2909,44 @@ resource "local_file" "known_hosts" {...</programlisting>
xlink:href="https://developer.hashicorp.com/terraform/language/expressions/strings">Strings
and Templates</link></para>
</listitem>
<listitem>
<para><link
xlink:href="https://developer.hashicorp.com/terraform/language/meta-arguments/count">The
count Meta-Argument</link></para>
</listitem>
</itemizedlist>
</figure>
<figure xml:id="sdi_cloudProvider_count">
<title>Using <link
xlink:href="https://developer.hashicorp.com/terraform/language/meta-arguments/count">count</link></title>
<informaltable border="1">
<tr>
<th>Defining 10 server</th>
<th>10 corresponding A-records</th>
</tr>
<tr>
<td valign="top"><programlisting language="tf">resource "hcloud_server" "server" {
<emphasis role="red">count</emphasis> = 10
name = "www-${<emphasis role="red">count</emphasis>.index}"
user_data = local_file.user_data[<emphasis role="red">count</emphasis>.index].content
...
}</programlisting></td>
<td valign="top"><programlisting language="tf">resource "dns_a_record_set" "dnsRecordSet" {
<emphasis role="red">count</emphasis> = 10
zone = "g03.sdi.hdm-stuttgart.cloud."
name = hcloud_server.server[<emphasis role="red">count</emphasis>.index].name
addresses = [hcloud_server.server[<emphasis role="red">count</emphasis>.index].ipv4_address]
}</programlisting></td>
</tr>
</informaltable>
</figure>
<qandaset defaultlabel="qanda"
xml:id="sdi_cloudProvider_loops_qanda_multiServerGen">
<title>Creating a fixed number of servers</title>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment