locals.tf
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# locals =====================================================================

locals {
  tags = merge(
    {
      ManagedBy = "terraform"
      Module    = "storage/fsx-windows"
    },
    var.tags,
  )

  # MULTI_AZ_1 requires preferred_subnet_id — derive from first subnet if not explicit.
  preferred_subnet_id = var.deployment_type == "MULTI_AZ_1" ? coalesce(
    var.preferred_subnet_id,
    var.subnet_ids[0],
  ) : null

  # Audit logging is only configured when a destination ARN is provided.
  audit_log_enabled = var.audit_log_destination_arn != null
}