This folder contains the Terraform configurations for our project's infrastructure, managed through Terraform Cloud. The infrastructure is divided into multiple workspaces to handle different environments and shared resources.
The repository is organized into the following directories, each corresponding to a specific Terraform Cloud workspace:
-
/core
- This directory contains the Terraform configurations for the global/shared resources used across all environments. These may include VPCs, shared databases, IAM roles, etc. -
/server
- Contains the Terraform configurations for the production web server. This workspace should be configured with production-grade settings, ensuring high availability and security. -
/server-preview
- This directory is for the preview web server, typically used for pull request reviews. It might contain configurations that are under testing or not yet approved for the testing environment. -
/server-test
- Holds the configurations for the testing/QA web server. This environment mirrors production closely and is used for final testing before deploying to production.
- Terraform CLI
- Access to the Terraform Cloud workspace
- Log in to Terraform Cloud.
- Create a workspace for each directory/environment.
- Link each workspace to the corresponding directory in this repository.
- Save Terraform API token to the
../.terraformrc
file.
To work with Terraform configurations:
- Navigate to the appropriate directory (e.g.,
cd server
). - Initialize Terraform:
terraform init
. - Apply configurations:
terraform apply
.
Ensure that you are working in the correct workspace to avoid misconfigurations.
Please follow our contribution guidelines for making changes or adding new configurations. Ensure you test configurations in the test and preview environments before applying them to production.
- https://learn.hashicorp.com/terraform
- https://cloud.google.com/docs/terraform/best-practices-for-terraform
- https://cloud.google.com/iam/docs/workload-identity-federation-with-deployment-pipelines
- https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference.html
For any issues or questions related to this Terraform setup, please contact @koistya on our Discord server.