Utilize Terraform, Bash and NodeJS to create a fully automated deployment of a portfolio website into OCI.
NodeJS portfolio site (didn't design this myself, just editted 'i am john' portfolio) that is deployed to Oracle Cloud Infrastructure (OCI) via Terraform with a Bash bootstrap for configuration of instances. The porfolio is made highly available if the OCI region supports multiple availability domains, otherwise it will deploy two instances on a single availability domain. The configuration looks like this:
- Terraform: Installation Instructions
- Oracle Cloud Infrastruction Tenancy: Try Free
- Clone this repository to your machine in a directory of your choice
git clone https://github.com/danagarcia/portfolio.git
- Navigate to
portfolio/src/terraform
- Create provider.tf
- Follow guide: Set Up OCI Terraform
- Initialize Terraform
- Run
terraform init
- Run
- Create Plan
- Run
terraform plan
- Run
- Apply Plan
- Run
terraform apply
- Run
- Clone this repository to your machine in a directory of your choice
git clone https://github.com/danagarcia/portfolio.git
- Navigate to
portfolio/src/terraform
- Copy your RSA public key
~/.ssh/id_rsa.pub
toportfolio/src/terraform
- Copy
portfolio/scripts/setup.sh
toportfolio/src/terraform
- Edit
hostname
,setup_path
, andssh_public_key_path
invariables.tf
hostname
is your domain namesetup_path
is./setup.sh
ssh_public_key_path
is./id_rsa.pub
- Save changes to
variables.tf
- Compress all files in
portfolio/src/terraform
into a ZIP archive - In the Oracle Cloud Infrastructure portal type
Stacks
in the search - Click
Stacks
under theServices
section of the drop down. - Click
Create Stack
- Select the
.Zip file
radio in theStack Configuration
section - Drag and drop the ZIP archive you created into the
Stack Configuration
section - Click
Next
- Click
Next
- Click
Create
- The stack will be created and you now can click
Plan
(follow defaults) thenApply
(follow defaults) to deploy the resources