title: Taking output of terraform to bash script as input variable
body: <p>I am writing a script that takes care of running a terraform file and create infra. I have requirement where I need to take output from the terraform into the same script to create schema for DB. I need to take Endpoint, username, Password and DB name and take it as an input into the script to login to the db and create schema. I need to take the output from aws_db_instance from terraform which is already created and push that as an input into the bash script.
  Any help would be really appreciated as to how can we achieve this. thanks in advance. Below is the schema code that I would be using in script and would need those inputs from terraform.</p>
  <pre><code>RDS_MYSQL_USER=&quot;Username&quot;;
  RDS_MYSQL_PASS=&quot;password&quot;;
  RDS_MYSQL_BASE=&quot;DB-Name&quot;;
  
  mysql -h $RDS_MYSQL_ENDPOINT -P $PORT -u $RDS_MYSQL_USER -p $RDS_MYSQL_PASS -D $RDS_MYSQL_BASE -e 'quit';```
  </code></pre>