How aembit/terraform-aembit-ecs works
Project type and purpose
• This is a Terraform “module” (infrastructure-as-code) whose sole purpose is to deploy and configure the Aembit Edge components into an existing AWS ECS Fargate environment.
• From the README, it:
– Creates an ECS Fargate Service running the Aembit AgentController
– Publishes a private DNS entry via AWS Cloud Map for service discovery
– Emits logs to an optional CloudWatch Log Group
– Exposes outputs (HTTP/HTTPS proxy endpoints and container definitions) for client workloads to consume
File structure
• Top-level files are standard Terraform:
– main.tf – resource definitions (ECS Service, Cloud Map, CloudWatch)
– variables.tf – input variables (tenant ID, VPC details, subnets, security groups, images, etc.)
– outputs.tf – exports the agent_proxy_container JSON and proxy endpoint URLs
– versions.tf – providers and Terraform version constraints
• No application code: this is purely an AWS-focused infra module
Key insights from README
• Prereqs: existing ECS cluster, VPC, subnets, security groups, and client workloads
• Usage pattern:
1) Call the module with your environment details
2) Inject the provided “agent_proxy_container” definition into your client ECS Task
3) Wire up http(s)_proxy environment variables
• AWS resources created: ECS Service & Task Definition, Cloud Map namespace & record, optional CloudWatch Group
1) Terraform module (local code)
2) AWS Control Plane (Terraform AWS Provider)
3) AWS ECS Cluster (existing)
4) Aembit AgentController Service (Fargate)
5) Route 53 Private DNS Namespace & Record (AWS Cloud Map)
6) AWS CloudWatch Log Group (optional)
7) Client Workload Tasks (existing ECS tasks with injected AgentProxy sidecar)
8) Aembit Cloud Service (external SaaS endpoint)
• Terraform → AWS Control Plane: “apply” operations
• AWS Control Plane → ECS Cluster: “create” AgentController Fargate service & task
• ECS AgentController ↔ Cloud Map: “register” DNS name under private namespace
• Client Workloads (AgentProxy container) → AgentController: HTTP(S) traffic via private DNS (aembit.local)
• AgentController → Aembit Cloud Service: HTTPS registration & heartbeats
• AgentController & AgentProxy → CloudWatch Logs: “push logs”
c. Architectural patterns / principles:
• Infrastructure as Code (modular Terraform)
• Sidecar proxy pattern (AgentProxy injected into every client task)
• Service discovery via AWS Cloud Map / Private DNS
• Strict network segmentation (VPC, subnets, SGs)
• Separation of concerns: controller (central multi-tenant service) vs. proxy (per-task)
d. Key technologies / frameworks / libraries:
• Terraform (HCL)
• AWS ECS on Fargate
• AWS Cloud Map (Route 53 private hosted zone)
• AWS CloudWatch Logs
• IAM (task roles / execution roles)