Deploying AgentMesh on Amazon Web Services using EKS, IAM, KMS, and CloudWatch.
See also: Kubernetes Guide for general K8s patterns, Azure and GCP for other clouds.
- Architecture Overview
- Prerequisites
- EKS Cluster Setup
- IAM Roles for Service Accounts
- Secrets Management with KMS
- Monitoring with CloudWatch
- High Availability Topology
- Network Security
- Common Patterns
┌─────────────────────────────────────────────────┐
│ AWS Region │
│ ┌───────────────────────────────────────────┐ │
│ │ VPC │ │
│ │ ┌─────────────┐ ┌─────────────────────┐│ │
│ │ │ EKS Cluster │ │ ElastiCache (Redis) ││ │
│ │ │ │ └─────────────────────┘│ │
│ │ │ ┌─────────┐ │ ┌─────────────────────┐│ │
│ │ │ │AgentMesh│ │ │ RDS (PostgreSQL) ││ │
│ │ │ │ Server │ │ └─────────────────────┘│ │
│ │ │ ├─────────┤ │ │ │
│ │ │ │AgentMesh│ │ ┌─────────────────────┐│ │
│ │ │ │ Sidecar │ │ │ AWS KMS ││ │
│ │ │ └─────────┘ │ └─────────────────────┘│ │
│ │ └─────────────┘ │ │
│ │ ┌─────────────────────┐│ │
│ │ │ CloudWatch ││ │
│ │ └─────────────────────┘│ │
│ └───────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
- AWS CLI v2 configured with appropriate credentials
- eksctl v0.160+ or Terraform for cluster provisioning
- kubectl configured for your EKS cluster
- Helm 3.x for chart-based deployment
eksctl create cluster \
--name agentmesh-prod \
--region us-east-1 \
--version 1.29 \
--nodegroup-name workers \
--node-type m5.large \
--nodes 3 \
--nodes-min 2 \
--nodes-max 5 \
--managed| Component | Instance Type | Min Nodes | Notes |
|---|---|---|---|
| AgentMesh Server | m5.large | 2 | CPU-bound trust scoring |
| AgentMesh Sidecar | Runs in agent pods | — | ~128 MB RAM per sidecar |
| Redis (ElastiCache) | cache.r6g.large | 2 | Multi-AZ for HA |
| PostgreSQL (RDS) | db.r6g.large | 2 | Multi-AZ with read replica |
Use IRSA (IAM Roles for Service Accounts) to grant AgentMesh pods fine-grained AWS permissions without static credentials.
eksctl utils associate-iam-oidc-provider \
--cluster agentmesh-prod \
--region us-east-1 \
--approve{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"kms:Decrypt",
"kms:Encrypt",
"kms:GenerateDataKey"
],
"Resource": "arn:aws:kms:us-east-1:ACCOUNT_ID:key/KEY_ID"
},
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "arn:aws:logs:us-east-1:ACCOUNT_ID:log-group:/agentmesh/*"
},
{
"Effect": "Allow",
"Action": [
"events:PutEvents"
],
"Resource": "arn:aws:events:us-east-1:ACCOUNT_ID:event-bus/agentmesh-audit"
}
]
}eksctl create iamserviceaccount \
--cluster agentmesh-prod \
--namespace agentmesh \
--name agentmesh-sa \
--attach-policy-arn arn:aws:iam::ACCOUNT_ID:policy/AgentMeshPolicy \
--approveserviceAccount:
create: false
name: agentmesh-saAgentMesh agent private keys should be encrypted at rest using AWS KMS envelope encryption.
# Create a KMS key for AgentMesh
aws kms create-key \
--description "AgentMesh agent key encryption" \
--key-usage ENCRYPT_DECRYPT \
--origin AWS_KMS
# Store encrypted key in Secrets Manager
aws secretsmanager create-secret \
--name agentmesh/agent-keys/agent-alpha \
--kms-key-id alias/agentmesh-keys \
--secret-string '{"private_key": "<base64-encoded-ed25519-key>"}'# SecretProviderClass for mounting KMS-encrypted secrets
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: agentmesh-secrets
namespace: agentmesh
spec:
provider: aws
parameters:
objects: |
- objectName: "agentmesh/agent-keys/agent-alpha"
objectType: "secretsmanager"Use the CloudWatch Agent or ADOT Collector to scrape AgentMesh Prometheus metrics and forward to CloudWatch.
| Metric | Source Port | CloudWatch Alarm |
|---|---|---|
agentmesh_trust_score |
9090 | Alarm when any agent drops below 300 |
agentmesh_policy_violations_total |
9090 | Alarm on > 10 violations/min |
agentmesh_anomaly_detections_total |
9090 | Alarm on any HIGH severity |
agentmesh_credential_rotations_total |
9090 | Alert if rotation fails |
agentmesh_handshake_duration_seconds |
9090 | Alarm if p99 > 500 ms |
Configure AgentMesh CloudEvents to forward audit events to EventBridge:
# AgentMesh config
audit:
export:
type: cloudevents
target: aws_eventbridge
event_bus: agentmesh-audit
region: us-east-1┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ AZ-1a │ │ AZ-1b │ │ AZ-1c │
│ │ │ │ │ │
│ AgentMesh │ │ AgentMesh │ │ AgentMesh │
│ Server (1) │ │ Server (1) │ │ Server (1) │
│ │ │ │ │ │
│ Redis Primary│ │ Redis Replica│ │ │
│ RDS Primary │ │ RDS Standby │ │ RDS Read │
└──────────────┘ └──────────────┘ └──────────────┘
- AgentMesh Server: Run ≥ 2 replicas across AZs with pod anti-affinity
- Redis: ElastiCache Multi-AZ with automatic failover
- PostgreSQL: RDS Multi-AZ with read replicas for audit queries
replicaCount: 3
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: topology.kubernetes.io/zone
labelSelector:
matchLabels:
app: agentmesh-server
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: "1"
memory: 1Gi- Place EKS nodes in private subnets with NAT Gateway for outbound
- Place RDS and ElastiCache in private subnets with no public access
- Use VPC endpoints for AWS service access (KMS, Secrets Manager, CloudWatch, EventBridge)
| Component | Inbound | Outbound |
|---|---|---|
| AgentMesh Server | 8080 (API), 9090 (metrics) from VPC | Redis 6379, RDS 5432, KMS/Secrets Manager endpoints |
| AgentMesh Sidecar | 8081 from localhost only | AgentMesh Server 8080 |
| Redis | 6379 from AgentMesh SG | — |
| RDS | 5432 from AgentMesh SG | — |
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: agentmesh-server
namespace: agentmesh
spec:
podSelector:
matchLabels:
app: agentmesh-server
policyTypes:
- Ingress
- Egress
ingress:
- from:
- namespaceSelector:
matchLabels:
agentmesh-access: "true"
ports:
- port: 8080
- port: 9090
egress:
- to:
- namespaceSelector: {}
ports:
- port: 6379
- port: 5432Use IRSA so AgentMesh pods authenticate to AWS services without static credentials. Map each agent identity to an IAM role for fine-grained access:
AgentMesh DID → K8s ServiceAccount → IAM Role (via IRSA)
- Agent private keys: AWS Secrets Manager + KMS envelope encryption + CSI driver mount
- Redis/RDS credentials: Secrets Manager with automatic rotation
- TLS certificates: ACM (AWS Certificate Manager) for external; SPIFFE for mesh-internal
- Use Spot instances for non-critical agent workloads
- Right-size ElastiCache and RDS based on agent count
- Use CloudWatch Logs Insights instead of full log retention for audit queries
See also: Azure Deployment · GCP Deployment · Kubernetes Guide