title: Is it possible to insert a value into a file before it gets used in a terraform resource?
body: <p>I'm deploying an Amazon Connect instance with an attached contact flow, following this documentation: <a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/connect_contact_flow" rel="nofollow noreferrer">https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/connect_contact_flow</a></p>
  <p>My contact flow is stored in a file, so I'm using the following:</p>
  <pre><code>resource &quot;aws_connect_contact_flow&quot; &quot;general&quot; {
      instance_id = aws_connect_instance.dev.id
      name        = &quot;General&quot;
      description = &quot;General Flow routing customers to queues&quot;
      filename     = &quot;flows/contact_flow.json&quot;
      content_hash = filebase64sha256(&quot;flows/contact_flow.json&quot;)
  }
  </code></pre>
  <p>However my contact flow requires me to specify the ARN of an AWS Lambda function in one particular section:</p>
  <p><em>...</em></p>
  <pre><code>&quot;parameters&quot;:[
     {
            &quot;name&quot;:&quot;FunctionArn&quot;,
            &quot;value&quot;:&quot;&lt;lambda function arn&gt;&quot;,
            &quot;namespace&quot;:null
      },
      {
            &quot;name&quot;:&quot;TimeLimit&quot;,
            &quot;value&quot;:&quot;3&quot;
      }
  ],
  
  &lt;/snip&gt;
  </code></pre>
  <p><em>...</em></p>
  <p>the value I would like to substitute into the json file at &lt;lambda function arn&gt; before the contact flow is created is accessible at</p>
  <pre><code>data.terraform_remote_state.remote.outputs.lambda_arn
  </code></pre>
  <p>Is there any way to achieve this? Or will I have to use the '<strong>content =</strong> ' method in the documentation linked above to achieve what I need?</p>
  <p>Thanks.</p>