Skip to content

Setting Up Infrastructure with Terraform and Terraform Cloud

Overview

We use Terraform to define and manage our infrastructure as code. For storing the infrastructure state and managing sensitive data, we use Terraform Cloud as our backend.

Terraform Cloud Backend

We use Terraform Cloud to store the state of our infrastructure. This setup offers:

  • Security: Sensitive information (e.g., API keys) is securely stored in Terraform Cloud.
  • Collaboration: Team members can work together efficiently, managing infrastructure state in one place.
  • Automation: Terraform Cloud automates plan and apply processes for changes in infrastructure.

Workspace Syloe

GitHub Repository

The infrastructure code is stored in the following GitHub repository:

https://github.com/SYLOE-GROUP/NewRoad-Infra

This repository contains all the necessary files for managing our infrastructure with Terraform.

Environments

EnvironmentPurposeSpecifics
newroad-devDevelopment- Single task to avoid additional costs.
- Located in France for better response times.
newroad-prodProduction- Located in South Africa for resilience and high availability.
- Designed for fault tolerance in production.

Managing Variables in Terraform Cloud

All variables (such as credentials and configurations) are stored in Terraform Cloud.

  • Secure: Sensitive variables are marked as secure and won’t appear in logs or outputs.
  • Centralized: All variables are stored in one place, making it easy to manage and update them.
  • Environment Separation: Variables can be separated by environment (e.g., dev, prod), allowing us to manage different setups easily.

Conclusion

Using Terraform with Terraform Cloud helps us manage infrastructure securely and efficiently. The code for the infrastructure is in the GitHub repo, and Terraform Cloud handles state and variables.

You can find the infrastructure code here:
https://github.com/SYLOE-GROUP/NewRoad-Infra