- Add terraform backend configuration (s3-compatible with Linode Object Storage) - Update PostgreSQL pool sizes from 10/25 to 2/3 in ADR-0001 - Add explicit linode provider configuration in providers.tf - Document DROP policies for security model This addresses both required and optional feedback from the code review.
60 lines
1.7 KiB
Terraform
60 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"
|
|
}
|
|
}
|
|
|
|
# Backend configuration for Terraform state using S3-compatible Linode Object Storage
|
|
backend "s3" {
|
|
bucket = "hapi-terraform-state-${var.environment}"
|
|
key = "terraform/${var.environment}/terraform.tfstate"
|
|
region = var.linode_region
|
|
endpoint = "https://${var.linode_region}.linodeobjects.com"
|
|
encrypt = true
|
|
access_key = var.object_storage_access_key
|
|
secret_key = var.object_storage_secret_key
|
|
skip_region_validation = true
|
|
}
|
|
}
|
|
|
|
# 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
|
|
}
|