feat: Linode Provider v2 migration and backend module

- Documented Linode Terraform Provider v2 migration in ADR-0002
- Created dedicated backend module for state storage
- Updated all modules for v2 patterns (cluster→region, pools→pool, tags)
- Added firewall outputs and backend outputs
- Updated example tfvars files with v2 configurations
- Updated AGENTS.md, README.md, and documentation
This commit is contained in:
Bobby committed 2026-11-17 23:29:19 -05:00
1 parent 27abc1891b
commit a5047cb72e
17 files changed
+581 -121

No files matched your search

+12 -51
View File
@@ -1,55 +1,16 @@
# Backend configuration for Terraform state in Linode Object Storage
# This module provides the configuration needed for remote state storage
# Backend configuration for HAPI Terraform state
terraform {
required_providers {
linode = {
source = "linode/linode"
version = "~> 2.0"
}
random = {
source = "hashicorp/random"
version = "~> 3.0"
}
backend "s3" {
# State stored in Object Storage
bucket = "hapi-terraform-state-${var.environment}"
key = "hapi/terraform.tfstate"
region = var.linode_object_storage_cluster
endpoint = "${var.linode_object_storage_cluster}.linodeobjects.com"
access_key = var.object_storage_access_key
secret_key = var.object_storage_secret_key
skip_region = true
skip_credentials_validation = true
skip_metadata_api_check = true
}
}
resource "linode_object_storage_bucket" "terraform_state" {
label = "hapi-terraform-state-${var.environment}"
region = 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 = true
}