title: Terraform: How to split output of a resource and pass it as input
body: <p>If I output</p>
  <pre><code>cloudamqp_instance.rabbitmq.url
  </code></pre>
  <p>I'll get</p>
  <pre><code>amqps://test:xxxxxxxxxxx@young-white.rmq2.cloudamqp.com/test
  </code></pre>
  <p>now I have to pass substring from above output like this</p>
  <pre><code>provider &quot;rabbitmq&quot; {
    endpoint = &quot;https://young-white.rmq2.cloudamqp.com&quot;
    username = &quot;test&quot;
    password = &quot;xxxxxxxxxxx&quot;
  }
  </code></pre>
  <p>Is there a way to do that??</p>