I have two EC2 instance; my 1st EC2 instance is for my projects; my 2nd EC2 instance for the database
Is it possible to call the other EC2 in my .env file coming from my 1st EC2 instance?
I have two EC2 instance; my 1st EC2 instance is for my projects; my 2nd EC2 instance for the database
Is it possible to call the other EC2 in my .env file coming from my 1st EC2 instance?
You will need to specify the IP address of the second EC2 instance in the first instance. You can find the IP address in the AWS console or by running a command such as ifconfig or ipconfig.
Add in .env file.
DB_HOST=10.0.0.2 # IP address of your second EC2 instance
DB_PORT=3306 # port number of your database
DB_USER=database_username # your database username
DB_PASS=database_password # your database password
Let me know if this working or not.