- Update all modules to use Linode provider v2 (linode/linode ~> 2.0) - Replace deprecated cluster attribute with region in all modules - Update firewall to use ipv4/ipv6 instead of cidrs (TCP/UDP protocols) - Update LKE endpoint output to use api_endpoints[0] instead of deprecated hostname - Add OBJECT_STORAGE_CLUSTER variable for object storage configuration - Update Makefile with new variables and validate target - Add storage/outputs.tf for standardized object storage outputs - Update .env and .env.example with clean format (no inline comments) - Update all terraform.tfvars.example files for consistency
63 lines
1.7 KiB
Terraform
63 lines
1.7 KiB
Terraform
# Main Terraform configuration for HAPI infrastructure
|
|
# This file orchestrates all infrastructure components
|
|
|
|
terraform {
|
|
required_version = ">= 1.9.0"
|
|
|
|
required_providers {
|
|
linode = {
|
|
source = "linode/linode"
|
|
version = "~> 2.0"
|
|
}
|
|
random = {
|
|
source = "hashicorp/random"
|
|
version = "~> 3.0"
|
|
}
|
|
}
|
|
}
|
|
|
|
# Provider configurations are in providers.tf
|
|
|
|
# Modules
|
|
module "postgres" {
|
|
source = "./postgres"
|
|
|
|
linode_region = var.linode_region
|
|
linode_object_storage_cluster = var.linode_object_storage_cluster
|
|
object_storage_access_key = var.object_storage_access_key
|
|
object_storage_secret_key = var.object_storage_secret_key
|
|
environment = var.environment
|
|
}
|
|
|
|
module "storage" {
|
|
source = "./storage"
|
|
|
|
linode_region = var.linode_region
|
|
linode_object_storage_cluster = var.linode_object_storage_cluster
|
|
environment = var.environment
|
|
object_storage_access_key = var.object_storage_access_key
|
|
object_storage_secret_key = var.object_storage_secret_key
|
|
}
|
|
|
|
module "network" {
|
|
source = "./network"
|
|
|
|
linode_region = var.linode_region
|
|
environment = var.environment
|
|
}
|
|
|
|
# Backend configuration for Terraform state
|
|
# State will be stored in Linode Object Storage
|
|
# Backend configuration is defined in infra/backend/
|
|
|
|
# Backend module (for terraform state storage configuration)
|
|
module "backend" {
|
|
source = "./backend"
|
|
|
|
linode_region = var.linode_region
|
|
linode_object_storage_cluster = var.linode_object_storage_cluster
|
|
object_storage_access_key = var.object_storage_access_key
|
|
object_storage_secret_key = var.object_storage_secret_key
|
|
environment = var.environment
|
|
}
|