App Mesh Deployer
What this skill does
Provisions production-grade App Mesh service meshes with secure
defaults — mesh + egress filter, virtual nodes with service
discovery, virtual routers with weighted routes and retry/timeout
policies, virtual gateways for ingress, mTLS for east-west traffic,
and Envoy sidecar injection via Cloud Map. Runs deterministic
pre-checks (Cloud Map namespace exists, mTLS ACM Private CA issued,
IAM appmesh:Create* granted, EKS namespace labeled for injection)
and emits the exact appmesh create-* CLI sequence behind a
CONFIRM gate.
Mindset
One-line takeaway: an App Mesh service mesh is not "Envoy
sidecars for free" — it is a per-mesh policy boundary where the
egress filter, mTLS posture, and route-level retry/timeout policies
determine the blast radius of a downstream failure. Weighted routing
is the most visible feature; egress control, mTLS, and circuit
breaking determine resilience.
Three facts make App Mesh provisioning different from "roll out
Envoy":
The mesh has an egress filter; the default is DROP_ALL.
egress_filter: DROP_ALL blocks all egress traffic from mesh
members to non-mesh destinations unless explicitly added as a
virtual service backend. Operators frequently set ALLOW_ALL to
"make it work" then forget to tighten — exposing a permissive
egress posture. Production meshes should use DROP_ALL with
explicit virtual services for external dependencies.
Virtual nodes are NOT workloads; they are service-discovery
endpoints. A virtual node binds to a Cloud Map service or DNS
hostname, plus a listener port/protocol. It does NOT deploy a
workload — the workload is the EC2/ECS/EKS task running the Envoy
sidecar. Forgetting this is the #1 confusion: operators create
virtual nodes and expect traffic to flow without deploying Envoy.
Virtual gateway is the only ingress path from outside the mesh.
ALB → virtual gateway → mesh-internal services. ALB → virtual node
directly does NOT go through Envoy and bypasses all mesh policies
(retries, timeouts, mTLS). For public ingress that needs mesh
policies, use a virtual gateway.
Quick navigation
| Section |
What it covers |
When to read it |
| § Quick reference |
Deployment checklist + pre-flight spec gate |
Before any deployment |
| § Mindset |
Egress filter, virtual node != workload, virtual gateway |
Understanding the model |
| § Pre-flight |
Cloud Map / ACM / EKS namespace gate |
Before producing architecture |
| § Process |
Step-by-step deployment: mesh, nodes, routers, routes, gateway, mTLS, circuit breaking, sidecar |
When building the deploy plan |
| § Common patterns |
Boilerplate for mesh, canary route, virtual gateway, mTLS, circuit breaking, EKS injection |
Boilerplate lookup |
| § Output format |
Structured output template with VERDICT, ARCHITECTURE, CHECKLIST, FINDINGS, DEPLOY_COMMANDS |
Formatting the response |
| § Anti-Patterns |
NEVER list — common mistakes |
Review before risky operations |
Quick reference — deployment checklist
| Dimension |
Requirement |
Step |
| Mesh name |
Globally unique within the account+region |
Step 1 |
| Egress filter |
DROP_ALL (default, recommended) or ALLOW_ALL |
Step 1 |
| Cloud Map namespace |
HTTP or DNS namespace exists; virtual nodes reference a Cloud Map service |
Step 2 |
| Service discovery |
Virtual node specifies Cloud Map serviceName or DNS hostName |
Step 2 |
| Virtual node listener |
Protocol (http/tcp/grpc), port, optional mTLS |
Step 3 |
| Virtual node backends |
List of virtual services the node depends on |
Step 3 |
| Virtual router |
Protocol-matched to listener; listens on a port |
Step 4 |
| Route match |
HTTP prefix/method/headers, TCP no match, gRPC serviceName |
Step 5 |
| Route weighted targets |
Sum of weights = 100; targets are virtual nodes |
Step 5 |
| Retry policy |
HTTP retries on gateway errors; TCP no retry |
Step 5 |
| Timeout policy |
Per-route request timeout + idle timeout |
Step 5 |
| Virtual gateway |
Listens on a port; ALB/NLB in front |
Step 6 |
| Gateway route |
HTTP/gRPC match, weighted to virtual services |
Step 6 |
| mTLS |
ACM Private CA or self-signed; listener enforces |
Step 7 |
| Circuit breaking |
Connection pool + outlier detection on virtual node |
Step 8 |
| Sidecar injection |
EKS: App Mesh Controller + namespace label; ECS: Envoy container in task definition |
Step 9 |
| App Mesh Gateway Controller |
EKS CRD-based gateway route reconciliation |
Step 10 |
Pre-flight: deployment specification gate (run before architecture output)
Before producing the deployment plan, validate the input specification.
Several requirements block deployment — proceeding with an invalid
spec produces a non-functional or insecure mesh.
Full live-account pre-flight command listing moved to references/diagnostic-commands.md.
Load it before running pre-flight checks against a live account.
| Attribute |
Value |
Effect on plan |
| Mesh name |
Listed |
MUST be unique within account+region |
| Egress filter |
DROP_ALL |
Production recommended; requires explicit virtual services for external deps |
| Egress filter |
ALLOW_ALL |
Permissive — surface as INFO/security finding |
| Cloud Map namespace |
HTTP (CreateHttpNamespace) |
Service discovery via API calls; no DNS |
| Cloud Map namespace |
DNS (CreatePrivateDnsNamespace or CreatePublicDnsNamespace) |
Service discovery via DNS; recommended |
| Service discovery |
Cloud Map |
Recommended — App Mesh integrates natively |
| Service discovery |
DNS hostName |
Static; for non-Cloud Map workloads |
| mTLS requirement |
true |
MUST have ACM Private CA or self-signed cert; listener enforces |
| Ingress |
Virtual gateway |
ALB/NLB in front; gateway route weighted to virtual services |
| Compute |
EKS |
App Mesh Controller + namespace label for sidecar injection |
| Compute |
ECS |
Envoy container in task definition; APPMESH_RESOURCE_ARN env var |
| Compute |
EC2 |
Envoy binary + APPMESH_RESOURCE_ARN env var |
If the deployment spec is incomplete (missing mesh name, no service
discovery, no virtual node listener, no route match), output:
VERDICT: PREREQUISITES_MISSING
FINDINGS:
- [BLOCKER] <missing field> required for deployment
Do NOT proceed to architecture output.
Process — deployment planning (apply in order)
Step 0: Expert knowledge — non-obvious App Mesh behaviors
Step 0 deep-dive detail moved to references/advanced-patterns.md.
Load it before producing the deployment plan or when mesh behavior seems non-obvious.
Step 1: Pre-check gate — PREREQUISITES_MISSING if any check fails
Run ALL pre-checks. If ANY fails, verdict is PREREQUISITES_MISSING
with failures in FINDINGS. Do NOT emit DEPLOY_COMMANDS.
For ALL deployments:
- Mesh name unique within account+region.
- IAM role holds
appmesh:CreateMesh and downstream create
permissions.
- Cloud Map namespace exists (or
servicediscovery:CreateNamespace
is in the plan).
For virtual nodes:
4. Cloud Map service name matches the virtual node's
cloudMapServiceName.
5. Listener protocol + port specified (http/tcp/grpc, port
1-65535).
6. For mTLS: ACM Private CA ARN exists and is ACTIVE.
For routes:
4. Virtual router exists and listens on a port.
5. Route match valid for protocol (HTTP prefix/method/headers, gRPC
serviceName, TCP no match).
6. Weighted targets sum to 100 (canary) or 100/0 (blue/green).
7. Targets reference existing virtual nodes.
8. Retry policy httpRetryPolicy valid only for HTTP/gRPC.
9. Timeout policy per_request_timeout and idle_timeout both set
(or explicitly default).
For virtual gateway:
4. Listener port and protocol specified.
5. ALB/NLB listener forwards to gateway target group (the gateway's
Envoy pods).
6. Gateway route match valid for protocol.
For mTLS:
4. ACM Private CA ARN exists and Status: ACTIVE.
5. Listener tls block specifies mode: STRICT or PERMISSIVE.
6. SDS (Secret Discovery Service) backend configured on Envoy.
For EKS sidecar injection:
4. App Mesh Controller installed in appmesh-system namespace.
5. Target namespace labeled
appmesh.k8s.aws/sidecarInjectorWebhook=enabled.
6. Pod annotations: appmesh.k8s.aws/meshName, appmesh.k8s.aws/virtualNode.
Step 2: READY_TO_DEPLOY — emit deployment plan
Emit VERDICT: READY_TO_DEPLOY with the exact CLI sequence +
CONFIRM gate:
- Ordered
aws appmesh create-* commands (mesh first, virtual nodes
before routers, routers before routes, virtual gateway before
gateway routes).
- Cloud Map service creation (if needed) before virtual nodes.
- EKS namespace labeling + controller installation notes.
- CONFIRM gate prompt.
Step 3: Execute behind CONFIRM gate
- MANDATORY CONFIRMATION GATE. Before any state-changing CLI
(
create-mesh, create-virtual-node, create-virtual-router,
create-route, create-virtual-gateway, create-gateway-route,
create-virtual-service, update-route, delete-route), emit
CONFIRM prompt.
- Mesh changes are not atomic — a partial deploy (mesh created,
virtual nodes failed) leaves the mesh in a partial state. Always
emit the full ordered command list so the operator can resume.
- For weighted-route changes (canary, blue/green), snapshot the
current route via
describe-route --output json before update;
there is no rollback, but the snapshot enables manual revert.
Step 4: Post-verification — COMPLETED-equivalent check
Verification command listing moved to references/diagnostic-commands.md.
Load it after the CONFIRM gate executes to verify the deployment.
Common patterns (boilerplate)
All boilerplate moved: mesh/node/router and sidecar/CRD examples to references/worked-examples.md; weighted-route and circuit-breaking examples to references/traffic-policy-and-resilience-guide.md; gateway and mTLS examples to references/virtual-gateway-and-mtls-guide.md.
Load the fitting reference when emitting DEPLOY_COMMANDS.
Output format (per deployment)
MESH_SPEC: <mesh-name>
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
ARCHITECTURE:
Mesh: <name>, egress_filter: DROP_ALL
Virtual nodes: <count>, with Cloud Map / DNS service discovery
Virtual routers: <count>, with weighted routes
Virtual gateway: <yes/no>, ALB listener port
mTLS: <STRICT|PERMISSIVE|disabled>, CA: <ACM PCA ARN>
Circuit breaking: <connection pool + outlier detection on/off>
Sidecar: <EKS controller injection | ECS task definition | EC2 binary>
CHECKLIST:
[x] Mesh egress filter DROP_ALL
[x] Cloud Map namespace exists
[x] Virtual nodes reference existing Cloud Map services
[x] Route weights sum to 100 (canary) or 100/0 (blue/green)
[x] Retry policy set for HTTP/gRPC routes
[x] Timeout policy per_request_timeout + idle_timeout both set
[x] Virtual gateway listener + ALB target group
[x] mTLS ACM Private CA ACTIVE
[x] Circuit breaking connection pool + outlier detection
[x] EKS namespace labeled for sidecar injection
FINDINGS:
- [INFO] Weighted route 90/10 — verify metrics before shifting to 100/0
- [WARN] Egress ALLOW_ALL — permissive posture
DEPLOY_COMMANDS:
1. <aws appmesh create-mesh ...>
2. <aws servicediscovery create-service ...>
3. <aws appmesh create-virtual-node ...>
4. <aws appmesh create-virtual-router ...>
5. <aws appmesh create-route ...>
...
Worked example — weighted canary (READY_TO_DEPLOY)
MESH_SPEC: prod-checkout-mesh
VERDICT: READY_TO_DEPLOY
ARCHITECTURE:
Mesh: prod-checkout-mesh, egress_filter: DROP_ALL
Virtual nodes: checkout-service-v1, checkout-service-v2
Virtual router: checkout-router on port 8080
Route: checkout-canary 90/10 (v1/v2)
Retry: gateway-error, 5xx, maxRetries 3, perRetry 2s
Timeout: request 5s, idle 300s
mTLS: disabled (INFO — surface for east-west security review)
Sidecar: EKS controller injection on namespace prod
CHECKLIST:
[x] Mesh egress filter DROP_ALL
[x] Cloud Map namespace prod-internal exists (ID: ns-abc123)
[x] Virtual nodes reference cloudMap serviceName checkout-v1, checkout-v2
[x] Route weights sum to 100 (90 + 10)
[x] Retry policy set (gateway-error, 5xx, 3 retries, 2s perRetry)
[x] Timeout policy request 5s, idle 300s
[x] EKS namespace prod labeled appmesh.k8s.aws/sidecarInjectorWebhook=enabled
FINDINGS:
- [INFO] Canary 10% — monitor 5xx rate for 30 min before shifting to 100/0
- [INFO] No mTLS — east-west traffic is plaintext; consider ACM Private CA
- [WARN] No circuit breaking configured — slow downstream can exhaust pool
DEPLOY_COMMANDS:
1. aws appmesh create-mesh --mesh-name prod-checkout-mesh --spec '{"egressFilter":{"type":"DROP_ALL"}}'
2. aws servicediscovery create-service --name checkout-v1 --namespace-id ns-abc123 --dns-config '{"NamespaceId":"ns-abc123","DnsConfig":{"RoutingPolicy":"WEIGHTED","DnsRecords":[{"Type":"A","TTL":60}]}}'
3. aws appmesh create-virtual-node --mesh-name prod-checkout-mesh --virtual-node-name checkout-service-v1 --spec '<full spec>'
4. aws appmesh create-virtual-node --mesh-name prod-checkout-mesh --virtual-node-name checkout-service-v2 --spec '<full spec>'
5. aws appmesh create-virtual-router --mesh-name prod-checkout-mesh --virtual-router-name checkout-router --spec '{"listeners":[{"portMapping":{"port":8080,"protocol":"http"}}]}'
6. aws appmesh create-route --mesh-name prod-checkout-mesh --virtual-router-name checkout-router --route-name checkout-canary --spec '<full canary spec>'
Worked example — mTLS missing CA (PREREQUISITES_MISSING)
Full example moved to references/worked-examples.md.
Load it when pre-checks fail and the verdict is PREREQUISITES_MISSING.
STRICT output contract
Required output structure
Every response MUST begin with this block — no preamble, no
conversational opening:
MESH_SPEC: <mesh-name>
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
ARCHITECTURE:
Mesh / Egress / Virtual nodes / Routers / Routes / Gateway / mTLS / Circuit breaking / Sidecar
CHECKLIST:
[x] <check description>
[ ] <check description (not yet passed)>
FINDINGS:
- [INFO | WARN | BLOCKER] <finding description>
DEPLOY_COMMANDS:
<ordered list of aws appmesh create-* commands>
FORBIDDEN output patterns
- NEVER start with conversational preamble ("Let me plan your mesh…") — the VERDICT block is the FIRST line, always. Use uppercase verdict values only (
READY_TO_DEPLOY, PREREQUISITES_MISSING).
- NEVER omit the CHECKLIST — every dimension (egress, Cloud Map, virtual nodes, routes, retry, timeout, gateway, mTLS, circuit breaking, sidecar) must appear with
[x] (passed) or [ ] (not passed) and a specific reason for each failure.
- NEVER propose
egress_filter: ALLOW_ALL for production without flagging it as a WARN finding and surfacing DROP_ALL as the recommended posture.
- NEVER list a CLI command with placeholder flags in a READY_TO_DEPLOY plan — every flag must be populated with actual values from the input spec.
- NEVER mix CLI and CRD-based gateway route management on the same mesh — pick one mechanism per mesh (CRD via App Mesh Gateway Controller, or direct CLI) and state the choice in FINDINGS.
Anti-Patterns — NEVER do these things
- NEVER set
egress_filter: ALLOW_ALL for production meshes without an explicit WARN finding. DROP_ALL is the secure default; ALLOW_ALL permits mesh members to reach any destination (including malicious endpoints) without inspection.
- NEVER confuse virtual nodes with workloads. Virtual nodes are service-discovery mappings; Envoy sidecars must be deployed separately (EKS controller injection, ECS task definition, EC2 binary). A mesh with virtual nodes but no Envoy sidecars routes no traffic.
- NEVER route ALB traffic directly to mesh member pods expecting mesh policies. Mesh policies (retry, timeout, mTLS) apply only to traffic flowing through Envoy. For ingress with mesh policies, use a virtual gateway as the ALB target.
- NEVER update a weighted route without snapshotting via
describe-route --output json. There is no rollback; the snapshot enables manual revert if the new weights produce errors.
- NEVER deploy mTLS in
STRICT mode without first running PERMISSIVE mode to confirm cert distribution via SDS. A misconfigured SDS backend causes STRICT mTLS to reject all connections, producing a complete outage.
Pre-flight safety checks
- MANDATORY CONFIRMATION GATE before any state-changing CLI.
- Snapshot before weighted-route update:
describe-route --output json > /tmp/<route>-backup-$(date +%s).json — there is no
rollback; the snapshot enables manual revert.
- Verify Cloud Map service health before shifting weight —
unhealthy endpoints in the Cloud Map service produce 503s under
the new weights.
- Canary before blue/green — shift to 90/10 (or 99/1) and
observe 5xx rate for 30 min before shifting to 100/0.
- Test mTLS in PERMISSIVE first — confirm cert distribution via
SDS before enforcing STRICT mode.
Expert heuristic: weighted routing strategy
CANARY (progressive)
├─ Low-risk change (config, copy, hotfix)
│ └─ 95/5 -> 90/10 -> 50/50 -> 0/100
│ • Observe 5xx rate at each stage for 15-30 min
│ • Rollback to previous weights if 5xx > threshold
├─ High-risk change (new dependency, schema migration)
│ └─ 99/1 -> 90/10 -> 50/50 -> 0/100
│ • Internal-test traffic first (1%)
│ • Observe for 60+ min at each stage
│ • Pair with circuit breaking (outlier detection) to
│ auto-eject unhealthy v2 endpoints
├─ Blue/Green (instant cutover)
│ └─ 100/0 -> 0/100
│ • Use for incompatible changes (API contract break)
│ • Snapshot weights before cutover for manual revert
│ • Cannot progressively observe — full blast
Per-protocol routing semantics:
| Protocol |
Match criteria |
Retry support |
Notes |
| HTTP |
prefix, method, headers (exact, prefix, regex) |
gateway-error, 5xx, reset, connect-failure, refused-stream, retriable-status-codes, retriable-headers |
Most flexible; default for REST services |
| gRPC |
serviceName, methodName |
cancelled, deadline-exceeded, internal, resource-exhausted, unavailable |
Required for gRPC services; HTTP match does not work |
| TCP |
None |
None |
Use only for non-L7 protocols (database connection pooling); no L7 routing |
Circuit breaker thresholds (starting points):
| Workload type |
maxConnections |
maxPendingRequests |
maxRequests |
maxRetries |
outlier maxServerErrors |
maxEjectionPercent |
| API frontend |
100 |
50 |
200 |
3 |
5 |
50 |
| API backend |
50 |
25 |
100 |
2 |
5 |
50 |
| Database proxy |
20 |
10 |
50 |
1 |
3 |
30 |
| Streaming / WebSocket |
1000 |
n/a |
n/a |
0 |
10 |
50 |
ALWAYS pair with the Cloud Map health check — outlier detection
supplements, not replaces, service-level health.
Recent AWS features (2024-2026)
Feature detail moved to references/advanced-patterns.md.
Load it when choosing CRD vs CLI management or planning controller/Envoy upgrades.
Domain
AWS CloudOps / App Mesh Service Mesh Provisioning.
AWS documentation
References (load on demand)
- references/worked-examples.md — secondary worked example (PREREQUISITES_MISSING) and common-pattern CLI boilerplate: mesh, virtual node, virtual router, EKS sidecar injection, Gateway Controller CRD
- references/diagnostic-commands.md — live-account pre-flight command listing and post-deployment verification commands (Step 4)
- references/advanced-patterns.md — Step 0 expert-knowledge deep dives and Recent AWS features (2024-2026)
- references/traffic-policy-and-resilience-guide.md — weighted canary route (with retry/timeout) and circuit-breaking CLI boilerplate
- references/virtual-gateway-and-mtls-guide.md — virtual gateway ingress and mTLS listener CLI boilerplate
1---2name: appmesh-deployer3description: Provisions production-grade AWS App Mesh service meshes — mesh with egress filter (DROP_ALL vs ALLOW_ALL), virtual nodes with Cloud Map or DNS service discovery, virtual routers with weighted routes (HTTP / TCP / gRPC), retry and timeout policies, virtual gateways for ingress (ALB/NLB → gateway → mesh), mutual TLS via ACM Private CA and SDS, circuit breaking (connection pool + outlier detection), Envoy sidecar injection (EKS App Mesh Controller, ECS task, EC2 binary), and latest features (App Mesh Gateway Controller for EKS via CRDs). Runs pre-checks (Cloud Map namespace exists, ACM Private CA ACTIVE, IAM appmesh:Create* granted, EKS namespace labeled) and emits the exact appmesh create-mesh / create-virtual-node / create-route / create-virtual-gateway CLI behind a CONFIRM gate. Emits a verdict (READY_TO_DEPLOY | PREREQUISITES_MISSING). Use when provisioning a mesh, configuring canary routing, exposing services via a virtual gateway, hardening east-west with mTLS, or adopting the Gateway Controller.4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline architecture planning. Live deployment uses aws appmesh create-mesh, create-virtual-node, create-virtual-router, create-route, create-virtual-gateway, create-gateway-route, create-virtual-service, describe-mesh, list-meshes, list-virtual-nodes, list-virtual-routers, list-routes, servicediscovery create-service, create-http-namespace, acm-pca create-certificate-authority (AWS CLI...6metadata:7 source: https://skillmd.com/skills/jhkchan/appmesh-deployer8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '1'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Networking15 task_type: deploy16 skill_class: capability17 lifecycle_status: active18 verdict_shape: READY_TO_DEPLOY | PREREQUISITES_MISSING19 when_to_use: Provisioning a new App Mesh service mesh, configuring virtual nodes with service discovery, authoring virtual routers with weighted/canary/blue-green routes, exposing services outside the mesh via a virtual gateway, hardening east-west traffic with mutual TLS, designing retry/timeout/circuit-breaker policies, or adopting the App Mesh Gateway Controller for EKS.20 activation_triggers: create App Mesh, deploy service mesh, App Mesh virtual node, App Mesh virtual router, App Mesh weighted routing, App Mesh canary deployment, App Mesh blue/green, App Mesh virtual gateway, App Mesh ingress, App Mesh mutual TLS, App Mesh mTLS, App Mesh retry policy, App Mesh timeout policy, App Mesh circuit breaker, Envoy sidecar injection, App Mesh Cloud Map, App Mesh Controller EKS, App Mesh Gateway Controller21 invocation_schema: 'Input shape (one of): (a) a deployment specification including mesh name, egress filter, virtual nodes (with service discovery backend), virtual routers with routes (HTTP/TCP/gRPC match, weighted targets, retry/timeout), optional virtual gateway (with ingress listeners), optional mTLS configuration, and optional EKS namespace mapping; (b) a partial spec for interactive refinement (e.g., "App Mesh with weighted routing between two versions of the checkout service"); (c) an existing mesh name for architecture review against the well-architected checklist. Output shape: { MESH_SPEC, VERDICT, ARCHITECTURE, CHECKLIST[], FINDINGS[], DEPLOY_COMMANDS } where VERDICT ∈ { READY_TO_DEPLOY, PREREQUISITES_MISSING, ERROR }.'22 version: 0.1.023 author: Jacky Chan — AWS Community Builder24 keywords: AWS App Mesh, service mesh, Envoy, virtual node, virtual router, virtual service, virtual gateway, gateway route, weighted routing, blue/green, canary, http route, tcp route, grpc route, retry policy, timeout policy, circuit breaking, outlier detection, connection pool, mutual TLS, mTLS, ACM Private CA, Cloud Map, service discovery, sidecar injection, egress filter, App Mesh Controller, EKS, App Mesh Gateway Controller, ingress25 tags: appmesh, networking, deploy, service-mesh, envoy, weighted-routing, virtual-gateway, mtls, cloud-map, circuit-breaking, eks, grpc26---2728# App Mesh Deployer2930## What this skill does3132Provisions production-grade App Mesh service meshes with secure33defaults — mesh + egress filter, virtual nodes with service34discovery, virtual routers with weighted routes and retry/timeout35policies, virtual gateways for ingress, mTLS for east-west traffic,36and Envoy sidecar injection via Cloud Map. Runs deterministic37pre-checks (Cloud Map namespace exists, mTLS ACM Private CA issued,38IAM `appmesh:Create*` granted, EKS namespace labeled for injection)39and emits the exact `appmesh create-*` CLI sequence behind a40CONFIRM gate.4142## Mindset4344**One-line takeaway:** an App Mesh service mesh is not "Envoy45sidecars for free" — it is a **per-mesh policy boundary** where the46egress filter, mTLS posture, and route-level retry/timeout policies47determine the blast radius of a downstream failure. Weighted routing48is the most visible feature; **egress control, mTLS, and circuit49breaking** determine resilience.5051Three facts make App Mesh provisioning different from "roll out52Envoy":5354- **The mesh has an egress filter; the default is DROP_ALL.**55 `egress_filter: DROP_ALL` blocks all egress traffic from mesh56 members to non-mesh destinations unless explicitly added as a57 virtual service backend. Operators frequently set `ALLOW_ALL` to58 "make it work" then forget to tighten — exposing a permissive59 egress posture. Production meshes should use DROP_ALL with60 explicit virtual services for external dependencies.6162- **Virtual nodes are NOT workloads; they are service-discovery63 endpoints.** A virtual node binds to a Cloud Map service or DNS64 hostname, plus a listener port/protocol. It does NOT deploy a65 workload — the workload is the EC2/ECS/EKS task running the Envoy66 sidecar. Forgetting this is the #1 confusion: operators create67 virtual nodes and expect traffic to flow without deploying Envoy.6869- **Virtual gateway is the only ingress path from outside the mesh.**70 ALB → virtual gateway → mesh-internal services. ALB → virtual node71 directly does NOT go through Envoy and bypasses all mesh policies72 (retries, timeouts, mTLS). For public ingress that needs mesh73 policies, use a virtual gateway.7475## Quick navigation7677| Section | What it covers | When to read it |78|---|---|---|79| **§ Quick reference** | Deployment checklist + pre-flight spec gate | Before any deployment |80| **§ Mindset** | Egress filter, virtual node != workload, virtual gateway | Understanding the model |81| **§ Pre-flight** | Cloud Map / ACM / EKS namespace gate | Before producing architecture |82| **§ Process** | Step-by-step deployment: mesh, nodes, routers, routes, gateway, mTLS, circuit breaking, sidecar | When building the deploy plan |83| **§ Common patterns** | Boilerplate for mesh, canary route, virtual gateway, mTLS, circuit breaking, EKS injection | Boilerplate lookup |84| **§ Output format** | Structured output template with VERDICT, ARCHITECTURE, CHECKLIST, FINDINGS, DEPLOY_COMMANDS | Formatting the response |85| **§ Anti-Patterns** | NEVER list — common mistakes | Review before risky operations |8687## Quick reference — deployment checklist8889| Dimension | Requirement | Step |90|---|---|---|91| Mesh name | Globally unique within the account+region | Step 1 |92| Egress filter | `DROP_ALL` (default, recommended) or `ALLOW_ALL` | Step 1 |93| Cloud Map namespace | HTTP or DNS namespace exists; virtual nodes reference a Cloud Map service | Step 2 |94| Service discovery | Virtual node specifies Cloud Map `serviceName` or DNS `hostName` | Step 2 |95| Virtual node listener | Protocol (http/tcp/grpc), port, optional mTLS | Step 3 |96| Virtual node backends | List of virtual services the node depends on | Step 3 |97| Virtual router | Protocol-matched to listener; listens on a port | Step 4 |98| Route match | HTTP `prefix`/`method`/`headers`, TCP no match, gRPC `serviceName` | Step 5 |99| Route weighted targets | Sum of weights = 100; targets are virtual nodes | Step 5 |100| Retry policy | HTTP retries on gateway errors; TCP no retry | Step 5 |101| Timeout policy | Per-route request timeout + idle timeout | Step 5 |102| Virtual gateway | Listens on a port; ALB/NLB in front | Step 6 |103| Gateway route | HTTP/gRPC match, weighted to virtual services | Step 6 |104| mTLS | ACM Private CA or self-signed; listener enforces | Step 7 |105| Circuit breaking | Connection pool + outlier detection on virtual node | Step 8 |106| Sidecar injection | EKS: App Mesh Controller + namespace label; ECS: Envoy container in task definition | Step 9 |107| App Mesh Gateway Controller | EKS CRD-based gateway route reconciliation | Step 10 |108109## Pre-flight: deployment specification gate (run before architecture output)110111Before producing the deployment plan, validate the input specification.112Several requirements **block deployment** — proceeding with an invalid113spec produces a non-functional or insecure mesh.114115Full live-account pre-flight command listing moved to [references/diagnostic-commands.md](references/diagnostic-commands.md).116Load it before running pre-flight checks against a live account.117118| Attribute | Value | Effect on plan |119|---|---|---|120| Mesh name | Listed | MUST be unique within account+region |121| Egress filter | `DROP_ALL` | Production recommended; requires explicit virtual services for external deps |122| Egress filter | `ALLOW_ALL` | Permissive — surface as INFO/security finding |123| Cloud Map namespace | HTTP (`CreateHttpNamespace`) | Service discovery via API calls; no DNS |124| Cloud Map namespace | DNS (`CreatePrivateDnsNamespace` or `CreatePublicDnsNamespace`) | Service discovery via DNS; recommended |125| Service discovery | Cloud Map | Recommended — App Mesh integrates natively |126| Service discovery | DNS `hostName` | Static; for non-Cloud Map workloads |127| mTLS requirement | true | MUST have ACM Private CA or self-signed cert; listener enforces |128| Ingress | Virtual gateway | ALB/NLB in front; gateway route weighted to virtual services |129| Compute | EKS | App Mesh Controller + namespace label for sidecar injection |130| Compute | ECS | Envoy container in task definition; `APPMESH_RESOURCE_ARN` env var |131| Compute | EC2 | Envoy binary + `APPMESH_RESOURCE_ARN` env var |132133**If the deployment spec is incomplete** (missing mesh name, no service134discovery, no virtual node listener, no route match), output:135136```text137VERDICT: PREREQUISITES_MISSING138FINDINGS:139 - [BLOCKER] <missing field> required for deployment140```141142Do NOT proceed to architecture output.143144## Process — deployment planning (apply in order)145146### Step 0: Expert knowledge — non-obvious App Mesh behaviors147Step 0 deep-dive detail moved to [references/advanced-patterns.md](references/advanced-patterns.md).148Load it before producing the deployment plan or when mesh behavior seems non-obvious.149150### Step 1: Pre-check gate — PREREQUISITES_MISSING if any check fails151152Run ALL pre-checks. If ANY fails, verdict is PREREQUISITES_MISSING153with failures in FINDINGS. Do NOT emit DEPLOY_COMMANDS.154155**For ALL deployments:**1561. Mesh name unique within account+region.1572. IAM role holds `appmesh:CreateMesh` and downstream create158 permissions.1593. Cloud Map namespace exists (or `servicediscovery:CreateNamespace`160 is in the plan).161162**For virtual nodes:**1634. Cloud Map service name matches the virtual node's164 `cloudMapServiceName`.1655. Listener protocol + port specified (`http`/`tcp`/`grpc`, port166 1-65535).1676. For mTLS: ACM Private CA ARN exists and is ACTIVE.168169**For routes:**1704. Virtual router exists and listens on a port.1715. Route match valid for protocol (HTTP prefix/method/headers, gRPC172 serviceName, TCP no match).1736. Weighted targets sum to 100 (canary) or 100/0 (blue/green).1747. Targets reference existing virtual nodes.1758. Retry policy `httpRetryPolicy` valid only for HTTP/gRPC.1769. Timeout policy `per_request_timeout` and `idle_timeout` both set177 (or explicitly default).178179**For virtual gateway:**1804. Listener port and protocol specified.1815. ALB/NLB listener forwards to gateway target group (the gateway's182 Envoy pods).1836. Gateway route match valid for protocol.184185**For mTLS:**1864. ACM Private CA ARN exists and `Status: ACTIVE`.1875. Listener `tls` block specifies `mode: STRICT` or `PERMISSIVE`.1886. SDS (Secret Discovery Service) backend configured on Envoy.189190**For EKS sidecar injection:**1914. App Mesh Controller installed in `appmesh-system` namespace.1925. Target namespace labeled193 `appmesh.k8s.aws/sidecarInjectorWebhook=enabled`.1946. Pod annotations: `appmesh.k8s.aws/meshName`, `appmesh.k8s.aws/virtualNode`.195196### Step 2: READY_TO_DEPLOY — emit deployment plan197198Emit `VERDICT: READY_TO_DEPLOY` with the exact CLI sequence +199CONFIRM gate:200- Ordered `aws appmesh create-*` commands (mesh first, virtual nodes201 before routers, routers before routes, virtual gateway before202 gateway routes).203- Cloud Map service creation (if needed) before virtual nodes.204- EKS namespace labeling + controller installation notes.205- CONFIRM gate prompt.206207### Step 3: Execute behind CONFIRM gate208209- **MANDATORY CONFIRMATION GATE.** Before any state-changing CLI210 (`create-mesh`, `create-virtual-node`, `create-virtual-router`,211 `create-route`, `create-virtual-gateway`, `create-gateway-route`,212 `create-virtual-service`, `update-route`, `delete-route`), emit213 CONFIRM prompt.214- Mesh changes are not atomic — a partial deploy (mesh created,215 virtual nodes failed) leaves the mesh in a partial state. Always216 emit the full ordered command list so the operator can resume.217- For weighted-route changes (canary, blue/green), snapshot the218 current route via `describe-route --output json` before update;219 there is no rollback, but the snapshot enables manual revert.220221### Step 4: Post-verification — COMPLETED-equivalent check222223Verification command listing moved to [references/diagnostic-commands.md](references/diagnostic-commands.md).224Load it after the CONFIRM gate executes to verify the deployment.225226## Common patterns (boilerplate)227228All boilerplate moved: mesh/node/router and sidecar/CRD examples to [references/worked-examples.md](references/worked-examples.md); weighted-route and circuit-breaking examples to [references/traffic-policy-and-resilience-guide.md](references/traffic-policy-and-resilience-guide.md); gateway and mTLS examples to [references/virtual-gateway-and-mtls-guide.md](references/virtual-gateway-and-mtls-guide.md).229Load the fitting reference when emitting DEPLOY_COMMANDS.230231## Output format (per deployment)232233```text234MESH_SPEC: <mesh-name>235VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING236ARCHITECTURE:237 Mesh: <name>, egress_filter: DROP_ALL238 Virtual nodes: <count>, with Cloud Map / DNS service discovery239 Virtual routers: <count>, with weighted routes240 Virtual gateway: <yes/no>, ALB listener port241 mTLS: <STRICT|PERMISSIVE|disabled>, CA: <ACM PCA ARN>242 Circuit breaking: <connection pool + outlier detection on/off>243 Sidecar: <EKS controller injection | ECS task definition | EC2 binary>244CHECKLIST:245 [x] Mesh egress filter DROP_ALL246 [x] Cloud Map namespace exists247 [x] Virtual nodes reference existing Cloud Map services248 [x] Route weights sum to 100 (canary) or 100/0 (blue/green)249 [x] Retry policy set for HTTP/gRPC routes250 [x] Timeout policy per_request_timeout + idle_timeout both set251 [x] Virtual gateway listener + ALB target group252 [x] mTLS ACM Private CA ACTIVE253 [x] Circuit breaking connection pool + outlier detection254 [x] EKS namespace labeled for sidecar injection255FINDINGS:256 - [INFO] Weighted route 90/10 — verify metrics before shifting to 100/0257 - [WARN] Egress ALLOW_ALL — permissive posture258DEPLOY_COMMANDS:259 1. <aws appmesh create-mesh ...>260 2. <aws servicediscovery create-service ...>261 3. <aws appmesh create-virtual-node ...>262 4. <aws appmesh create-virtual-router ...>263 5. <aws appmesh create-route ...>264 ...265```266267### Worked example — weighted canary (READY_TO_DEPLOY)268269```text270MESH_SPEC: prod-checkout-mesh271VERDICT: READY_TO_DEPLOY272ARCHITECTURE:273 Mesh: prod-checkout-mesh, egress_filter: DROP_ALL274 Virtual nodes: checkout-service-v1, checkout-service-v2275 Virtual router: checkout-router on port 8080276 Route: checkout-canary 90/10 (v1/v2)277 Retry: gateway-error, 5xx, maxRetries 3, perRetry 2s278 Timeout: request 5s, idle 300s279 mTLS: disabled (INFO — surface for east-west security review)280 Sidecar: EKS controller injection on namespace prod281CHECKLIST:282 [x] Mesh egress filter DROP_ALL283 [x] Cloud Map namespace prod-internal exists (ID: ns-abc123)284 [x] Virtual nodes reference cloudMap serviceName checkout-v1, checkout-v2285 [x] Route weights sum to 100 (90 + 10)286 [x] Retry policy set (gateway-error, 5xx, 3 retries, 2s perRetry)287 [x] Timeout policy request 5s, idle 300s288 [x] EKS namespace prod labeled appmesh.k8s.aws/sidecarInjectorWebhook=enabled289FINDINGS:290 - [INFO] Canary 10% — monitor 5xx rate for 30 min before shifting to 100/0291 - [INFO] No mTLS — east-west traffic is plaintext; consider ACM Private CA292 - [WARN] No circuit breaking configured — slow downstream can exhaust pool293DEPLOY_COMMANDS:294 1. aws appmesh create-mesh --mesh-name prod-checkout-mesh --spec '{"egressFilter":{"type":"DROP_ALL"}}'295 2. aws servicediscovery create-service --name checkout-v1 --namespace-id ns-abc123 --dns-config '{"NamespaceId":"ns-abc123","DnsConfig":{"RoutingPolicy":"WEIGHTED","DnsRecords":[{"Type":"A","TTL":60}]}}'296 3. aws appmesh create-virtual-node --mesh-name prod-checkout-mesh --virtual-node-name checkout-service-v1 --spec '<full spec>'297 4. aws appmesh create-virtual-node --mesh-name prod-checkout-mesh --virtual-node-name checkout-service-v2 --spec '<full spec>'298 5. aws appmesh create-virtual-router --mesh-name prod-checkout-mesh --virtual-router-name checkout-router --spec '{"listeners":[{"portMapping":{"port":8080,"protocol":"http"}}]}'299 6. aws appmesh create-route --mesh-name prod-checkout-mesh --virtual-router-name checkout-router --route-name checkout-canary --spec '<full canary spec>'300```301302### Worked example — mTLS missing CA (PREREQUISITES_MISSING)303304Full example moved to [references/worked-examples.md](references/worked-examples.md).305Load it when pre-checks fail and the verdict is PREREQUISITES_MISSING.306307## STRICT output contract308309### Required output structure310311Every response MUST begin with this block — no preamble, no312conversational opening:313314```text315MESH_SPEC: <mesh-name>316VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING317ARCHITECTURE:318 Mesh / Egress / Virtual nodes / Routers / Routes / Gateway / mTLS / Circuit breaking / Sidecar319CHECKLIST:320 [x] <check description>321 [ ] <check description (not yet passed)>322FINDINGS:323 - [INFO | WARN | BLOCKER] <finding description>324DEPLOY_COMMANDS:325 <ordered list of aws appmesh create-* commands>326```327328### FORBIDDEN output patterns329330- NEVER start with conversational preamble ("Let me plan your mesh…") — the VERDICT block is the FIRST line, always. Use uppercase verdict values only (`READY_TO_DEPLOY`, `PREREQUISITES_MISSING`).331- NEVER omit the CHECKLIST — every dimension (egress, Cloud Map, virtual nodes, routes, retry, timeout, gateway, mTLS, circuit breaking, sidecar) must appear with `[x]` (passed) or `[ ]` (not passed) and a specific reason for each failure.332- NEVER propose `egress_filter: ALLOW_ALL` for production without flagging it as a WARN finding and surfacing DROP_ALL as the recommended posture.333- NEVER list a CLI command with placeholder flags in a READY_TO_DEPLOY plan — every flag must be populated with actual values from the input spec.334- NEVER mix CLI and CRD-based gateway route management on the same mesh — pick one mechanism per mesh (CRD via App Mesh Gateway Controller, or direct CLI) and state the choice in FINDINGS.335336## Anti-Patterns — NEVER do these things337338- NEVER set `egress_filter: ALLOW_ALL` for production meshes without an explicit WARN finding. DROP_ALL is the secure default; ALLOW_ALL permits mesh members to reach any destination (including malicious endpoints) without inspection.339- NEVER confuse virtual nodes with workloads. Virtual nodes are service-discovery mappings; Envoy sidecars must be deployed separately (EKS controller injection, ECS task definition, EC2 binary). A mesh with virtual nodes but no Envoy sidecars routes no traffic.340- NEVER route ALB traffic directly to mesh member pods expecting mesh policies. Mesh policies (retry, timeout, mTLS) apply only to traffic flowing through Envoy. For ingress with mesh policies, use a virtual gateway as the ALB target.341- NEVER update a weighted route without snapshotting via `describe-route --output json`. There is no rollback; the snapshot enables manual revert if the new weights produce errors.342- NEVER deploy mTLS in `STRICT` mode without first running `PERMISSIVE` mode to confirm cert distribution via SDS. A misconfigured SDS backend causes STRICT mTLS to reject all connections, producing a complete outage.343344## Pre-flight safety checks345346- **MANDATORY CONFIRMATION GATE** before any state-changing CLI.347- **Snapshot before weighted-route update:** `describe-route --output348 json > /tmp/<route>-backup-$(date +%s).json` — there is no349 rollback; the snapshot enables manual revert.350- **Verify Cloud Map service health** before shifting weight —351 unhealthy endpoints in the Cloud Map service produce 503s under352 the new weights.353- **Canary before blue/green** — shift to 90/10 (or 99/1) and354 observe 5xx rate for 30 min before shifting to 100/0.355- **Test mTLS in PERMISSIVE first** — confirm cert distribution via356 SDS before enforcing STRICT mode.357358## Expert heuristic: weighted routing strategy359360```361CANARY (progressive)362 ├─ Low-risk change (config, copy, hotfix)363 │ └─ 95/5 -> 90/10 -> 50/50 -> 0/100364 │ • Observe 5xx rate at each stage for 15-30 min365 │ • Rollback to previous weights if 5xx > threshold366 ├─ High-risk change (new dependency, schema migration)367 │ └─ 99/1 -> 90/10 -> 50/50 -> 0/100368 │ • Internal-test traffic first (1%)369 │ • Observe for 60+ min at each stage370 │ • Pair with circuit breaking (outlier detection) to371 │ auto-eject unhealthy v2 endpoints372 ├─ Blue/Green (instant cutover)373 │ └─ 100/0 -> 0/100374 │ • Use for incompatible changes (API contract break)375 │ • Snapshot weights before cutover for manual revert376 │ • Cannot progressively observe — full blast377```378379**Per-protocol routing semantics:**380381| Protocol | Match criteria | Retry support | Notes |382|---|---|---|---|383| HTTP | `prefix`, `method`, `headers` (exact, prefix, regex) | gateway-error, 5xx, reset, connect-failure, refused-stream, retriable-status-codes, retriable-headers | Most flexible; default for REST services |384| gRPC | `serviceName`, `methodName` | cancelled, deadline-exceeded, internal, resource-exhausted, unavailable | Required for gRPC services; HTTP match does not work |385| TCP | None | None | Use only for non-L7 protocols (database connection pooling); no L7 routing |386387**Circuit breaker thresholds (starting points):**388389| Workload type | maxConnections | maxPendingRequests | maxRequests | maxRetries | outlier maxServerErrors | maxEjectionPercent |390|---|---|---|---|---|---|---|391| API frontend | 100 | 50 | 200 | 3 | 5 | 50 |392| API backend | 50 | 25 | 100 | 2 | 5 | 50 |393| Database proxy | 20 | 10 | 50 | 1 | 3 | 30 |394| Streaming / WebSocket | 1000 | n/a | n/a | 0 | 10 | 50 |395396ALWAYS pair with the Cloud Map health check — outlier detection397supplements, not replaces, service-level health.398399## Recent AWS features (2024-2026)400401Feature detail moved to [references/advanced-patterns.md](references/advanced-patterns.md).402Load it when choosing CRD vs CLI management or planning controller/Envoy upgrades.403404## Domain405406AWS CloudOps / App Mesh Service Mesh Provisioning.407408## AWS documentation409410- **AWS App Mesh User Guide** — https://docs.aws.amazon.com/app-mesh/latest/userguide/what-is-app-mesh.html411- **Virtual Nodes** — https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html412- **Virtual Routers and Routes** — https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_routers.html413- **Virtual Gateways** — https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_gateways.html414- **Mutual TLS** — https://docs.aws.amazon.com/app-mesh/latest/userguide/mutual-tls.html415- **Circuit Breaking** — https://docs.aws.amazon.com/app-mesh/latest/userguide/circuit-breaking.html416- **App Mesh and EKS** — https://docs.aws.amazon.com/app-mesh/latest/userguide/getting-started-eks.html417- **App Mesh Gateway Controller** — https://docs.aws.amazon.com/app-mesh/latest/userguide/gateway-controller.html418- **AWS App Mesh API Reference** — https://docs.aws.amazon.com/app-mesh/latest/APIReference/419- **AWS CLI appmesh reference** — https://docs.aws.amazon.com/cli/latest/reference/appmesh/420421## References (load on demand)422423- [references/worked-examples.md](references/worked-examples.md) — secondary worked example (PREREQUISITES_MISSING) and common-pattern CLI boilerplate: mesh, virtual node, virtual router, EKS sidecar injection, Gateway Controller CRD424- [references/diagnostic-commands.md](references/diagnostic-commands.md) — live-account pre-flight command listing and post-deployment verification commands (Step 4)425- [references/advanced-patterns.md](references/advanced-patterns.md) — Step 0 expert-knowledge deep dives and Recent AWS features (2024-2026)426- [references/traffic-policy-and-resilience-guide.md](references/traffic-policy-and-resilience-guide.md) — weighted canary route (with retry/timeout) and circuit-breaking CLI boilerplate427- [references/virtual-gateway-and-mtls-guide.md](references/virtual-gateway-and-mtls-guide.md) — virtual gateway ingress and mTLS listener CLI boilerplate