TerraformPilot

DevOps

Terraform for Sodium-Ion Battery Analytics on AWS

Provision sodium-ion battery analytics infrastructure with Terraform: telemetry ingestion, time-series storage, manufacturing dashboards, and grid simulation.

LLuca Berton1 min read

Sodium-ion batteries are stepping out of the lab in 2026 — cheap, cobalt-free, grid-friendly. Cell makers and storage operators need cloud analytics for state-of-charge, state-of-health, thermal events, and grid dispatch. Terraform stands up the data plane that watches every cell.

This guide shows how to provision a sodium-ion battery analytics backend on AWS.

Architecture

#
LayerAWS service
BMS telemetry ingestIoT Core + Kinesis Firehose
Time-series storageTimestream
Manufacturing dataRDS Postgres
DashboardsManaged Grafana
Anomaly detectionLookout for Equipment / SageMaker
Cold archiveS3 Glacier Instant Retrieval

Telemetry Ingestion

#
resource "aws_iot_topic_rule" "bms" {
  name        = "naion_bms_to_firehose"
  enabled     = true
  sql         = "SELECT *, topic(2) AS pack_id, timestamp() AS ts_ms FROM 'packs/+/bms'"
  sql_version = "2016-03-23"
 
  firehose {
    role_arn       = aws_iam_role.iot_to_firehose.arn
    delivery_stream_name = aws_kinesis_firehose_delivery_stream.bms.name
    separator      = "\n"
  }
}
 
resource "aws_kinesis_firehose_delivery_stream" "bms" {
  name        = "naion-bms"
  destination = "extended_s3"
 
  extended_s3_configuration {
    role_arn   = aws_iam_role.firehose.arn
    bucket_arn = aws_s3_bucket.bms_lake.arn
    prefix     = "bms/y=!{timestamp:yyyy}/m=!{timestamp:MM}/d=!{timestamp:dd}/"
    error_output_prefix = "errors/"
    buffering_size     = 64
    buffering_interval = 60
    compression_format = "GZIP"
  }
}

Time-Series Storage

#
resource "aws_timestreamwrite_database" "naion" {
  database_name = "naion"
}
 
resource "aws_timestreamwrite_table" "cells" {
  database_name = aws_timestreamwrite_database.naion.database_name
  table_name    = "cell_metrics"
 
  retention_properties {
    memory_store_retention_period_in_hours  = 168   # 7 days hot
    magnetic_store_retention_period_in_days = 1825  # 5 years magnetic
  }
 
  magnetic_store_write_properties {
    enable_magnetic_store_writes = true
  }
}

Anomaly Detection (Thermal Runaway Early Warning)

#
resource "aws_lookoutequipment_dataset" "thermal" {
  dataset_name = "naion-thermal"
  dataset_schema {
    inline_data_schema = jsonencode({
      Components = [{
        ComponentName = "pack"
        Columns = [
          { Name = "Timestamp",    Type = "DATETIME" },
          { Name = "cell_temp_c",  Type = "DOUBLE"   },
          { Name = "cell_voltage", Type = "DOUBLE"   },
          { Name = "current_a",    Type = "DOUBLE"   }
        ]
      }]
    })
  }
}

Grafana Dashboards

#
resource "aws_grafana_workspace" "naion" {
  account_access_type      = "CURRENT_ACCOUNT"
  authentication_providers = ["AWS_SSO"]
  permission_type          = "SERVICE_MANAGED"
  data_sources             = ["TIMESTREAM", "CLOUDWATCH"]
  role_arn                 = aws_iam_role.grafana.arn
}

Best Practices

#
  • Tag every measurement with pack_id, cell_id, chemistry=naion, firmware for fleet slicing.
  • Tier hot vs magnetic in Timestream so a 5-year warranty window doesn't bankrupt you.
  • Trigger alerts on dT/dt, not absolute temperature — early-warning of thermal events lives in the derivative.
  • Replay historical packs from S3 into a sandbox Timestream table when validating new alarm thresholds.
#
#Terraform#Energy#AWS#IoT#Analytics

Share this article