To allow FlexDeploy to deploy to a database instance on the Oracle cloud without having to open up the database ports via the firewall, an ssh tunnel can be established from an internal server. This ssh tunnel can then be configured to talk to the database listener via the ssh tunnel. To accomplish this, on a server on the local network that will serve as the endpoint to connect to the cloud database:
- -Setup the SSH to communicate from the internal endpoint to the cloud instance
- Create an .ssh directory:
- Populate the
id_rsa file with the private key
- Make sure permissions on the directory and file are 600:
chmod -R 600 /home/oracle/.ssh
- Start the SSH tunnel as a background process:
LOCALPORT to the port that FlexDeploy will connect to on the endpoint
CLOUD_INSTANCE to the public DNS name or IP Address of the cloud instance
CLOUD_DB_PORT to the listener port of the database on the cloud
- Run the command from the linux prompt:
ssh -i /home/oracle/.ssh/id_rsa -f -L LOCALPORT:CLOUD_INSTANCE:CLOUD_DB_PORT oracle@CLOUD_INSTANCE -N
ssh -i /home/oracle/.ssh/id_rsa -f -L 1621: oc-129-144-43-94.compute.oraclecloud.com:1521 email@example.com -N
- Now configure FlexDeploy:
- Setup an endpoint to the server that you created the ssh tunnel on.
- Configure the Database plugin to point to a JDBC URL of localhost:1621:dbt03 on the endpoint that you set up.
- Localhost will cause it to use the ssh tunnel on the current endpoint.
- The port of 1621 is automatically forwarded via the ssh tunnel to the cloud instance’s port 1521.
- The database dbt03 resides on the cloud instance.