Technical demo for AWS Community Day Kenya 2026 for the session Calming the storm: Building Resilient IoT infrastrucure for precision agriculture in Kenya
# AwsIotAgriTech: Calming the Storm
Demonstration repository for the AWS Community Day Kenya 2026 session, "Calming the Storm: Building Resilient IoT Infrastructure for Precision Agriculture in Kenya."
- **Track:** Cloud Architecture & Infrastructure / Cloud for Impact
- **Level:** Intermediate/Advanced
## Demo Scenario
This repository demonstrates two architectural patterns for ingesting high-volume IoT data, simulating a real-world failure mode where thousands of offline sensors reconnect simultaneously and overwhelm a platform.
1. **Anti-Pattern:** Synchronous ingestion via API Gateway direct to a throttled Lambda, resulting in data loss.
2. **Resilient Pattern:** Asynchronous, event-driven ingestion using AWS IoT Core, Kinesis, and a batch-processing Lambda, which absorbs the data storm without issue.
## Quick Start
1. **Install Dependencies:**
```bash
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
```
2. **Configure AWS Environment:**
```bash
aws sts get-caller-identity
export AWS_DEFAULT_REGION=us-east-1
```
3. **Deploy CDK Stack:**
```bash
cdk bootstrap
cdk deploy AwsIotAgriTechStack --require-approval never
```
4. **Export Endpoints:**
```bash
export API_URL=$(aws cloudformation describe-stacks \
--stack-name AwsIotAgriTechStack \
--query "Stacks[0].Outputs[?OutputKey=='SyncApiUrl'].OutputValue" \
--output text)
export IOT_ENDPOINT="
$(aws iot describe-endpoint \
--endpoint-type iot:Data-ATS \
--query endpointAddress --output text)"
```
## Live Demonstration Steps
1. **Start the Live Dashboard:**
In a separate terminal, run the Streamlit dashboard to monitor the DynamoDB table in real-time.
```bash
streamlit run dashboard.py
```
2. **Test the Fragile (Synchronous) Endpoint:**
This k6 test will generate significant errors, and the dashboard count will not increase substantially, demonstrating data loss.
```bash
API_URL="$API_URL" k6 run load-tests/sync-test.js
```
3. **Test the Resilient (Asynchronous) Endp …