Skip to content

Tutortoise/infrastructure

Repository files navigation

Infrastructure

This repository is Infrastucture as Code (IaC) of Tutortoise project. It uses Terraform to provision and manage resources.

Prerequisites

1, Required Tools

2. Access Credentials

Before you can use terraform you need to authenticate with gcloud sdk

gcloud auth application-default login

3. Terraform Backend

Create a Google Cloud Storage bucket if you don't have one already. This bucket will be used as the backend to store the terraform state file.

gsutil mb -p your-project-id -l asia-southeast2 gs://tutortoise-terraform

Usage Guide

1. Clone the Repository

git clone https://github.com/Tutortoise/infrastructure.git
cd  https://github.com/Tutortoise/infrastructure.git

2. Initialize Terraform

terraform init

This command will download and intialize the required providers and modules.

3. Configure the Variables

copying the terraform.tfvars.example file to terraform.tfvars and modifying the values.

project_id = "your-project-id"
region = "asia-southeast2"

4. Plan the Changes

Run the following command to preview the infrastructure changes:

terraform plan

5. Apply the Changes

Deploy the infrastructure with:

terraform apply

Confirm the changes when prompted.