TerraformPilot

DevOps

Terraform for KaiOS Feature-Phone App Backends

Provision KaiOS feature-phone app backends with Terraform: low-bandwidth APIs, JioPhone-style markets, and minimal-footprint cloud delivery.

LLuca Berton1 min read

KaiOS powers feature phones (most famously JioPhone) — gigantic install base in India, Africa, Latin America. App backends must be tiny, slow-network friendly, and offline-tolerant. Terraform owns the cloud side: small REST APIs, aggressive caching, minimal payloads.

Quick Pattern (TL;DR)

#
resource "aws_apigatewayv2_api" "kaios" {
  name          = "kaios-api"
  protocol_type = "HTTP"
  description   = "KaiOS feature-phone backend, low-bandwidth"
}
 
resource "aws_lambda_function" "kaios" {
  function_name = "kaios-api"
  role          = aws_iam_role.lambda.arn
  package_type  = "Image"
  image_uri     = "${aws_ecr_repository.kaios.repository_url}:${var.tag}"
  timeout       = 10
  memory_size   = 256
}

CloudFront with Brotli

#
resource "aws_cloudfront_distribution" "kaios" {
  enabled         = true
  is_ipv6_enabled = false # KaiOS ipv6 is spotty
  http_version    = "http2"
 
  origin {
    domain_name = "${aws_apigatewayv2_api.kaios.id}.execute-api.${var.region}.amazonaws.com"
    origin_id   = "api"
    custom_origin_config {
      http_port              = 80
      https_port             = 443
      origin_protocol_policy = "https-only"
      origin_ssl_protocols   = ["TLSv1.2"]
    }
  }
 
  default_cache_behavior {
    target_origin_id       = "api"
    viewer_protocol_policy = "redirect-to-https"
    allowed_methods        = ["GET", "POST"]
    cached_methods         = ["GET", "HEAD"]
    cache_policy_id        = data.aws_cloudfront_cache_policy.optimized.id
    compress               = true
  }
 
  restrictions { geo_restriction { restriction_type = "none" } }
  viewer_certificate { cloudfront_default_certificate = true }
}

Edge Region Pinning to APAC

#

KaiOS users concentrate in India and Africa — pin the primary region accordingly:

provider "aws" {
  region = "ap-south-1"
}

Best Practices

#
  • Payloads under 4 KB wherever possible — feature phones throttle hard.
  • Brotli compression on CloudFront — better than gzip on small JSON.
  • No HTTP/3 in 2026 KaiOS browsers — stick to HTTP/2.
  • Image SVGs, not PNGs — tiny phones, tiny screens.
#
#Terraform#KaiOS#Feature Phone#JioPhone#Emerging Markets

Share this article