Try something like:
#!/bin/bash
yum update –y
yum install -y httpd24 php70 mysql56-server php70-mysqlnd
.....
rds_host=$(aws rds --region ca-central-1 describe-db-instances --query "DBInstances[*].Endpoint.Address")
echo "<?php " > /var/www/html/dbinfo.php
echo "define('DB_SERVER', $rds_host);" >> /var/www/html/dbinfo.php
etc.