Table of Contents
This repository is concerned with the provisioning of infrastructure for any of my personal projects using Terraform IaC. Currently, the cloud services used to host my projects are AWS and Cloudflare.
Note: This is just one of multiple repositories that contribute to my personal projects. Here are all the related repositories:
Repository | Built With | Description |
---|---|---|
pierreccesario | Hugo, Markdown, Jenkins, AWS | Personal Portfolio and Blog Static Website |
PCPartsTool | SvelteKit, TypeScript, Tailwind CSS, MongoDB, Jenkins, Docker, Playwright | The SvelteKit MongoDB WebApp |
PCPartsTool-Scraper | JavaScript, Jenkins, Docker | Scraping Script to Gather E-commerce Item Data |
terraform-infra | Terraform, Cloudflare, AWS | Terraform IaC for PCPartsTool Cloud Infrastructure |
ansible-ec2 | Ansible, Prometheus, Grafana, Nginx, AWS | Ansible CaC for AWS EC2 Bootstraping, Observability and Maintenance |
shuttleday | React, TypeScript, MUI, Node.js, Docker, Express, MongoDB | Badminton Scheduling and Information Webapp |
This section guides you on how to setup this repo for your own use.
-
First, ensure Terraform is installed on your dev computer.
-
Ensure the AWS CLI is also installed on your dev computer.
-
In the AWS console, create an IAM User for Terraform to use.
-
Run
aws configure
in your terminal to configure the AWS CLI to use said IAM User. This is how Terraform will gain access to your AWS account. -
In your desired project folder, clone the project with the following command:
git clone https://github.com/PScoriae/terraform-infra
-
Get your Cloudflare API token for Terraform to use.
-
Get the Zone IDs for each Cloudflare DNS domain you wish to access through Terraform
-
Create a
terraform.tfvars
file in the root directory of your project. It holds the credentials to your Cloudflare account. You may refer toterraform.example.tfvars
-
Finally, run
terraform init
in the root directory to set up the Terraform backend.