First, I need to access the instance created by Terraform and connect to it to add data to RDS.
ECS Instance
in the AWS console.Since my Terraform configuration has already set up the dependencies and includes a sample database, adding data to RDS will be easier.
Now, we will navigate to the pre-set directory and add the absolute path for the database here.
cd ./aws-fcj-container-app/database/
echo $PWD/init.sql
Next, we need to log in to RDS to add the data from that path.
mysql -h "rds-endpoint" -u "name-user" -p
source /home/ubuntu/aws-fcj-container-app/database/init.sql
SHOW DATABASES;
USE fcjresbar;
SELECT * FROM Clients;