title: Concat strings and list variable in terraform
body: <p>I need to pass a list of cidr blocks to a module in the form of [&quot;0.0.0.0/23&quot;,&quot;0.0.0.1/23&quot;,...] etc.</p>
  <p>I have two cidr blocks which I'm getting from a subnet data source, which I can reference as an example as:</p>
  <pre><code>cidr_blocks = [data.aws_subnet.subnet1.id,data.aws_subnet.subnet2.id]
  </code></pre>
  <p>I also have a variable, depending on the environment, has a specific list of cidr_blocks to pass in, set as an example:</p>
  <pre><code>custom_cidrs = [&quot;&quot;0.0.0.0/23&quot;,&quot;0.0.0.1/23&quot;,&quot;0.0.0.2/23&quot;]
  </code></pre>
  <p>What I want to do is in the module, concat all these cidrs together to create one list. I have tried a few different things, including concat and list(). I just can't get the syntax right.</p>
  <p>For some contexts, they'll be no custom cidr blocks to set, only the subnet cidrs, so in that instance my custom cidrs will be set to:</p>
  <pre><code>custom_cidrs = []
  </code></pre>
  <p>Any help on how to concat the two outputs and the custom list into one will be appreciated.</p>
  <p>I'm thinking I may have to create a list from the two outputs first, then concat the two lists together, but not entirely sure. Can I do it in one command?</p>
  <p>I am using terraform version 0.12.28</p>