Apache Tomcat® is an open source Java application server. It implements the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies.
The OCI Terraform Provider is now available for automatic download through the Terraform Provider Registry. For more information on how to get started view the documentation and setup guide.
Now, you'll want a local copy of this repo. You can make that with the commands:
git clone https://github.com/oracle-quickstart/oci-arch-tomcat-autonomous.git
cd oci-arch-tomcat-autonomous
ls
First off, you'll need to do some pre-deploy setup. That's all detailed here.
Setup TF_VAR_... to setup your environment
export TF_VAR_user_ocid=ocid1.user.oc1...
export TF_VAR_fingerprint=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
export TF_VAR_private_key_path=/path/to/private.key.pem
export TF_VAR_tenancy_ocid=ocid1.tenancy.oc1...
Secondly, create a terraform.tfvars
file and populate with the following information:
# Authentication
tenancy_ocid = "<tenancy_ocid>"
# SSH Keys
ssh_public_key = "<public_ssh_key_path>"
# Region
region = "<oci_region>"
# Compartment
compartment_ocid = "<compartment_ocid>"
Deploy:
terraform init
terraform plan
terraform apply
After the deployment is finished, you can test that your tomcat was deployed correctly and can access the database going to the urls:
http://<load balancer IP>/JDBCSample/JDBCSample_Servlet
http://<load balancer IP>/JDBCSample/UCPServlet
When you no longer need the deployment, you can run this command to destroy it:
terraform destroy
Although the diagram shows a private subnet for the Tomcat servers, the scripts are provisioning them on a public subnet as there is no bastion to allow access to the servers.