App Runner Service Deployer
An AWS CloudOps agent skill that deploys Amazon App Runner services with
correct production defaults. Emits a READY_TO_DEPLOY checklist verifying
every configuration item.
Quick navigation
| Need |
Section |
| What MUST be in the response |
"STRICT output contract" |
| Why the deployment order matters |
"Reasoning framework" |
| What to verify before deploying |
"Prerequisites" |
| The ordered deployment steps |
"Deployment procedure" |
| Common silent-failure pitfalls |
"NEVER" |
| Source-type decision matrix |
"Workload matrix" |
| 2024-2026 feature changes |
"Recent AWS features" |
| Deep CLI sequences |
references/cli-commands-and-iac.md |
| VPC, scaling, observability, full NEVER |
references/source-and-config-guide.md |
STRICT output contract
When this skill is invoked with an App Runner deployment request, the
agent MUST respond with the READY_TO_DEPLOY checklist defined in "Output
format" using the literal all-caps labels SERVICE:, VERDICT:,
CHECKLIST:, and VERIFICATION_COMMANDS:. Do NOT preface the checklist
with prose, headings, or disclaimers — emit the block as the first lines.
Required output structure
SERVICE: <service-name> — the App Runner service being deployed.
VERDICT: READY_TO_DEPLOY OR VERDICT: PREREQUISITES_MISSING.
CHECKLIST: followed by indented lines with status markers
([✓], [✗], [OPTIONAL], [INPUT NEEDED]).
VERIFICATION_COMMANDS: followed by indented aws apprunner ...
commands.
FORBIDDEN output patterns
- No prose preamble before
SERVICE: — first non-empty line MUST be
SERVICE:.
- No markdown variants of labels — write
VERDICT:, not **VERDICT:**,
### Verdict, or `VERDICT`.
- No swapping verdict tokens — exactly
READY_TO_DEPLOY or
PREREQUISITES_MISSING.
- No omitting
VERIFICATION_COMMANDS: — include even when
PREREQUISITES_MISSING.
- No extra sections after
VERIFICATION_COMMANDS: — the checklist
block is the entire response.
- No status marker drift — use only
[✓], [✗], [OPTIONAL],
[INPUT NEEDED].
Perfect example (copy the shape exactly)
SERVICE: checkout-api-prod
VERDICT: READY_TO_DEPLOY
CHECKLIST:
[✓] Source — ECR image 123456789012.dkr.ecr.us-east-1.amazonaws.com/checkout-api:2.1.0
[✓] Source type — ECR (image), access role arn:aws:iam::123456789012:role/AppRunnerECRAccess
[✓] Instance configuration — 1 vCPU / 2048 MB, port 8080
[✓] Environment variables — LOG_LEVEL=info, ENV=production (plaintext)
[✓] Secrets — DB_PASSWORD from secretsmanager:checkout/db, STRIPE_KEY from ssm:/checkout/stripe
[✓] Instance role — checkout-instance (DynamoDB + S3 scoped)
[✓] Auto-scaling — min 2 / max 10, concurrency 100
[✓] VPC connector — arn:aws:apprunner:us-east-1:123456789012:vpcconnector/checkout-vpc/abc (3 subnets, 2 SGs)
[✓] Health check — GET /healthz (HTTP 200), healthy threshold 3, interval 10s
[✓] Deployment trigger — automatic (push to ECR)
[✓] Observability — CloudWatch Logs /aws/apprunner/checkout-api-prod, retention 30 days, X-Ray tracing enabled
[OPTIONAL] Custom domain — checkout.example.com (managed TLS)
VERIFICATION_COMMANDS:
aws apprunner describe-service --service-arn arn:aws:apprunner:us-east-1:123456789012:service/checkout-api-prod/abc
aws apprunner describe-vpc-connector --vpc-connector-arn arn:aws:apprunner:us-east-1:123456789012:vpcconnector/checkout-vpc/abc
aws iam get-role --role-name AppRunnerECRAccess
aws logs describe-log-groups --log-group-name-prefix /aws/apprunner/checkout-api-prod
Reasoning framework (why the deployment order matters)
- Source FIRST — App Runner needs either an ECR image or a source
code repository. Without a valid source the create-service call fails
with
ServiceQuotaExceededException or InvalidRequestException.
- Access role for ECR (separate from instance role) — the App Runner
service assumes an access role to pull ECR images. This is NOT the
same as the instance role the application uses at runtime. Conflating
them is the #1 IAM mistake on App Runner.
- Instance configuration (CPU/memory) — App Runner enforces specific
CPU/memory combinations. The memory MUST be a multiple of the vCPU.
- VPC connector for private resources — if the app talks to RDS,
ElastiCache, or internal ALBs in private subnets, a VPC connector is
REQUIRED. Without it, DNS resolves but connections time out silently.
- Health check — App Runner probes the service on the configured
port and path. A mismatched path causes the service to stay in
CreateFailed or cycle through OperationInProgress indefinitely.
- Auto-scaling — provisioned concurrency is the ONLY latency
guarantee. Scale-to-zero saves cost but adds cold-start latency.
- Observability — App Runner streams logs to CloudWatch by default,
but the log group name is derived from the service name and is NOT
configurable. X-Ray tracing must be explicitly enabled.
Prerequisites (verify before deployment)
| Prerequisite |
Why it matters |
How to verify |
| ECR image (if ECR source) |
Must exist with valid tag. NEVER :latest. |
aws ecr describe-images --repository-name <repo> --image-ids imageTag=<tag> |
| ECR access role (if ECR source) |
Trust tasks.apprunner.amazonaws.com. ECR pull perms. |
aws iam get-role --role-name <access-role> |
| Source repo + connection (if code source) |
CodeConnection ARN for GitHub/GitLab/Bitbucket. |
aws codeconnections list-connections |
| Build runtime (if code source) |
Python 3 / Node.js / Java / Go / PHP / .NET supported. |
Check apprunner:BuildConfiguration Runtime in the create call. |
| Instance role (if app calls AWS services) |
Trust tasks.apprunner.amazonaws.com. Scope to resources. |
aws iam get-role --role-name <instance-role> |
| VPC connector (if private resources) |
Subnets + security groups for private VPC access. |
aws apprunner describe-vpc-connector --vpc-connector-arn <arn> |
| VPC ingress (if private endpoint) |
Optional: restrict service to private VPC clients only. |
aws apprunner describe-vpc-ingress-connection |
| Secrets ARNs (if secrets) |
Secrets Manager or SSM Parameter exists. |
aws secretsmanager describe-secret --secret-id <id> |
| KMS key (if encryption) |
App Runner uses AWS-owned key by default. CMK needs grant. |
aws kms describe-key --key-id <alias> |
| Custom domain (optional) |
Owned / verified in Route 53 or via certificate. |
aws apprunner describe-custom-domains --service-arn <arn> |
| App Runner service quota |
Default 25 services per region per account. |
aws service-quotas get-service-quota --service-code apprunner --quota-code L-DBB8PPEX |
Deployment procedure (apply in order)
Step 1: ECR access role (for ECR source — separate from instance role)
ECR access-role trust policy and managed-policy CLI moved verbatim to references/cli-commands-and-iac.md.
Load on demand when creating the access role; keep here: access role and instance role are NEVER the same role.
Step 2: Instance role (application runtime identity)
Instance-role creation CLI and workload permission table moved verbatim to references/cli-commands-and-iac.md.
Load on demand when scoping the application runtime identity.
Step 3: Instance configuration (CPU/memory combos)
App Runner enforces specific CPU/memory combinations. Any other combo
fails at create-service time.
| CPU (vCPU) |
Memory options (GB) |
| 1 (1024) |
2, 3, 4 |
| 2 (2048) |
4, 5, 6, 7, 8 |
| 4 (4096) |
8, 9, 10, ..., 16 |
CPU units: 1024 = 1 vCPU. Memory: 2048 = 2 GB. Memory MUST be >= 2x CPU.
| Workload |
CPU |
Memory |
Rationale |
| Lightweight API |
1 vCPU |
2 GB |
Low traffic, fast startup |
| Standard API |
2 vCPU |
4 GB |
Typical Node/Python API |
| Heavy API (ML inference) |
4 vCPU |
8-16 GB |
Parallel processing |
| Worker (queue consumer) |
1 vCPU |
2 GB |
I/O-bound |
| Java/JVM (Spring Boot) |
2 vCPU |
6-8 GB |
JVM heap; always >= 4 GB |
Step 4: VPC connector (private resources)
create-vpc-connector CLI and subnet/SG rules moved verbatim to references/cli-commands-and-iac.md.
Keep here: without a connector, DNS resolves but the TCP connection hangs silently — the #1 App Runner networking pitfall.
Step 5: Health check policy
Health-check JSON and threshold guidance moved verbatim to references/cli-commands-and-iac.md.
Load on demand when tuning probes; keep here: path MUST return HTTP 200 and unhealthyThreshold >= 3.
Step 6: Auto-scaling configuration
Auto-scaling CLI and parameter table moved verbatim to references/cli-commands-and-iac.md.
Load on demand when right-sizing min/max/concurrency; keep here: scaling is on concurrent requests, not CPU.
Step 7: Secrets (Secrets Manager / SSM Parameter Store)
RuntimeEnvironmentSecrets payload moved verbatim to references/cli-commands-and-iac.md.
Load on demand when wiring secrets; keep here: secrets are ARN references, never plaintext.
Step 8: Observability (CloudWatch Logs, X-Ray, Application Signals)
Log-group pre-creation and retention CLI moved verbatim to references/cli-commands-and-iac.md.
Load on demand when configuring observability; keep here: the log group name is NOT configurable.
Step 9: Custom domain (optional)
associate-custom-domain CLI moved verbatim to references/cli-commands-and-iac.md.
Load on demand when attaching a domain with managed TLS.
Step 10: Create the service
The full create-service payload moved verbatim to references/cli-commands-and-iac.md.
Load on demand when emitting the create-service call.
Step 11: Verification
aws apprunner describe-service --service-arn <arn>
aws apprunner describe-vpc-connector --vpc-connector-arn <vc-arn>
aws apprunner describe-observability-configuration --observability-configuration-arn <arn>
aws apprunner describe-auto-scaling-configuration --auto-scaling-configuration-arn <arn>
aws logs describe-log-groups --log-group-name-prefix /aws/apprunner/<service>
aws apprunner list-operations --service-arn <arn>
Latest App Runner features (2024-2026)
Latest App Runner features (2024-2026) moved verbatim to references/advanced-patterns.md.
Load on demand when using VPC ingress, ALB integration, ARM64/Graviton, or private worker mode.
Workload matrix
| Workload |
CPU / Memory |
VPC connector |
Health check |
Auto-scale |
Custom domain |
| Public API |
2 vCPU / 4 GB |
No |
GET /healthz |
min 2 / max 10 |
Yes |
| Internal API (private) |
1 vCPU / 2 GB |
Yes (RDS) |
GET /healthz |
min 2 / max 6 |
No (VPC ingress) |
| API with RDS |
2 vCPU / 4 GB |
Yes (REQUIRED) |
GET /healthz |
min 2 / max 10 |
Yes |
| Worker (queue consumer) |
1 vCPU / 2 GB |
Yes (SQS optional) |
TCP probe |
min 1 / max 4 |
No |
| ML inference |
4 vCPU / 16 GB |
No |
GET /healthz |
min 2 / max 6 |
Yes |
| Java/Spring Boot |
2 vCPU / 8 GB |
Yes (if RDS) |
GET /actuator/health |
min 2 / max 10 |
Yes |
| Private worker |
1 vCPU / 2 GB |
Yes (VPC ingress) |
TCP probe |
min 1 / max 3 |
No |
NEVER (top 5 — full list of 12 in references)
- NEVER use
:latest image tag in production. It is mutable — a new push
silently changes what runs. Pin to a version tag or SHA digest. #1
rollback-breaker. The App Runner service auto-deploys the new :latest
without warning if AutoDeploymentsEnabled=true.
- NEVER conflate the ECR access role and the instance role. The access
role pulls images (managed policy
AWSAppRunnerServicePolicyForECRAccess);
the instance role is the app's runtime identity. Combining produces
pull failures or least-privilege violations.
- NEVER deploy an App Runner service that connects to private VPC
resources (RDS, ElastiCache, internal ALBs) without a VPC connector.
The DNS resolves but the TCP connection hangs silently until timeout.
This is the #1 silent-failure pitfall.
- NEVER set
unhealthyThreshold < 3 on the health check. Transient
network blips cause spurious rollbacks. Production minimum is 3; the
default of 5 is safer.
- NEVER rely on the default auto-scaling configuration for production
user-facing services. The default
min-size=1 is a single point of
failure during an AZ outage. Set min-size >= 2 for HA.
Expert heuristic — choosing source type, sizing, and scaling
- Source type decision: ECR image for pre-built containers (fast
deploy, full control over build pipeline). Source code repository for
rapid prototyping and teams without a container build pipeline (App
Runner builds the image for you, but you give up build-time control).
- 60/70 rule: App Runner scales on concurrency, not CPU. Target
max-concurrency=100 for standard APIs, 50 for CPU-heavy. Monitor
p99 latency and adjust.
- Memory: 2x the working set. JVM app with 2 GB heap needs >= 4 GB.
Set
-XX:MaxRAMPercentage=75.
- VPC connector sizing: the connector uses a pool of ENIs. For
high-throughput services (thousands of concurrent DB connections),
create a dedicated connector rather than sharing one across services.
- Scale-to-zero: ONLY for dev/staging or non-user-facing batch. Cold
start is 30-60s. User-facing endpoints MUST have
min-size >= 1.
- Deployment trigger: automatic (
AutoDeploymentsEnabled=true) for
dev/staging. Manual (false + start-deployment) for production with
change-management compliance.
Pre-flight safety checks (run before any deployment CLI)
- Confirm ECR image exists — missing image causes
CreateFailed.
- Confirm access role exists and trusts
tasks.apprunner.amazonaws.com.
- Confirm instance role exists (if app calls AWS services).
- Confirm VPC connector exists (if private resources are involved).
- Confirm secrets ARNs resolve — missing secret causes
CreateFailed.
- Pre-create CloudWatch log group with retention (App Runner does NOT
auto-set retention; defaults to
Never Expire).
- For existing services, capture current config for rollback.
Full CLI sequences for all checks in references/source-and-config-guide.md.
Output format — MANDATORY literal labels
When invoked with a service deployment request, your ENTIRE response MUST
be the checklist block below. The labels are case-sensitive all-caps
keywords. Do NOT write a preamble. Start with SERVICE: and stop after
the VERIFICATION_COMMANDS: block.
SERVICE: <name>
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
CHECKLIST:
[✓] Source — ECR image <uri> | source code repo <url>
[✓] Source type — ECR (image) | CODE (source repo), access role <role-arn>
[✓] Instance configuration — <cpu> vCPU / <memory> MB, port <port>
[✓] Environment variables — <plaintext vars>
[✓] Secrets — <secret-names> from secretsmanager / ssm
[✓] Instance role — <instance-role> (<app-permissions>)
[✓] Auto-scaling — min <x> / max <y>, concurrency <n>
[✓] VPC connector — <vc-arn> (<subnet-count> subnets, <sg-count> SGs)
[✓] Health check — GET <path> (HTTP 200), healthy threshold <n>, interval <s>
[✓] Deployment trigger — automatic | manual
[✓] Observability — CloudWatch Logs /aws/apprunner/<name>, retention <days>, X-Ray tracing <enabled|disabled>
[OPTIONAL] Custom domain — <domain> (managed TLS)
VERIFICATION_COMMANDS:
aws apprunner describe-service --service-arn <arn>
aws apprunner describe-vpc-connector --vpc-connector-arn <vc-arn>
aws iam get-role --role-name <access-role>
aws logs describe-log-groups --log-group-name-prefix /aws/apprunner/<name>
Status marker semantics:
[✓] — applied and verified.
[✗] — NOT applied or misconfigured. Cite the gap.
[OPTIONAL] — recommended but not required.
[INPUT NEEDED] — prerequisite value missing; operator must provide.
PREREQUISITES_MISSING verdict: if any REQUIRED prerequisite is missing
(ECR access role, ECR image, VPC connector for private-resource workloads,
instance role for AWS-SDK-calling apps, secrets ARN for named secrets),
the verdict is PREREQUISITES_MISSING.
References (load on demand)
- references/cli-commands-and-iac.md — full copy-pasteable CLI sequence and IaC equivalents; now also holds the Step 1, 2, 4-10 command payloads moved from SKILL.md.
- references/source-and-config-guide.md — source type selection, VPC connector networking, auto-scaling tuning, health check policy, observability, full NEVER list, pre-flight safety CLI.
- references/advanced-patterns.md — Latest App Runner features (2024-2026) and edge-case handling moved from SKILL.md.
Domain
AWS CloudOps / App Runner Managed Container Compute Provisioning.
Edge-case handling
Edge-case catalog (cross-account ECR, connector sharing, private endpoint mode, slow-start JVM, build failures, auto-deploy surprises, log group naming) moved verbatim to references/advanced-patterns.md.
Load on demand when the deployment hits a non-standard path.
AWS documentation
References
references/cli-commands-and-iac.md — full copy-pasteable CLI command
sequence for all 11 deployment steps, including access role and
instance role creation, VPC connector creation, auto-scaling
configuration, service creation with health check and observability,
and Terraform / CloudFormation equivalents.
references/source-and-config-guide.md — deep reference on source
type selection (ECR vs code repository), VPC connector networking,
auto-scaling tuning, health check policy, observability configuration,
custom domain, full NEVER list, edge-case handling, and pre-flight
safety CLI.
1---2name: apprunner-service-deployer3description: 'Deploys AWS App Runner services with production-grade configuration: source selection (ECR image vs source code repository), right-sized compute (CPU/memory combos), instance config (port, env vars, secrets via Secrets Manager / SSM), auto-scaling (min/max instances, concurrency), VPC connector for private resources (RDS, ElastiCache), custom domain with managed TLS, observability (CloudWatch Logs, X-Ray tracing), deployment control (automatic vs manual), health check policy, and latest features (VPC ingress, ALB integration, ARM64/Graviton). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when creating a new App Runner service, deploying a container web app or API, validating an App Runner configuration, or generating deployment CLI and IaC templates. Triggers: App Runner, ECR source, source code repository, auto-scaling, VPC connector, custom domain, App Runner deploy.'4license: Apache-2.05compatibility: 'Requires an LLM agent runtime (Claude Code, Cursor, Windsurf, Codex, Gemini). For live deployment: AWS CLI v2 with apprunner, ecr, iam, ec2, servicediscovery, secretsmanager, ssm, logs, and route53 access. Works with Terraform aws_apprunner_* resources, CloudFormation AWS::AppRunner::* resources, and the AWS Console App Runner wizard.'6metadata:7 source: https://skillmd.com/skills/jhkchan/apprunner-service-deployer8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '1'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Compute15 task_type: deploy16 skill_class: capability17 lifecycle_status: active18 verdict_shape: READY_TO_DEPLOY | PREREQUISITES_MISSING19 version: 0.1.020 author: Jacky Chan — AWS Community Builder21 tags: aws, app-runner, apprunner, cloudops, deploy, containers, ecr, auto-scaling, vpc-connector22 dependencies: aws-orchestrator23 keywords: aws, app-runner, apprunner, cloudops, deploy, provisioning, containers, ecr, source-code, auto-scaling, vpc-connector, custom-domain, health-check, observability, xray24 when_to_use: Invoke when the user wants to create a new App Runner service, deploy a containerized web app or API to App Runner, validate an existing App Runner configuration against best practices, generate deployment CLI commands or IaC templates, or troubleshoot an App Runner deployment failure caused by missing prerequisites (ECR access role, VPC connector, instance role, encryption KMS key). Do NOT invoke for ECS Fargate (use ecs-fargate-deployer), Lambda (use lambda-function-deployer), or EC2-based deployments.25---2627# App Runner Service Deployer2829An AWS CloudOps agent skill that deploys Amazon App Runner services with30correct production defaults. Emits a READY_TO_DEPLOY checklist verifying31every configuration item.3233## Quick navigation3435| Need | Section |36|---|---|37| What MUST be in the response | "STRICT output contract" |38| Why the deployment order matters | "Reasoning framework" |39| What to verify before deploying | "Prerequisites" |40| The ordered deployment steps | "Deployment procedure" |41| Common silent-failure pitfalls | "NEVER" |42| Source-type decision matrix | "Workload matrix" |43| 2024-2026 feature changes | "Recent AWS features" |44| Deep CLI sequences | `references/cli-commands-and-iac.md` |45| VPC, scaling, observability, full NEVER | `references/source-and-config-guide.md` |4647## STRICT output contract4849When this skill is invoked with an App Runner deployment request, the50agent MUST respond with the READY_TO_DEPLOY checklist defined in "Output51format" using the literal all-caps labels `SERVICE:`, `VERDICT:`,52`CHECKLIST:`, and `VERIFICATION_COMMANDS:`. Do NOT preface the checklist53with prose, headings, or disclaimers — emit the block as the first lines.5455### Required output structure56571. `SERVICE: <service-name>` — the App Runner service being deployed.582. `VERDICT: READY_TO_DEPLOY` OR `VERDICT: PREREQUISITES_MISSING`.593. `CHECKLIST:` followed by indented lines with status markers60 (`[✓]`, `[✗]`, `[OPTIONAL]`, `[INPUT NEEDED]`).614. `VERIFICATION_COMMANDS:` followed by indented `aws apprunner ...`62 commands.6364### FORBIDDEN output patterns6566- **No prose preamble before `SERVICE:`** — first non-empty line MUST be67 `SERVICE:`.68- **No markdown variants of labels** — write `VERDICT:`, not `**VERDICT:**`,69 `### Verdict`, or `` `VERDICT` ``.70- **No swapping verdict tokens** — exactly `READY_TO_DEPLOY` or71 `PREREQUISITES_MISSING`.72- **No omitting `VERIFICATION_COMMANDS:`** — include even when73 PREREQUISITES_MISSING.74- **No extra sections after `VERIFICATION_COMMANDS:`** — the checklist75 block is the entire response.76- **No status marker drift** — use only `[✓]`, `[✗]`, `[OPTIONAL]`,77 `[INPUT NEEDED]`.7879### Perfect example (copy the shape exactly)8081```text82SERVICE: checkout-api-prod83VERDICT: READY_TO_DEPLOY84CHECKLIST:85 [✓] Source — ECR image 123456789012.dkr.ecr.us-east-1.amazonaws.com/checkout-api:2.1.086 [✓] Source type — ECR (image), access role arn:aws:iam::123456789012:role/AppRunnerECRAccess87 [✓] Instance configuration — 1 vCPU / 2048 MB, port 808088 [✓] Environment variables — LOG_LEVEL=info, ENV=production (plaintext)89 [✓] Secrets — DB_PASSWORD from secretsmanager:checkout/db, STRIPE_KEY from ssm:/checkout/stripe90 [✓] Instance role — checkout-instance (DynamoDB + S3 scoped)91 [✓] Auto-scaling — min 2 / max 10, concurrency 10092 [✓] VPC connector — arn:aws:apprunner:us-east-1:123456789012:vpcconnector/checkout-vpc/abc (3 subnets, 2 SGs)93 [✓] Health check — GET /healthz (HTTP 200), healthy threshold 3, interval 10s94 [✓] Deployment trigger — automatic (push to ECR)95 [✓] Observability — CloudWatch Logs /aws/apprunner/checkout-api-prod, retention 30 days, X-Ray tracing enabled96 [OPTIONAL] Custom domain — checkout.example.com (managed TLS)97VERIFICATION_COMMANDS:98 aws apprunner describe-service --service-arn arn:aws:apprunner:us-east-1:123456789012:service/checkout-api-prod/abc99 aws apprunner describe-vpc-connector --vpc-connector-arn arn:aws:apprunner:us-east-1:123456789012:vpcconnector/checkout-vpc/abc100 aws iam get-role --role-name AppRunnerECRAccess101 aws logs describe-log-groups --log-group-name-prefix /aws/apprunner/checkout-api-prod102```103104## Reasoning framework (why the deployment order matters)1051061. **Source FIRST** — App Runner needs either an ECR image or a source107 code repository. Without a valid source the create-service call fails108 with `ServiceQuotaExceededException` or `InvalidRequestException`.1092. **Access role for ECR (separate from instance role)** — the App Runner110 service assumes an access role to pull ECR images. This is NOT the111 same as the instance role the application uses at runtime. Conflating112 them is the #1 IAM mistake on App Runner.1133. **Instance configuration (CPU/memory)** — App Runner enforces specific114 CPU/memory combinations. The memory MUST be a multiple of the vCPU.1154. **VPC connector for private resources** — if the app talks to RDS,116 ElastiCache, or internal ALBs in private subnets, a VPC connector is117 REQUIRED. Without it, DNS resolves but connections time out silently.1185. **Health check** — App Runner probes the service on the configured119 port and path. A mismatched path causes the service to stay in120 `CreateFailed` or cycle through `OperationInProgress` indefinitely.1216. **Auto-scaling** — provisioned concurrency is the ONLY latency122 guarantee. Scale-to-zero saves cost but adds cold-start latency.1237. **Observability** — App Runner streams logs to CloudWatch by default,124 but the log group name is derived from the service name and is NOT125 configurable. X-Ray tracing must be explicitly enabled.126127## Prerequisites (verify before deployment)128129| Prerequisite | Why it matters | How to verify |130|---|---|---|131| **ECR image (if ECR source)** | Must exist with valid tag. NEVER `:latest`. | `aws ecr describe-images --repository-name <repo> --image-ids imageTag=<tag>` |132| **ECR access role (if ECR source)** | Trust `tasks.apprunner.amazonaws.com`. ECR pull perms. | `aws iam get-role --role-name <access-role>` |133| **Source repo + connection (if code source)** | CodeConnection ARN for GitHub/GitLab/Bitbucket. | `aws codeconnections list-connections` |134| **Build runtime (if code source)** | Python 3 / Node.js / Java / Go / PHP / .NET supported. | Check `apprunner:BuildConfiguration Runtime` in the create call. |135| **Instance role (if app calls AWS services)** | Trust `tasks.apprunner.amazonaws.com`. Scope to resources. | `aws iam get-role --role-name <instance-role>` |136| **VPC connector (if private resources)** | Subnets + security groups for private VPC access. | `aws apprunner describe-vpc-connector --vpc-connector-arn <arn>` |137| **VPC ingress (if private endpoint)** | Optional: restrict service to private VPC clients only. | `aws apprunner describe-vpc-ingress-connection` |138| **Secrets ARNs (if secrets)** | Secrets Manager or SSM Parameter exists. | `aws secretsmanager describe-secret --secret-id <id>` |139| **KMS key (if encryption)** | App Runner uses AWS-owned key by default. CMK needs grant. | `aws kms describe-key --key-id <alias>` |140| **Custom domain (optional)** | Owned / verified in Route 53 or via certificate. | `aws apprunner describe-custom-domains --service-arn <arn>` |141| **App Runner service quota** | Default 25 services per region per account. | `aws service-quotas get-service-quota --service-code apprunner --quota-code L-DBB8PPEX` |142143## Deployment procedure (apply in order)144145### Step 1: ECR access role (for ECR source — separate from instance role)146147ECR access-role trust policy and managed-policy CLI moved verbatim to [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md).148Load on demand when creating the access role; keep here: access role and instance role are NEVER the same role.149150### Step 2: Instance role (application runtime identity)151152Instance-role creation CLI and workload permission table moved verbatim to [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md).153Load on demand when scoping the application runtime identity.154155### Step 3: Instance configuration (CPU/memory combos)156157App Runner enforces **specific CPU/memory combinations**. Any other combo158fails at create-service time.159160| CPU (vCPU) | Memory options (GB) |161|---|---|162| 1 (1024) | 2, 3, 4 |163| 2 (2048) | 4, 5, 6, 7, 8 |164| 4 (4096) | 8, 9, 10, ..., 16 |165166CPU units: 1024 = 1 vCPU. Memory: 2048 = 2 GB. Memory MUST be >= 2x CPU.167168| Workload | CPU | Memory | Rationale |169|---|---|---|---|170| Lightweight API | 1 vCPU | 2 GB | Low traffic, fast startup |171| Standard API | 2 vCPU | 4 GB | Typical Node/Python API |172| Heavy API (ML inference) | 4 vCPU | 8-16 GB | Parallel processing |173| Worker (queue consumer) | 1 vCPU | 2 GB | I/O-bound |174| Java/JVM (Spring Boot) | 2 vCPU | 6-8 GB | JVM heap; always >= 4 GB |175176### Step 4: VPC connector (private resources)177178create-vpc-connector CLI and subnet/SG rules moved verbatim to [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md).179Keep here: without a connector, DNS resolves but the TCP connection hangs silently — the #1 App Runner networking pitfall.180181### Step 5: Health check policy182183Health-check JSON and threshold guidance moved verbatim to [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md).184Load on demand when tuning probes; keep here: path MUST return HTTP 200 and unhealthyThreshold >= 3.185186### Step 6: Auto-scaling configuration187188Auto-scaling CLI and parameter table moved verbatim to [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md).189Load on demand when right-sizing min/max/concurrency; keep here: scaling is on concurrent requests, not CPU.190191### Step 7: Secrets (Secrets Manager / SSM Parameter Store)192193RuntimeEnvironmentSecrets payload moved verbatim to [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md).194Load on demand when wiring secrets; keep here: secrets are ARN references, never plaintext.195196### Step 8: Observability (CloudWatch Logs, X-Ray, Application Signals)197198Log-group pre-creation and retention CLI moved verbatim to [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md).199Load on demand when configuring observability; keep here: the log group name is NOT configurable.200201### Step 9: Custom domain (optional)202203associate-custom-domain CLI moved verbatim to [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md).204Load on demand when attaching a domain with managed TLS.205206### Step 10: Create the service207208The full create-service payload moved verbatim to [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md).209Load on demand when emitting the create-service call.210211### Step 11: Verification212213```bash214aws apprunner describe-service --service-arn <arn>215aws apprunner describe-vpc-connector --vpc-connector-arn <vc-arn>216aws apprunner describe-observability-configuration --observability-configuration-arn <arn>217aws apprunner describe-auto-scaling-configuration --auto-scaling-configuration-arn <arn>218aws logs describe-log-groups --log-group-name-prefix /aws/apprunner/<service>219aws apprunner list-operations --service-arn <arn>220```221222## Latest App Runner features (2024-2026)223224Latest App Runner features (2024-2026) moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md).225Load on demand when using VPC ingress, ALB integration, ARM64/Graviton, or private worker mode.226227## Workload matrix228229| Workload | CPU / Memory | VPC connector | Health check | Auto-scale | Custom domain |230|---|---|---|---|---|---|231| **Public API** | 2 vCPU / 4 GB | No | GET /healthz | min 2 / max 10 | Yes |232| **Internal API (private)** | 1 vCPU / 2 GB | Yes (RDS) | GET /healthz | min 2 / max 6 | No (VPC ingress) |233| **API with RDS** | 2 vCPU / 4 GB | Yes (REQUIRED) | GET /healthz | min 2 / max 10 | Yes |234| **Worker (queue consumer)** | 1 vCPU / 2 GB | Yes (SQS optional) | TCP probe | min 1 / max 4 | No |235| **ML inference** | 4 vCPU / 16 GB | No | GET /healthz | min 2 / max 6 | Yes |236| **Java/Spring Boot** | 2 vCPU / 8 GB | Yes (if RDS) | GET /actuator/health | min 2 / max 10 | Yes |237| **Private worker** | 1 vCPU / 2 GB | Yes (VPC ingress) | TCP probe | min 1 / max 3 | No |238239## NEVER (top 5 — full list of 12 in references)240241- NEVER use `:latest` image tag in production. It is mutable — a new push242 silently changes what runs. Pin to a version tag or SHA digest. #1243 rollback-breaker. The App Runner service auto-deploys the new `:latest`244 without warning if `AutoDeploymentsEnabled=true`.245- NEVER conflate the ECR access role and the instance role. The access246 role pulls images (managed policy `AWSAppRunnerServicePolicyForECRAccess`);247 the instance role is the app's runtime identity. Combining produces248 pull failures or least-privilege violations.249- NEVER deploy an App Runner service that connects to private VPC250 resources (RDS, ElastiCache, internal ALBs) without a VPC connector.251 The DNS resolves but the TCP connection hangs silently until timeout.252 This is the #1 silent-failure pitfall.253- NEVER set `unhealthyThreshold < 3` on the health check. Transient254 network blips cause spurious rollbacks. Production minimum is 3; the255 default of 5 is safer.256- NEVER rely on the default auto-scaling configuration for production257 user-facing services. The default `min-size=1` is a single point of258 failure during an AZ outage. Set `min-size >= 2` for HA.259260## Expert heuristic — choosing source type, sizing, and scaling261262- **Source type decision:** ECR image for pre-built containers (fast263 deploy, full control over build pipeline). Source code repository for264 rapid prototyping and teams without a container build pipeline (App265 Runner builds the image for you, but you give up build-time control).266- **60/70 rule:** App Runner scales on concurrency, not CPU. Target267 `max-concurrency=100` for standard APIs, `50` for CPU-heavy. Monitor268 p99 latency and adjust.269- **Memory: 2x the working set.** JVM app with 2 GB heap needs >= 4 GB.270 Set `-XX:MaxRAMPercentage=75`.271- **VPC connector sizing:** the connector uses a pool of ENIs. For272 high-throughput services (thousands of concurrent DB connections),273 create a dedicated connector rather than sharing one across services.274- **Scale-to-zero:** ONLY for dev/staging or non-user-facing batch. Cold275 start is 30-60s. User-facing endpoints MUST have `min-size >= 1`.276- **Deployment trigger:** automatic (`AutoDeploymentsEnabled=true`) for277 dev/staging. Manual (`false` + `start-deployment`) for production with278 change-management compliance.279280## Pre-flight safety checks (run before any deployment CLI)281282- **Confirm ECR image exists** — missing image causes `CreateFailed`.283- **Confirm access role exists and trusts `tasks.apprunner.amazonaws.com`.**284- **Confirm instance role exists (if app calls AWS services).**285- **Confirm VPC connector exists (if private resources are involved).**286- **Confirm secrets ARNs resolve** — missing secret causes `CreateFailed`.287- **Pre-create CloudWatch log group with retention** (App Runner does NOT288 auto-set retention; defaults to `Never Expire`).289- **For existing services, capture current config for rollback.**290291Full CLI sequences for all checks in `references/source-and-config-guide.md`.292293## Output format — MANDATORY literal labels294295When invoked with a service deployment request, your ENTIRE response MUST296be the checklist block below. The labels are **case-sensitive all-caps297keywords**. Do NOT write a preamble. Start with `SERVICE:` and stop after298the `VERIFICATION_COMMANDS:` block.299300```text301SERVICE: <name>302VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING303CHECKLIST:304 [✓] Source — ECR image <uri> | source code repo <url>305 [✓] Source type — ECR (image) | CODE (source repo), access role <role-arn>306 [✓] Instance configuration — <cpu> vCPU / <memory> MB, port <port>307 [✓] Environment variables — <plaintext vars>308 [✓] Secrets — <secret-names> from secretsmanager / ssm309 [✓] Instance role — <instance-role> (<app-permissions>)310 [✓] Auto-scaling — min <x> / max <y>, concurrency <n>311 [✓] VPC connector — <vc-arn> (<subnet-count> subnets, <sg-count> SGs)312 [✓] Health check — GET <path> (HTTP 200), healthy threshold <n>, interval <s>313 [✓] Deployment trigger — automatic | manual314 [✓] Observability — CloudWatch Logs /aws/apprunner/<name>, retention <days>, X-Ray tracing <enabled|disabled>315 [OPTIONAL] Custom domain — <domain> (managed TLS)316VERIFICATION_COMMANDS:317 aws apprunner describe-service --service-arn <arn>318 aws apprunner describe-vpc-connector --vpc-connector-arn <vc-arn>319 aws iam get-role --role-name <access-role>320 aws logs describe-log-groups --log-group-name-prefix /aws/apprunner/<name>321```322323**Status marker semantics:**324- `[✓]` — applied and verified.325- `[✗]` — NOT applied or misconfigured. Cite the gap.326- `[OPTIONAL]` — recommended but not required.327- `[INPUT NEEDED]` — prerequisite value missing; operator must provide.328329**PREREQUISITES_MISSING verdict:** if any REQUIRED prerequisite is missing330(ECR access role, ECR image, VPC connector for private-resource workloads,331instance role for AWS-SDK-calling apps, secrets ARN for named secrets),332the verdict is `PREREQUISITES_MISSING`.333334## References (load on demand)335336- [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md) — full copy-pasteable CLI sequence and IaC equivalents; now also holds the Step 1, 2, 4-10 command payloads moved from SKILL.md.337- [references/source-and-config-guide.md](references/source-and-config-guide.md) — source type selection, VPC connector networking, auto-scaling tuning, health check policy, observability, full NEVER list, pre-flight safety CLI.338- [references/advanced-patterns.md](references/advanced-patterns.md) — Latest App Runner features (2024-2026) and edge-case handling moved from SKILL.md.339340## Domain341342AWS CloudOps / App Runner Managed Container Compute Provisioning.343344## Edge-case handling345346Edge-case catalog (cross-account ECR, connector sharing, private endpoint mode, slow-start JVM, build failures, auto-deploy surprises, log group naming) moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md).347Load on demand when the deployment hits a non-standard path.348349## AWS documentation350351- **AWS App Runner Developer Guide** — https://docs.aws.amazon.com/apprunner/latest/dg/what-is-apprunner.html352- **App Runner CreateService API** — https://docs.aws.amazon.com/apprunner/latest/api/API_CreateService.html353- **App Runner VPC Connector** — https://docs.aws.amazon.com/apprunner/latest/dg/network-vpc.html354- **App Runner VPC Ingress** — https://docs.aws.amazon.com/apprunner/latest/dg/network-vpc-ingress.html355- **App Runner Auto Scaling** — https://docs.aws.amazon.com/apprunner/latest/dg/manage-autoscaling.html356- **App Runner Custom Domains** — https://docs.aws.amazon.com/apprunner/latest/dg/manage-custom-domains.html357- **App Runner Observability** — https://docs.aws.amazon.com/apprunner/latest/dg/observability.html358- **App Runner Deployment Methods** — https://docs.aws.amazon.com/apprunner/latest/dg/manage-deploy.html359- **App Runner CLI Reference** — https://docs.aws.amazon.com/cli/latest/reference/apprunner/360361## References362363- `references/cli-commands-and-iac.md` — full copy-pasteable CLI command364 sequence for all 11 deployment steps, including access role and365 instance role creation, VPC connector creation, auto-scaling366 configuration, service creation with health check and observability,367 and Terraform / CloudFormation equivalents.368369- `references/source-and-config-guide.md` — deep reference on source370 type selection (ECR vs code repository), VPC connector networking,371 auto-scaling tuning, health check policy, observability configuration,372 custom domain, full NEVER list, edge-case handling, and pre-flight373 safety CLI.