01: infra

This commit is contained in:
Bobby committed 2026-11-17 14:39:40 -05:00
1 parent ec9bb74be0
commit 341cd05ac5
71 files changed
+2058 -1

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
# Backend configuration for Terraform state in Linode Object Storage
# This module provides the configuration needed for remote state storage
resource "linode_object_storage_bucket" "terraform_state" {
label = "hapi-terraform-state-${var.environment}"
cluster = var.linode_object_storage_cluster
access_key = var.object_storage_access_key
secret_key = var.object_storage_secret_key
}
locals {
backend_config = {
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
}
}
output "backend_config" {
description = "Terraform backend configuration"
value = local.backend_config
}
output "backend_s3_config" {
description = "S3-style backend configuration for Terraform"
value = {
bucket = local.backend_config.bucket
key = local.backend_config.key
region = local.backend_config.region
endpoint = local.backend_config.endpoint
encrypt = local.backend_config.encrypt
access_key = local.backend_config.access_key
secret_key = local.backend_config.secret_key
skip_region_validation = local.backend_config.skip_region_validation
}
sensitive = {
secret_key = local.backend_config.secret_key
}
}