This project provides sample Terraform code for building out AWS infrastructure to support a 3-tier Oracle WebLogic deployment.
These instructions will allow you to create infrastructure in Amazon from your local machine. This Terraform can be used as a starting point for creating a 3-tier network deployment for hosting WebLogic applications that are fronted by load balancers and backed by an Oracle Database.
The Terraform code here can be modified to suit your needs.
The following resources are created
- VPC in us-east-1 region
- Public subnets for edge services across two availability zones
- Private subnets for WebLogic across two zones
- Private subnets for Database across two zones
- Network ACLs and Security Group rules to enable ssh, http/https and sqlnet traffic
- Internet and NAT gateway to facilitate traffic to/from Internet
- Bastion, application, and database servers
It is important to note that this Terraform example does not install any software on any of the servers, including WebLogic. This is left as an exercise for the user.
If you wish to learn more about Oracle WebLogic or Hashicorp Terraform, I offer two popular courses on Udemy.
Please check out:
- AWS API user with administrative access
- Terraform 0.11.8+
- AWS Terraform Provider
- Will be downloaded via terraform init
The SSH key generated is used to provide SSH access to EC2 instances.
This command will generate a public/private SSH keypair. The public key will be loaded onto any EC2 instances that are created, while the private key will be used to authenticate into those EC2 instances.
$ ssh-keygen -t rsa -b 4096 -f ~/.ssh/aws_rsa
The AWS Terraform Provider is configured to load AWS access credentials from an AWS credentials file.
[default]
aws_access_key_id=<YOUR AWS ACCESS KEY>
aws_secret_access_key=<YOUR AWS SECRET KEY>
region=us-east-1
$ cd weblogic-terraform
$ terraform init
$ terraform plan
$ terraform apply
$ terraform destroy
All SSH access to EC2 instances is done through the bastion server. In order to SSH into any one of the servers in a private subnet, you must configure the bastion as a proxy in your SSH config file as follows.
Be sure to replace the IP addresses shown below with the actual IP addresses created for any EC2 instaces.
Host jumpbox
HostName 34.239.123.252
User ec2-user
IdentityFile ~/.ssh/aws_rsa
ProxyCommand none
Host weblogic1
HostName 10.0.100.4
User ec2-user
IdentityFile ~/.ssh/aws_rsa
ProxyCommand ssh jumpbox -W %h:%p
- Christopher Parent - Initial work - ChrisRacer79
This project is licensed under the MIT License - see the LICENSE.md file for details