| slug | nested-backend-maps-support | |
|---|---|---|
| title | Fixed: Nested Maps in Terraform Backend Configurations | |
| authors |
|
|
| tags |
|
|
| date | 2025-01-04 00:00:00 UTC | |
| release | v1.198.0 |
Atmos now properly handles nested maps in Terraform backend configurations when using HCL format. This fixes an issue where complex backend settings like assume_role were silently dropped.
When generating backend configurations with atmos terraform generate backends --format hcl, nested maps were missing from the output. For example:
terraform:
backend:
s3:
bucket: "my-terraform-states"
assume_role:
role_arn: "arn:aws:iam::123456789012:role/terraform"
session_name: "terraform-backend"The generated backend.tf was missing the assume_role configuration entirely.
We added a recursive type converter that handles nested maps, arrays, and all Go types when generating HCL output. The JSON and backend-config formats already worked correctly.
Now all nested configurations are properly preserved:
terraform {
backend "s3" {
bucket = "my-terraform-states"
assume_role = {
role_arn = "arn:aws:iam::123456789012:role/terraform"
session_name = "terraform-backend"
}
}
}Upgrade Atmos and regenerate your backend configurations:
atmos terraform generate backends --format hclAll three formats (HCL, JSON, backend-config) now correctly handle nested structures.