Building and Securing Infrastructure-as-Code on DigitalOcean Cloud with Terraform, utilizing Three-Tier Architecture
The terra-stack project is a comprehensive implementation of Infrastructure-as-Code (IaC) using Terraform, aimed at building and securing a three-tier architecture. This repository provides a standardized and efficient approach to deploy and manage the infrastructure required for modern web applications.
- terra-stack/
- main.tf
- provider.tf
- environments/
- dev/
- compute.tfvars
- modules/
- compute/
- main.tf
- variables.tf
- outputs.tf
- storage/
- main.tf
- variables.tf
- outputs.tf
export TF_VAR_digitalocean_token="your-digitalocean-token"
terra-stack
directory:terraform init
(initialize Terraform in the root directory)terraform validate
(validate the configuration files)terraform plan -var-file=environments/dev/compute.tfvars -var-file=environments/dev/storage.tfvars
(preview the changes to be made)terraform apply -var-file=environments/dev/compute.tfvars -var-file=environments/dev/storage.tfvars
(apply the changes)