@deftai/directive-content 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/.agents/skills/deft/SKILL.md +6 -0
  2. package/.agents/skills/deft-directive-article-review/SKILL.md +11 -0
  3. package/.agents/skills/deft-directive-build/SKILL.md +10 -0
  4. package/.agents/skills/deft-directive-cost/SKILL.md +12 -0
  5. package/.agents/skills/deft-directive-debug/SKILL.md +13 -0
  6. package/.agents/skills/deft-directive-gh-arch/SKILL.md +11 -0
  7. package/.agents/skills/deft-directive-gh-slice/SKILL.md +10 -0
  8. package/.agents/skills/deft-directive-glossary/SKILL.md +10 -0
  9. package/.agents/skills/deft-directive-interview/SKILL.md +9 -0
  10. package/.agents/skills/deft-directive-pre-pr/SKILL.md +9 -0
  11. package/.agents/skills/deft-directive-refinement/SKILL.md +10 -0
  12. package/.agents/skills/deft-directive-release/SKILL.md +12 -0
  13. package/.agents/skills/deft-directive-review-cycle/SKILL.md +10 -0
  14. package/.agents/skills/deft-directive-setup/SKILL.md +10 -0
  15. package/.agents/skills/deft-directive-swarm/SKILL.md +10 -0
  16. package/.agents/skills/deft-directive-sync/SKILL.md +9 -0
  17. package/.agents/skills/deft-directive-triage/SKILL.md +9 -0
  18. package/.agents/skills/deft-directive-write-skill/SKILL.md +9 -0
  19. package/LICENSE.md +22 -0
  20. package/QUICK-START.md +167 -0
  21. package/UPGRADING.md +517 -0
  22. package/coding/build-output.md +28 -0
  23. package/coding/coding.md +235 -0
  24. package/coding/debugging.md +110 -0
  25. package/coding/holzmann.md +96 -0
  26. package/coding/hygiene.md +127 -0
  27. package/coding/security.md +158 -0
  28. package/coding/testing.md +162 -0
  29. package/coding/toolchain.md +44 -0
  30. package/commands.md +300 -0
  31. package/context/context.md +57 -0
  32. package/context/deterministic-split.md +67 -0
  33. package/context/examples.md +26 -0
  34. package/context/fractal-summaries.md +69 -0
  35. package/context/long-horizon.md +46 -0
  36. package/context/spec-deltas.md +177 -0
  37. package/context/tool-design.md +34 -0
  38. package/context/working-memory.md +62 -0
  39. package/contracts/boundary-maps.md +65 -0
  40. package/contracts/deterministic-questions.md +59 -0
  41. package/contracts/hierarchy.md +77 -0
  42. package/conventions/content-manifest.json +399 -0
  43. package/conventions/machine-generated-banner.md +130 -0
  44. package/conventions/references.md +120 -0
  45. package/conventions/rule-ownership.json +382 -0
  46. package/conventions/task-caching.md +43 -0
  47. package/conventions/vbrief-filenames.md +70 -0
  48. package/deployments/README.md +37 -0
  49. package/deployments/agentuity/README.md +138 -0
  50. package/deployments/agentuity/via-cli.md +380 -0
  51. package/deployments/agentuity/via-cloud.md +425 -0
  52. package/deployments/agentuity/via-github-actions.md +664 -0
  53. package/deployments/agentuity/via-gravity-network.md +606 -0
  54. package/deployments/agentuity/via-vpc.md +607 -0
  55. package/deployments/aws/README.md +38 -0
  56. package/deployments/aws/via-app-runner.md +612 -0
  57. package/deployments/aws/via-ecs-fargate.md +561 -0
  58. package/deployments/aws/via-elastic-beanstalk.md +628 -0
  59. package/deployments/aws/via-lambda.md +649 -0
  60. package/deployments/azure/README.md +37 -0
  61. package/deployments/azure/via-aks.md +390 -0
  62. package/deployments/azure/via-app-service.md +564 -0
  63. package/deployments/azure/via-container-apps.md +599 -0
  64. package/deployments/azure/via-functions.md +552 -0
  65. package/deployments/cloud-gov/README.md +63 -0
  66. package/deployments/cloud-gov/agents/compliance-docs.md +154 -0
  67. package/deployments/cloud-gov/agents.md +39 -0
  68. package/deployments/cloud-gov/cicd.md +64 -0
  69. package/deployments/cloud-gov/deployment.md +150 -0
  70. package/deployments/cloud-gov/logging.md +43 -0
  71. package/deployments/cloud-gov/manifest.md +121 -0
  72. package/deployments/cloud-gov/overview.md +58 -0
  73. package/deployments/cloud-gov/security.md +46 -0
  74. package/deployments/cloud-gov/services.md +72 -0
  75. package/deployments/cloud-gov/upstream/README.md +18 -0
  76. package/deployments/cloudflare/README.md +33 -0
  77. package/deployments/cloudflare/via-dashboard.md +83 -0
  78. package/deployments/cloudflare/via-git.md +90 -0
  79. package/deployments/cloudflare/via-github-actions.md +185 -0
  80. package/deployments/cloudflare/via-terraform.md +157 -0
  81. package/deployments/cloudflare/via-wrangler.md +165 -0
  82. package/deployments/fly-io/README.md +37 -0
  83. package/deployments/fly-io/via-dockerfile.md +648 -0
  84. package/deployments/fly-io/via-flyctl.md +653 -0
  85. package/deployments/fly-io/via-github-actions.md +695 -0
  86. package/deployments/fly-io/via-multi-region.md +598 -0
  87. package/deployments/google/README.md +34 -0
  88. package/deployments/google/via-app-engine.md +42 -0
  89. package/deployments/google/via-cloud-functions.md +23 -0
  90. package/deployments/google/via-cloud-run.md +330 -0
  91. package/deployments/google/via-gke.md +23 -0
  92. package/deployments/netlify/README.md +99 -0
  93. package/deployments/netlify/via-cli.md +17 -0
  94. package/deployments/netlify/via-functions.md +19 -0
  95. package/deployments/netlify/via-git.md +25 -0
  96. package/deployments/vercel/README.md +90 -0
  97. package/deployments/vercel/via-api.md +16 -0
  98. package/deployments/vercel/via-cli.md +17 -0
  99. package/deployments/vercel/via-git.md +24 -0
  100. package/docs/BROWNFIELD.md +179 -0
  101. package/docs/getting-started.md +137 -0
  102. package/docs/good-agents-md.md +137 -0
  103. package/events/README.md +89 -0
  104. package/events/event-record.schema.json +26 -0
  105. package/events/registry.json +166 -0
  106. package/events/registry.schema.json +71 -0
  107. package/glossary.md +145 -0
  108. package/incidents/README.md +81 -0
  109. package/incidents/_template.md +38 -0
  110. package/interfaces/cli.md +104 -0
  111. package/interfaces/rest.md +212 -0
  112. package/interfaces/tui.md +242 -0
  113. package/interfaces/web.md +123 -0
  114. package/languages/6502-DASM.md +132 -0
  115. package/languages/c.md +235 -0
  116. package/languages/commands.md +23 -0
  117. package/languages/cpp.md +132 -0
  118. package/languages/csharp.md +259 -0
  119. package/languages/dart.md +183 -0
  120. package/languages/delphi.md +218 -0
  121. package/languages/elixir.md +208 -0
  122. package/languages/go.md +78 -0
  123. package/languages/java.md +278 -0
  124. package/languages/javascript.md +163 -0
  125. package/languages/julia.md +175 -0
  126. package/languages/kotlin.md +193 -0
  127. package/languages/markdown.md +168 -0
  128. package/languages/mermaid.md +146 -0
  129. package/languages/officejs.md +392 -0
  130. package/languages/python.md +209 -0
  131. package/languages/r.md +163 -0
  132. package/languages/rust.md +216 -0
  133. package/languages/sql.md +216 -0
  134. package/languages/swift.md +153 -0
  135. package/languages/typescript.md +132 -0
  136. package/languages/vba.md +279 -0
  137. package/languages/vhdl.md +180 -0
  138. package/languages/visual-basic.md +151 -0
  139. package/languages/zig.md +196 -0
  140. package/meta/SOUL.md +27 -0
  141. package/meta/code-field.md +44 -0
  142. package/meta/morals.md +40 -0
  143. package/meta/philosophy.md +39 -0
  144. package/meta/project.md +49 -0
  145. package/meta/ralph.md +223 -0
  146. package/meta/security.md +80 -0
  147. package/meta/versioning.md +326 -0
  148. package/package.json +22 -0
  149. package/packs/lessons/lessons-pack-0.1.json +553 -0
  150. package/packs/patterns/patterns-pack-0.1.json +57 -0
  151. package/packs/rules/rules-pack-0.1.json +4767 -0
  152. package/packs/skills/skills-pack-0.1.json +262 -0
  153. package/packs/strategies/strategies-pack-0.1.json +167 -0
  154. package/packs/swarm-spec/swarm-spec-pack-0.1.json +17 -0
  155. package/patterns/executor-layer-credentials.md +227 -0
  156. package/patterns/llm-app.md +156 -0
  157. package/patterns/multi-agent.md +278 -0
  158. package/patterns/prompt-assembly-layer-ordering.md +154 -0
  159. package/patterns/role-as-overlay.md +179 -0
  160. package/platforms/2600.md +137 -0
  161. package/platforms/unity.md +329 -0
  162. package/references/composer-skill-porting.md +152 -0
  163. package/references/cost-models.md +163 -0
  164. package/references/ip-risk.md +246 -0
  165. package/references/plain-english-ux.md +275 -0
  166. package/resilience/context-pruning.md +67 -0
  167. package/resilience/continue-here.md +62 -0
  168. package/scm/changelog.md +276 -0
  169. package/scm/git.md +139 -0
  170. package/scm/github.md +265 -0
  171. package/secrets/.gitkeep +0 -0
  172. package/skills/deft-build/SKILL.md +20 -0
  173. package/skills/deft-directive-article-review/SKILL.md +156 -0
  174. package/skills/deft-directive-build/SKILL.md +302 -0
  175. package/skills/deft-directive-cost/SKILL.md +201 -0
  176. package/skills/deft-directive-debug/SKILL.md +140 -0
  177. package/skills/deft-directive-decompose/SKILL.md +96 -0
  178. package/skills/deft-directive-gh-arch/SKILL.md +160 -0
  179. package/skills/deft-directive-gh-slice/SKILL.md +199 -0
  180. package/skills/deft-directive-glossary/SKILL.md +118 -0
  181. package/skills/deft-directive-interview/SKILL.md +528 -0
  182. package/skills/deft-directive-pre-pr/SKILL.md +131 -0
  183. package/skills/deft-directive-probe/SKILL.md +127 -0
  184. package/skills/deft-directive-refinement/SKILL.md +403 -0
  185. package/skills/deft-directive-release/SKILL.md +266 -0
  186. package/skills/deft-directive-review-cycle/SKILL.md +401 -0
  187. package/skills/deft-directive-setup/SKILL.md +717 -0
  188. package/skills/deft-directive-swarm/SKILL.md +989 -0
  189. package/skills/deft-directive-sync/SKILL.md +288 -0
  190. package/skills/deft-directive-triage/SKILL.md +137 -0
  191. package/skills/deft-directive-write-skill/SKILL.md +169 -0
  192. package/skills/deft-interview/SKILL.md +16 -0
  193. package/skills/deft-pre-pr/SKILL.md +16 -0
  194. package/skills/deft-review-cycle/SKILL.md +16 -0
  195. package/skills/deft-roadmap-refresh/SKILL.md +16 -0
  196. package/skills/deft-setup/SKILL.md +20 -0
  197. package/skills/deft-swarm/SKILL.md +16 -0
  198. package/skills/deft-sync/SKILL.md +16 -0
  199. package/strategies/README.md +83 -0
  200. package/strategies/artifact-guards.md +85 -0
  201. package/strategies/bdd.md +115 -0
  202. package/strategies/brownfield.md +7 -0
  203. package/strategies/discuss.md +129 -0
  204. package/strategies/emit-hints.md +69 -0
  205. package/strategies/enterprise.md +193 -0
  206. package/strategies/interview.md +551 -0
  207. package/strategies/map.md +179 -0
  208. package/strategies/probe.md +151 -0
  209. package/strategies/rapid.md +155 -0
  210. package/strategies/research.md +155 -0
  211. package/strategies/roadmap.md +9 -0
  212. package/strategies/speckit.md +437 -0
  213. package/strategies/v0-20-contract.md +134 -0
  214. package/strategies/yolo.md +169 -0
  215. package/swarm/swarm.md +300 -0
  216. package/templates/COST-ESTIMATE.md +114 -0
  217. package/templates/PULL_REQUEST_TEMPLATE.md +35 -0
  218. package/templates/agent-prompt-preamble.md +409 -0
  219. package/templates/agents-entry.md +211 -0
  220. package/templates/agents-entry.placeholders.md +75 -0
  221. package/templates/embed.go +20 -0
  222. package/templates/embed_test.go +36 -0
  223. package/templates/make-spec-example.md +9 -0
  224. package/templates/make-spec.md +246 -0
  225. package/templates/project.md.template +52 -0
  226. package/templates/specification.md +1 -0
  227. package/templates/swarm-greptile-poller-prompt.md +556 -0
  228. package/templates/user.md.template +31 -0
  229. package/tools/RWLDL.md +80 -0
  230. package/tools/greptile.md +141 -0
  231. package/tools/installer.md +23 -0
  232. package/tools/taskfile-migration.md +32 -0
  233. package/tools/taskfile.md +185 -0
  234. package/tools/telemetry.md +285 -0
  235. package/vbrief/schemas/cache-meta.schema.json +137 -0
  236. package/vbrief/schemas/candidates.schema.json +130 -0
  237. package/vbrief/schemas/codebase-map.schema.json +213 -0
  238. package/vbrief/schemas/lessons-pack.schema.json +134 -0
  239. package/vbrief/schemas/patterns-pack.schema.json +84 -0
  240. package/vbrief/schemas/rules-pack.schema.json +105 -0
  241. package/vbrief/schemas/skills-pack.schema.json +94 -0
  242. package/vbrief/schemas/slices.schema.json +87 -0
  243. package/vbrief/schemas/strategies-pack.schema.json +89 -0
  244. package/vbrief/schemas/swarm-spec-pack.schema.json +84 -0
  245. package/vbrief/schemas/vbrief-core.schema.json +1022 -0
  246. package/vbrief/vbrief.md +684 -0
  247. package/verification/integration.md +76 -0
  248. package/verification/plan-checking.md +85 -0
  249. package/verification/uat.md +60 -0
  250. package/verification/verification.md +117 -0
@@ -0,0 +1,612 @@
1
+ # Deploy via AWS App Runner
2
+
3
+ Deploy containerized web applications with minimal configuration using AWS App Runner. The simplest way to run containers on AWS without managing infrastructure.
4
+
5
+ ## Overview
6
+
7
+ AWS App Runner makes container deployment simple:
8
+ - **Zero Configuration**: Deploy from source code or container registry
9
+ - **Automatic Scaling**: Scale based on traffic automatically
10
+ - **Built-in Load Balancing**: HTTPS endpoint included
11
+ - **Health Monitoring**: Automatic health checks and restarts
12
+ - **Pay-per-use**: Only pay for resources used
13
+
14
+ ## Prerequisites
15
+
16
+ - AWS account with IAM permissions
17
+ - Application source code (GitHub) or container image (ECR)
18
+ - AWS CLI installed (optional)
19
+
20
+ ## Quick Start from Source Code
21
+
22
+ ### 1. Connect GitHub Repository
23
+
24
+ ```bash
25
+ # Via AWS Console:
26
+ # 1. Go to App Runner console
27
+ # 2. Click "Create service"
28
+ # 3. Choose "Source code repository"
29
+ # 4. Connect to GitHub
30
+ # 5. Select repository and branch
31
+ ```
32
+
33
+ ### 2. Configure Build
34
+
35
+ App Runner auto-detects runtime or use `apprunner.yaml`:
36
+
37
+ ```yaml
38
+ # apprunner.yaml
39
+ version: 1.0
40
+ runtime: python311
41
+ build:
42
+ commands:
43
+ pre-build:
44
+ - pip install --upgrade pip
45
+ build:
46
+ - pip install -r requirements.txt
47
+ run:
48
+ command: gunicorn --bind :8080 app:app
49
+ network:
50
+ port: 8080
51
+ env:
52
+ - name: APP_ENV
53
+ value: production
54
+ ```
55
+
56
+ ### 3. Deploy
57
+
58
+ Once configured, App Runner automatically:
59
+ - Builds your application
60
+ - Creates container image
61
+ - Deploys to HTTPS endpoint
62
+ - Provides `.awsapprunner.com` URL
63
+
64
+ ## Quick Start from Container Image
65
+
66
+ ### 1. Push Image to ECR
67
+
68
+ ```bash
69
+ # Authenticate to ECR
70
+ aws ecr get-login-password --region us-east-1 | \
71
+ docker login --username AWS --password-stdin \
72
+ ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com
73
+
74
+ # Create repository
75
+ aws ecr create-repository --repository-name my-app
76
+
77
+ # Build and tag image
78
+ docker build -t my-app .
79
+ docker tag my-app:latest \
80
+ ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/my-app:latest
81
+
82
+ # Push image
83
+ docker push ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/my-app:latest
84
+ ```
85
+
86
+ ### 2. Create App Runner Service
87
+
88
+ ```bash
89
+ # Create service from ECR image
90
+ aws apprunner create-service \
91
+ --service-name my-app \
92
+ --source-configuration '{
93
+ "ImageRepository": {
94
+ "ImageIdentifier": "ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/my-app:latest",
95
+ "ImageRepositoryType": "ECR",
96
+ "ImageConfiguration": {
97
+ "Port": "8080",
98
+ "RuntimeEnvironmentVariables": {
99
+ "APP_ENV": "production"
100
+ }
101
+ }
102
+ },
103
+ "AutoDeploymentsEnabled": true
104
+ }' \
105
+ --instance-configuration '{
106
+ "Cpu": "1 vCPU",
107
+ "Memory": "2 GB"
108
+ }'
109
+ ```
110
+
111
+ ## Configuration File (apprunner.yaml)
112
+
113
+ ### Node.js Application
114
+
115
+ ```yaml
116
+ version: 1.0
117
+ runtime: nodejs18
118
+
119
+ build:
120
+ commands:
121
+ pre-build:
122
+ - npm install
123
+ build:
124
+ - npm run build
125
+
126
+ run:
127
+ command: npm start
128
+ network:
129
+ port: 3000
130
+ env-vars:
131
+ - PORT
132
+ env:
133
+ - name: NODE_ENV
134
+ value: production
135
+ ```
136
+
137
+ ### Python Application
138
+
139
+ ```yaml
140
+ version: 1.0
141
+ runtime: python311
142
+
143
+ build:
144
+ commands:
145
+ pre-build:
146
+ - pip install -r requirements.txt
147
+ build:
148
+ - python -m compileall .
149
+
150
+ run:
151
+ command: gunicorn --bind :8000 --workers 4 wsgi:app
152
+ network:
153
+ port: 8000
154
+ env:
155
+ - name: FLASK_ENV
156
+ value: production
157
+ - name: DATABASE_URL
158
+ value: "{{resolve:secretsmanager:db-url}}"
159
+ ```
160
+
161
+ ### Go Application
162
+
163
+ ```yaml
164
+ version: 1.0
165
+ runtime: go118
166
+
167
+ build:
168
+ commands:
169
+ build:
170
+ - go build -o app main.go
171
+
172
+ run:
173
+ command: ./app
174
+ network:
175
+ port: 8080
176
+ env:
177
+ - name: GIN_MODE
178
+ value: release
179
+ ```
180
+
181
+ ### Ruby Application
182
+
183
+ ```yaml
184
+ version: 1.0
185
+ runtime: ruby31
186
+
187
+ build:
188
+ commands:
189
+ pre-build:
190
+ - bundle install
191
+ build:
192
+ - bundle exec rails assets:precompile
193
+
194
+ run:
195
+ command: bundle exec rails server -b 0.0.0.0 -p 3000
196
+ network:
197
+ port: 3000
198
+ env:
199
+ - name: RAILS_ENV
200
+ value: production
201
+ ```
202
+
203
+ ## Environment Variables & Secrets
204
+
205
+ ### Configure via Console
206
+
207
+ ```
208
+ 1. Go to App Runner service
209
+ 2. Configuration → Environment variables
210
+ 3. Add plaintext or secret variables
211
+ ```
212
+
213
+ ### Configure via CLI
214
+
215
+ ```bash
216
+ # Update service with environment variables
217
+ aws apprunner update-service \
218
+ --service-arn arn:aws:apprunner:... \
219
+ --source-configuration '{
220
+ "ImageRepository": {
221
+ "ImageConfiguration": {
222
+ "RuntimeEnvironmentVariables": {
223
+ "API_KEY": "value",
224
+ "DATABASE_URL": "{{resolve:secretsmanager:db-credentials:SecretString:url}}"
225
+ }
226
+ }
227
+ }
228
+ }'
229
+ ```
230
+
231
+ ### Use AWS Secrets Manager
232
+
233
+ ```yaml
234
+ # apprunner.yaml
235
+ env:
236
+ - name: DB_PASSWORD
237
+ value: "{{resolve:secretsmanager:my-secret:SecretString:password}}"
238
+ - name: API_KEY
239
+ value: "{{resolve:ssm:/my-app/api-key}}"
240
+ ```
241
+
242
+ ## Custom Domain & HTTPS
243
+
244
+ ### Add Custom Domain
245
+
246
+ ```bash
247
+ # Associate custom domain
248
+ aws apprunner associate-custom-domain \
249
+ --service-arn arn:aws:apprunner:... \
250
+ --domain-name api.example.com
251
+
252
+ # Get DNS validation records
253
+ aws apprunner describe-custom-domains \
254
+ --service-arn arn:aws:apprunner:...
255
+
256
+ # Add CNAME records to your DNS provider
257
+ # App Runner provides validation records
258
+ ```
259
+
260
+ ### Automatic HTTPS
261
+
262
+ - App Runner automatically provisions SSL certificates
263
+ - Both `.awsapprunner.com` and custom domains get HTTPS
264
+ - Certificate renewal is automatic
265
+
266
+ ## Auto Scaling
267
+
268
+ ### Configure Scaling
269
+
270
+ ```bash
271
+ # Set auto scaling configuration
272
+ aws apprunner create-auto-scaling-configuration \
273
+ --auto-scaling-configuration-name my-config \
274
+ --min-size 1 \
275
+ --max-size 10 \
276
+ --max-concurrency 100
277
+
278
+ # Apply to service
279
+ aws apprunner update-service \
280
+ --service-arn arn:aws:apprunner:... \
281
+ --auto-scaling-configuration-arn arn:aws:apprunner:...
282
+ ```
283
+
284
+ ### Scaling Parameters
285
+
286
+ ```json
287
+ {
288
+ "MinSize": 1, // Minimum instances
289
+ "MaxSize": 25, // Maximum instances (default: 25)
290
+ "MaxConcurrency": 100 // Requests per instance before scaling
291
+ }
292
+ ```
293
+
294
+ ## Instance Configuration
295
+
296
+ ### CPU and Memory Options
297
+
298
+ ```bash
299
+ # Configure instance size
300
+ aws apprunner update-service \
301
+ --service-arn arn:aws:apprunner:... \
302
+ --instance-configuration '{
303
+ "Cpu": "2 vCPU",
304
+ "Memory": "4 GB"
305
+ }'
306
+ ```
307
+
308
+ **Available sizes:**
309
+ - `0.25 vCPU` / `0.5 GB` - Minimum
310
+ - `0.5 vCPU` / `1 GB`
311
+ - `1 vCPU` / `2 GB` - Default
312
+ - `2 vCPU` / `4 GB`
313
+ - `4 vCPU` / `12 GB` - Maximum
314
+
315
+ ## VPC Connector (Private Resources)
316
+
317
+ ### Connect to VPC Resources
318
+
319
+ ```bash
320
+ # Create VPC connector
321
+ aws apprunner create-vpc-connector \
322
+ --vpc-connector-name my-connector \
323
+ --subnets subnet-xxx subnet-yyy \
324
+ --security-groups sg-xxx
325
+
326
+ # Associate with service
327
+ aws apprunner update-service \
328
+ --service-arn arn:aws:apprunner:... \
329
+ --network-configuration '{
330
+ "EgressConfiguration": {
331
+ "EgressType": "VPC",
332
+ "VpcConnectorArn": "arn:aws:apprunner:..."
333
+ }
334
+ }'
335
+ ```
336
+
337
+ ### Access RDS Database
338
+
339
+ ```yaml
340
+ # apprunner.yaml with VPC access
341
+ run:
342
+ network:
343
+ port: 8080
344
+ env:
345
+ - name: DATABASE_URL
346
+ value: "postgresql://user:pass@rds-instance.region.rds.amazonaws.com:5432/db"
347
+ ```
348
+
349
+ ## Health Checks
350
+
351
+ ### Configure Health Check
352
+
353
+ ```bash
354
+ aws apprunner update-service \
355
+ --service-arn arn:aws:apprunner:... \
356
+ --health-check-configuration '{
357
+ "Protocol": "HTTP",
358
+ "Path": "/health",
359
+ "Interval": 10,
360
+ "Timeout": 5,
361
+ "HealthyThreshold": 1,
362
+ "UnhealthyThreshold": 5
363
+ }'
364
+ ```
365
+
366
+ ### Health Check Options
367
+
368
+ ```json
369
+ {
370
+ "Protocol": "HTTP", // HTTP or TCP
371
+ "Path": "/health", // Health check endpoint
372
+ "Interval": 10, // Seconds between checks
373
+ "Timeout": 5, // Seconds to wait for response
374
+ "HealthyThreshold": 1, // Successes to mark healthy
375
+ "UnhealthyThreshold": 5 // Failures to mark unhealthy
376
+ }
377
+ ```
378
+
379
+ ## CI/CD Integration
380
+
381
+ ### GitHub Actions
382
+
383
+ ```yaml
384
+ # .github/workflows/deploy.yml
385
+ name: Deploy to App Runner
386
+
387
+ on:
388
+ push:
389
+ branches: [main]
390
+
391
+ jobs:
392
+ deploy:
393
+ runs-on: ubuntu-latest
394
+
395
+ steps:
396
+ - uses: actions/checkout@v3
397
+
398
+ - uses: aws-actions/configure-aws-credentials@v2
399
+ with:
400
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
401
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
402
+ aws-region: us-east-1
403
+
404
+ - name: Login to ECR
405
+ id: login-ecr
406
+ uses: aws-actions/amazon-ecr-login@v1
407
+
408
+ - name: Build and push image
409
+ env:
410
+ ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
411
+ ECR_REPOSITORY: my-app
412
+ IMAGE_TAG: ${{ github.sha }}
413
+ run: |
414
+ docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
415
+ docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
416
+
417
+ - name: Deploy to App Runner
418
+ run: |
419
+ aws apprunner update-service \
420
+ --service-arn ${{ secrets.APPRUNNER_SERVICE_ARN }} \
421
+ --source-configuration '{
422
+ "ImageRepository": {
423
+ "ImageIdentifier": "${{ steps.login-ecr.outputs.registry }}/my-app:${{ github.sha }}",
424
+ "ImageRepositoryType": "ECR"
425
+ }
426
+ }'
427
+ ```
428
+
429
+ ### Automatic Deployments from ECR
430
+
431
+ ```bash
432
+ # Enable automatic deployments
433
+ aws apprunner update-service \
434
+ --service-arn arn:aws:apprunner:... \
435
+ --source-configuration '{
436
+ "AutoDeploymentsEnabled": true,
437
+ "ImageRepository": {
438
+ "ImageIdentifier": "ACCOUNT_ID.dkr.ecr.region.amazonaws.com/my-app:latest",
439
+ "ImageRepositoryType": "ECR"
440
+ }
441
+ }'
442
+ ```
443
+
444
+ ## Monitoring & Logging
445
+
446
+ ### CloudWatch Logs
447
+
448
+ ```bash
449
+ # View application logs
450
+ aws logs tail /aws/apprunner/my-app/application --follow
451
+
452
+ # View service logs
453
+ aws logs tail /aws/apprunner/my-app/service --follow
454
+ ```
455
+
456
+ ### CloudWatch Metrics
457
+
458
+ Available metrics:
459
+ - `2xxStatusResponses` - Successful requests
460
+ - `4xxStatusResponses` - Client errors
461
+ - `5xxStatusResponses` - Server errors
462
+ - `RequestCount` - Total requests
463
+ - `ActiveInstances` - Running instances
464
+ - `RequestLatency` - Response time
465
+
466
+ ### X-Ray Tracing
467
+
468
+ ```yaml
469
+ # apprunner.yaml with X-Ray
470
+ env:
471
+ - name: AWS_XRAY_DAEMON_ADDRESS
472
+ value: xray-daemon:2000
473
+ - name: AWS_XRAY_TRACING_NAME
474
+ value: my-app
475
+ ```
476
+
477
+ ## Database Integration
478
+
479
+ ### Amazon RDS
480
+
481
+ ```bash
482
+ # Create VPC connector for RDS access
483
+ aws apprunner create-vpc-connector \
484
+ --vpc-connector-name rds-connector \
485
+ --subnets subnet-private-1 subnet-private-2 \
486
+ --security-groups sg-rds-access
487
+
488
+ # Store credentials in Secrets Manager
489
+ aws secretsmanager create-secret \
490
+ --name my-app/db \
491
+ --secret-string '{"host":"db.region.rds.amazonaws.com","user":"admin","password":"secret"}'
492
+ ```
493
+
494
+ ```yaml
495
+ # apprunner.yaml
496
+ env:
497
+ - name: DB_HOST
498
+ value: "{{resolve:secretsmanager:my-app/db:SecretString:host}}"
499
+ - name: DB_USER
500
+ value: "{{resolve:secretsmanager:my-app/db:SecretString:user}}"
501
+ - name: DB_PASSWORD
502
+ value: "{{resolve:secretsmanager:my-app/db:SecretString:password}}"
503
+ ```
504
+
505
+ ### DynamoDB
506
+
507
+ ```yaml
508
+ # apprunner.yaml
509
+ env:
510
+ - name: DYNAMODB_TABLE
511
+ value: my-table
512
+ - name: AWS_REGION
513
+ value: us-east-1
514
+
515
+ # Grant IAM permissions via instance role
516
+ ```
517
+
518
+ ## Best Practices
519
+
520
+ 1. **Use ECR for Production**: More control than source-based deploys
521
+ 2. **Enable Auto Deployments**: Automatic updates when pushing new images
522
+ 3. **Configure Health Checks**: Ensure proper endpoint monitoring
523
+ 4. **Use Secrets Manager**: Never hardcode sensitive values
524
+ 5. **Set Appropriate Scaling**: Match `MaxConcurrency` to application capacity
525
+ 6. **Use VPC Connector**: For private database access
526
+ 7. **Monitor Metrics**: Watch 4xx/5xx errors and latency
527
+ 8. **Custom Domain**: Use custom domain for production
528
+ 9. **Right-size Instances**: Start with 1 vCPU/2 GB, adjust based on metrics
529
+ 10. **Tag Resources**: Use tags for cost tracking and organization
530
+
531
+ ## Cost Optimization
532
+
533
+ ```bash
534
+ # Set minimum instances to 1 (or 0 for very low traffic)
535
+ MinSize: 1
536
+
537
+ # Use smallest instance size that meets requirements
538
+ Cpu: "1 vCPU"
539
+ Memory: "2 GB"
540
+
541
+ # Set MaxConcurrency high to maximize instance utilization
542
+ MaxConcurrency: 100
543
+
544
+ # Use provisioned instances for predictable workloads
545
+ # Use autoscaling for variable traffic
546
+ ```
547
+
548
+ ## Troubleshooting
549
+
550
+ ### Service Won't Start
551
+
552
+ ```bash
553
+ # Check service status
554
+ aws apprunner describe-service --service-arn arn:aws:apprunner:...
555
+
556
+ # View logs
557
+ aws logs tail /aws/apprunner/my-app/service --follow
558
+
559
+ # Common issues:
560
+ # - Wrong port in configuration
561
+ # - Missing required environment variables
562
+ # - Application not listening on 0.0.0.0
563
+ ```
564
+
565
+ ### Health Check Failures
566
+
567
+ ```bash
568
+ # Verify health endpoint returns 200
569
+ curl https://my-app.awsapprunner.com/health
570
+
571
+ # Check health check configuration
572
+ aws apprunner describe-service --service-arn ... \
573
+ | jq '.Service.HealthCheckConfiguration'
574
+ ```
575
+
576
+ ### Can't Access VPC Resources
577
+
578
+ ```bash
579
+ # Verify VPC connector configuration
580
+ aws apprunner describe-vpc-connector \
581
+ --vpc-connector-arn arn:aws:apprunner:...
582
+
583
+ # Check security group rules allow traffic
584
+ # Check network ACLs
585
+ # Verify subnets have route to NAT gateway
586
+ ```
587
+
588
+ ## Limitations
589
+
590
+ - **Request Timeout**: 120 seconds maximum
591
+ - **Max Instances**: 25 per service (can request increase)
592
+ - **Port**: Single port per service (HTTP/HTTPS only)
593
+ - **Container Size**: 10 GB maximum image size
594
+ - **No Persistent Storage**: Use S3, EFS, or databases for persistence
595
+
596
+ ## Comparison with Other Services
597
+
598
+ | Feature | App Runner | ECS Fargate | Elastic Beanstalk |
599
+ |---------|------------|-------------|-------------------|
600
+ | Setup Complexity | Minimal | Moderate | Moderate |
601
+ | Configuration | Auto-detected | Full control | Opinionated |
602
+ | Scaling | Automatic | Manual/Auto | Automatic |
603
+ | Load Balancer | Included | Separate | Included |
604
+ | Use Case | Simple web apps | Complex apps | Traditional PaaS |
605
+
606
+ ## References
607
+
608
+ - [AWS App Runner Documentation](https://docs.aws.amazon.com/apprunner/)
609
+ - [App Runner Configuration File](https://docs.aws.amazon.com/apprunner/latest/dg/config-file.html)
610
+ - [App Runner Pricing](https://aws.amazon.com/apprunner/pricing/)
611
+ - [VPC Connector Guide](https://docs.aws.amazon.com/apprunner/latest/dg/network-vpc.html)
612
+ - [GitHub Actions Integration](https://docs.aws.amazon.com/apprunner/latest/dg/deploy-github.html)