Modern AWS CDK v2 infrastructure for CloudTAK web interface and ETL services
The Team Awareness Kit (TAK) provides Fire, Emergency Management, and First Responders an operationally agnostic tool for improved situational awareness and a common operational picture.
CloudTAK provides a web-based interface for Team Awareness Kit (TAK) data with ETL (Extract, Transform, Load) capabilities for processing and visualizing situational awareness information. This repository deploys the CloudTAK infrastructure layer with containerized services, auto-scaling, and enterprise-grade security features.
It is specifically targeted at the deployment of TAK.NZ via a CI/CD pipeline with automated upstream synchronization from the dfpc-coe/CloudTAK repository.
Nevertheless others interested in deploying a similar infrastructure can do so by adapting the configuration items.
This CloudTAK infrastructure requires the base infrastructure layer. Layers can be deployed in multiple independent environments:
PRODUCTION ENVIRONMENT DEVELOPMENT ENVIRONMENT
Domain: tak.nz Domain: dev.tak.nz
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
β MediaInfra β β MediaInfra β
β CloudFormation Stack β β CloudFormation Stack β
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
β CloudTAK β β CloudTAK β
β CloudFormation Stack β β CloudFormation Stack β
β (This Repository) β β (This Repository) β
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
β TakInfra β β TakInfra β
β CloudFormation Stack β β CloudFormation Stack β
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
β AuthInfra β β AuthInfra β
β CloudFormation Stack β β CloudFormation Stack β
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
β BaseInfra β β BaseInfra β
β CloudFormation Stack β β CloudFormation Stack β
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
| Layer | Repository | Description |
|---|---|---|
| BaseInfra | base-infra |
Foundation: VPC, ECS, S3, KMS, ACM |
| AuthInfra | auth-infra |
SSO via Authentik, LDAP |
| TakInfra | tak-infra |
TAK Server |
| CloudTAK | CloudTAK (this repo) |
CloudTAK web interface and ETL |
| MediaInfra | media-infra |
Video Server based on Mediamtx |
Deployment Order: BaseInfra must be deployed first, followed by AuthInfra, then TakInfra, CloudTAK, and finally MediaInfra. Each layer imports outputs from the layer below via CloudFormation exports.
- AWS Account with configured credentials
- Base infrastructure stack (
TAK-<n>-BaseInfra) must be deployed first - Authentication infrastructure stack (
TAK-<n>-AuthInfra) must be deployed first - TAK server infrastructure stack (
TAK-<n>-TakInfra) must be deployed first - Public Route 53 hosted zone (e.g.,
tak.nz) - Node.js and npm installed
- For CI/CD deployment: See AWS & GitHub Setup Guide for multi-account OIDC configuration
# 1. Install dependencies
cd cdk && npm install
# 2. Bootstrap CDK (first time only)
npx cdk bootstrap --profile your-aws-profile
# 3. Deploy development environment
npm run deploy:dev
# 4. Deploy production environment
npm run deploy:prod- ECS Service - CloudTAK web application with configurable scaling
- ECS Tasks - ETL processing tasks (data, events, pmtiles)
- Application Load Balancer - HTTP/HTTPS traffic distribution with dual-stack IPv4/IPv6
- Target Groups - Health check and traffic routing
- API Gateway - PMTiles API endpoint with custom domain
- Aurora PostgreSQL - Serverless v2 (dev) or provisioned instances (prod) with encryption
- S3 Buckets - Asset storage and ALB access logs (imported from BaseInfra)
- ECR Repository - Container image storage (imported from BaseInfra)
- AWS Batch - Scalable ETL job processing for data, events, and pmtiles
- Lambda Functions - Event-driven processing for S3 notifications and image handling
- Secrets Manager - Application secrets and database credentials
- CloudWatch Alarms - SNS topics and alarms for Lambda function monitoring
- Security Groups - Fine-grained network access controls
- Route 53 Records - CloudTAK endpoint DNS management with dual-stack support
- KMS Encryption - Data encryption at rest and in transit (imported from BaseInfra)
- ACM Certificates - SSL certificate management (imported from BaseInfra)
This stack uses a hybrid Docker image strategy that supports both pre-built images from ECR and local Docker building for maximum flexibility.
- Strategy: See Docker Image Strategy Guide for details
- CI/CD Mode: Uses pre-built images for fast deployments (~8 minutes vs ~15 minutes)
- Development Mode: Builds images locally for flexible development
- Automatic Fallback: Seamlessly switches between modes based on context parameters
- CloudTAK API: Web interface and API services
- Events Task: Event processing container
- PMTiles Task: Tile generation container
- Data Task: Data processing container
- Configurable Sync: Weekly sync with upstream repository (configurable via SYNC_MODE)
- Sync Modes: Disabled, main branch, or latest version tag
- Branding Application: TAK.NZ customizations applied after sync
- Version Tagging: Git SHA and version-based image tags
- Authentik User Creation: Automatically creates CloudTAK admin user in Authentik
- SSO Integration: Integrates with AuthInfra layer for single sign-on
- Admin Email: Configurable admin email for user creation
| Environment | Stack Name | Description | Domain | CloudTAK Cost* | Complete Stack Cost** |
|---|---|---|---|---|---|
dev-test |
TAK-Dev-CloudTAK |
Cost-optimized development | map.dev.tak.nz |
~$45 | ~$200 |
prod |
TAK-Prod-CloudTAK |
Production-ready deployment | map.tak.nz |
~$180 | ~$650 |
*CloudTAK Infrastructure only, **Complete deployment (BaseInfra + AuthInfra + TakInfra + VideoInfra + CloudTAK)
Estimated AWS costs for ap-southeast-2, excluding data transfer and usage
# Development and Testing
npm run dev # Build and test
npm run test # Run tests
npm run test:coverage # Generate coverage report
npm run test:watch # Run tests in watch mode
# Environment-Specific Deployment
npm run deploy:dev # Deploy to dev-test
npm run deploy:prod # Deploy to production
npm run deploy:local:dev # Deploy dev with local Docker builds
npm run deploy:local:prod # Deploy prod with local Docker builds
npm run synth:dev # Preview dev infrastructure
npm run synth:prod # Preview prod infrastructure
# Infrastructure Management
npm run cdk:diff:dev # Show what would change in dev
npm run cdk:diff:prod # Show what would change in prod
npm run cdk:bootstrap # Bootstrap CDK in accountThe project uses AWS CDK context-based configuration for consistent deployments:
- All settings stored in
cdk/cdk.jsonundercontextsection - Version controlled - consistent deployments across team members
- Runtime overrides - use
--contextflag for one-off changes - Environment-specific - separate configs for dev-test and production
# Override CloudTAK hostname for deployment
npm run deploy:dev -- --context hostname=cloudtak
# Deploy with different resource allocation
npm run deploy:prod -- --context taskCpu=4096 --context taskMemory=8192
# Custom stack name
npm run deploy:dev -- --context stackName=Demo
# Use local Docker builds instead of pre-built images
npm run deploy:local:dev- π Deployment Guide - Comprehensive deployment instructions and configuration options
- ποΈ Architecture Guide - Technical architecture and design decisions
- βοΈ Configuration Guide - Complete configuration management reference
- π³ Docker Image Strategy - Hybrid image strategy for fast CI/CD and flexible development
- π§ Environment Variables - CloudTAK application configuration via environment variables
- π KMS Encryption - All data encrypted with customer-managed keys
- π‘οΈ Network Security - Private subnets with controlled internet access
- π IAM Policies - Least-privilege access patterns throughout
- π Container Security - Non-root containers with minimal privileges
- π Automated Updates - Weekly upstream sync with security patches
- Base Infrastructure - Ensure base infrastructure stack is deployed first
- Route53 Hosted Zone - Ensure your domain's hosted zone exists before deployment
- AWS Permissions - CDK requires broad permissions for CloudFormation operations
- Docker Issues - Ensure Docker is running for local development
- Upstream Conflicts - Use manual conflict resolution for complex merge conflicts
- AWS CDK Documentation - https://docs.aws.amazon.com/cdk/
- CloudTAK Upstream - https://github.com/dfpc-coe/CloudTAK
- TAK.NZ Project - https://github.com/TAK-NZ/
- Issue Tracking - Use GitHub Issues for bug reports and feature requests
- Fork Repository - Create your own fork for development
- Create Branch - Use feature branches for development
- Test Changes - Run tests and validate deployment
- Submit PR - Create pull request with detailed description
- Review Process - Code review and automated testing
- Bug Fixes - Submit to upstream dfpc-coe/CloudTAK repository
- TAK.NZ Specific - Keep customizations in this repository
- Documentation - Improve documentation for better maintainability