@radicaltools/cli 0.3.0 → 0.3.1

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 (57) hide show
  1. package/README.md +121 -16
  2. package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
  3. package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
  4. package/dist/hub-catalogue/concern/concern-api-evolution.radical +449 -210
  5. package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
  6. package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
  7. package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
  8. package/dist/hub-catalogue/concern/concern-architecture-style.radical +287 -131
  9. package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
  10. package/dist/hub-catalogue/concern/concern-authentication.radical +247 -37
  11. package/dist/hub-catalogue/concern/concern-authorization.radical +311 -89
  12. package/dist/hub-catalogue/concern/concern-availability.radical +287 -63
  13. package/dist/hub-catalogue/concern/concern-backend-stack.radical +300 -381
  14. package/dist/hub-catalogue/concern/concern-backup-recovery.radical +385 -129
  15. package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
  16. package/dist/hub-catalogue/concern/concern-capacity.radical +194 -81
  17. package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
  18. package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
  19. package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
  20. package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
  21. package/dist/hub-catalogue/concern/concern-communication-style.radical +473 -167
  22. package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
  23. package/dist/hub-catalogue/concern/concern-data-consistency.radical +339 -308
  24. package/dist/hub-catalogue/concern/concern-data-store.radical +480 -158
  25. package/dist/hub-catalogue/concern/concern-decomposition.radical +260 -85
  26. package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
  27. package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
  28. package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
  29. package/dist/hub-catalogue/concern/concern-deployment.radical +343 -92
  30. package/dist/hub-catalogue/concern/concern-encryption.radical +339 -76
  31. package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
  32. package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
  33. package/dist/hub-catalogue/concern/concern-frontend-stack.radical +467 -160
  34. package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
  35. package/dist/hub-catalogue/concern/concern-infrastructure.radical +1300 -268
  36. package/dist/hub-catalogue/concern/concern-integration-resilience.radical +88 -51
  37. package/dist/hub-catalogue/concern/concern-messaging.radical +173 -140
  38. package/dist/hub-catalogue/concern/concern-module-boundaries.radical +162 -159
  39. package/dist/hub-catalogue/concern/concern-observability.radical +224 -275
  40. package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
  41. package/dist/hub-catalogue/concern/concern-personal-data.radical +637 -122
  42. package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
  43. package/dist/hub-catalogue/concern/concern-rate-limiting.radical +433 -141
  44. package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
  45. package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
  46. package/dist/hub-catalogue/concern/concern-secrets.radical +332 -74
  47. package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
  48. package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
  49. package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
  50. package/dist/hub-catalogue/concern/concern-supply-chain.radical +257 -183
  51. package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
  52. package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
  53. package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +271 -137
  54. package/dist/hub-catalogue/concern/concern-test-strategy.radical +243 -224
  55. package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
  56. package/dist/index.js +3680 -2074
  57. package/package.json +1 -1
@@ -10,6 +10,7 @@
10
10
  "cloud",
11
11
  "kubernetes",
12
12
  "serverless",
13
+ "cdn",
13
14
  "infrastructure as code",
14
15
  "finops",
15
16
  "drift"
@@ -17,7 +18,7 @@
17
18
  "requiredMetamodel": "c4-ddd-governance-builtin",
18
19
  "concern": {
19
20
  "id": "infrastructure",
20
- "trigger": "LIST NODES WHERE (type = \"container\" OR type = \"webapp\" OR type = \"database\") AND external != true",
21
+ "trigger": "LIST NODES WHERE (type = \"container\" OR type = \"webapp\") AND external != true",
21
22
  "why": "these elements are deployed and run somewhere, so the hosting, the cloud, how the infrastructure is built and what it may cost has to be decided.",
22
23
  "group": "technology"
23
24
  },
@@ -30,6 +31,10 @@
30
31
  "title": "AWS Well-Architected Framework",
31
32
  "url": "https://aws.amazon.com/architecture/well-architected/"
32
33
  },
34
+ {
35
+ "title": "AWS Well-Architected: Serverless Applications Lens",
36
+ "url": "https://docs.aws.amazon.com/wellarchitected/latest/serverless-applications-lens/welcome.html"
37
+ },
33
38
  {
34
39
  "title": "Microsoft Azure Well-Architected Framework",
35
40
  "url": "https://learn.microsoft.com/en-us/azure/well-architected/"
@@ -38,6 +43,14 @@
38
43
  "title": "Google Cloud Architecture Framework",
39
44
  "url": "https://cloud.google.com/architecture/framework"
40
45
  },
46
+ {
47
+ "title": "CIS Benchmarks",
48
+ "url": "https://www.cisecurity.org/cis-benchmarks"
49
+ },
50
+ {
51
+ "title": "Kubernetes documentation: configuration best practices",
52
+ "url": "https://kubernetes.io/docs/concepts/configuration/overview/"
53
+ },
41
54
  {
42
55
  "title": "Terraform documentation",
43
56
  "url": "https://developer.hashicorp.com/terraform/docs"
@@ -51,8 +64,12 @@
51
64
  "url": "https://www.finops.org/framework/"
52
65
  },
53
66
  {
54
- "title": "CNCF Cloud Native Landscape",
55
- "url": "https://landscape.cncf.io/"
67
+ "title": "Humble, Farley: Continuous Delivery",
68
+ "url": "https://continuousdelivery.com/"
69
+ },
70
+ {
71
+ "title": "Ford, Parsons, Kua, Sadalage: Building Evolutionary Architectures, 2nd ed.",
72
+ "url": "https://www.oreilly.com/library/view/building-evolutionary-architectures/9781492097532/"
56
73
  }
57
74
  ],
58
75
  "templateParams": [
@@ -60,13 +77,13 @@
60
77
  "key": "HOSTING",
61
78
  "title": "Hosting",
62
79
  "label": "How does the element run?",
63
- "hint": "The hosting model decides how much of the platform the team runs itself, what the element may do (long requests, background work, state), and how it scales and is billed.",
80
+ "hint": "The hosting model decides how much of the platform the team runs itself, what the element may do (long requests, background work, state), and how it scales and is billed. A database's engine is hosted as the Data store pack decides.",
64
81
  "defaultValue": "paas",
65
82
  "options": [
66
83
  {
67
84
  "value": "paas",
68
85
  "label": "a managed container platform (PaaS)",
69
- "description": "The provider runs the platform; you hand it a container or code. Google Cloud Run, Azure Container Apps or App Service, AWS App Runner or ECS on Fargate. Pick it by default for web apps and APIs when no platform team exists."
86
+ "description": "The provider runs the platform; you hand it a container or code. Google Cloud Run, Azure Container Apps or App Service, AWS App Runner or ECS on Fargate. Pick it by default for web apps and APIs when no platform team exists. In our own data centre there is no provider to run it: it is provided on our Kubernetes with Knative instead."
70
87
  },
71
88
  {
72
89
  "value": "kubernetes",
@@ -76,12 +93,17 @@
76
93
  {
77
94
  "value": "serverless",
78
95
  "label": "serverless functions",
79
- "description": "AWS Lambda, Azure Functions or Google Cloud Functions, run per event and billed per invocation. Pick it for spiky or event-driven work with short executions, when idle cost should be zero."
96
+ "description": "AWS Lambda, Azure Functions or Google Cloud Functions, run per event and billed per invocation. Pick it for spiky or event-driven work with short executions, when idle cost should be zero. In our own data centre there is no provider to run it: functions run on our Kubernetes with Knative Functions or OpenFaaS instead."
80
97
  },
81
98
  {
82
99
  "value": "vms",
83
100
  "label": "virtual machines",
84
101
  "description": "Virtual machines built from images, behind a load balancer. Pick it for software that cannot be containerised (licensed products, legacy runtimes, special kernels) or an on-premises virtualisation platform."
102
+ },
103
+ {
104
+ "value": "cdn",
105
+ "label": "static files on object storage behind a CDN",
106
+ "description": "Pre-built files in a private bucket served through a CDN with TLS: Amazon CloudFront with S3, Azure Front Door with Blob Storage, Cloud CDN with Cloud Storage, or a static host (Cloudflare Pages, Netlify). Pick it for a front end built in advance (the Frontend stack pack's static rendering) or documentation; nothing runs on request."
85
107
  }
86
108
  ]
87
109
  },
@@ -105,12 +127,12 @@
105
127
  {
106
128
  "value": "gcp",
107
129
  "label": "Google Cloud",
108
- "description": "Strong in Kubernetes (GKE), data and analytics (BigQuery) and Cloud Run. Pick it when those services decide, or the team knows Google Cloud."
130
+ "description": "Strong in Kubernetes (GKE), data and analytics (BigQuery) and Cloud Run. Pick it when those services decide, or the team knows Google Cloud. Its own infrastructure tool (Infrastructure Manager) runs Terraform: answer Terraform below."
109
131
  },
110
132
  {
111
133
  "value": "onprem",
112
134
  "label": "our own data centre",
113
- "description": "Servers and virtualisation we run. Pick it when data may not leave the premises, the load is steady enough that owned hardware is cheaper, or regulation demands it, and people run the hardware."
135
+ "description": "Servers and virtualisation we run. Pick it when data may not leave the premises, the load is steady enough that owned hardware is cheaper, or regulation demands it, and people run the hardware. A managed platform or functions are then provided on our own Kubernetes (Knative), the cloud's own infrastructure tool means Terraform, and no cloud budget applies."
114
136
  }
115
137
  ]
116
138
  },
@@ -133,8 +155,8 @@
133
155
  },
134
156
  {
135
157
  "value": "native",
136
- "label": "the cloud's own (Bicep, CloudFormation or CDK)",
137
- "description": "Azure Bicep, AWS CloudFormation or the AWS CDK, with state kept by the cloud. Pick it when only one cloud is used and its newest features matter on the day they ship."
158
+ "label": "the cloud's own (CloudFormation or CDK on AWS, Bicep on Azure)",
159
+ "description": "AWS CloudFormation or the AWS CDK, or Azure Bicep, with state kept by the cloud. Pick it when only one of these two clouds is used and its newest features matter on the day they ship. Not with Google Cloud (its Infrastructure Manager runs Terraform) or our own data centre: with those, the infrastructure is written in Terraform."
138
160
  }
139
161
  ]
140
162
  },
@@ -158,25 +180,25 @@
158
180
  {
159
181
  "value": "minimal",
160
182
  "label": "one test environment and production",
161
- "description": "A single shared test environment, and production with canary releases. Pick it for small systems and teams that release small changes often with fast rollback."
183
+ "description": "A single shared test environment, and production where releases are proven as the Deployment and rollback pack decides (canaries, rollback). Pick it for small systems and teams that release small changes often with fast rollback."
162
184
  }
163
185
  ]
164
186
  },
165
187
  {
166
188
  "key": "BUDGET_MONTHLY",
167
- "label": "What is the monthly cloud budget (in the billing currency)?",
189
+ "label": "What is the monthly cloud budget of the account or subscription (in the billing currency)? One per account: bind it once. Only in a public cloud",
168
190
  "defaultValue": "5000",
169
191
  "type": "number"
170
192
  },
171
193
  {
172
194
  "key": "BUDGET_ALERT_PERCENT",
173
- "label": "At what share of the budget, forecast for the month, does an alert go out (%)?",
195
+ "label": "At what share of the budget, forecast for the month, does an alert go out (%)? Only in a public cloud",
174
196
  "defaultValue": "80",
175
197
  "type": "number"
176
198
  },
177
199
  {
178
200
  "key": "COST_STEP",
179
- "label": "Above what monthly cost increase does a change need the budget owner's approval?",
201
+ "label": "Above what monthly cost increase does a change need the budget owner's approval (billing currency)? Only in a public cloud",
180
202
  "defaultValue": "500",
181
203
  "type": "number"
182
204
  },
@@ -203,7 +225,7 @@
203
225
  "y": 0,
204
226
  "kind": "brief",
205
227
  "source": "Hub concern pack: Infrastructure",
206
- "description": "The element has to run somewhere that suits its load and the team's skills, and that somewhere has to be built from reviewed code, so it can be rebuilt after a disaster and repeated for every environment. Test environments must behave like production, nothing may change outside the code unnoticed, and the bill must stay within a known budget, with warnings before it is exceeded rather than after."
228
+ "description": "The element has to run somewhere that suits its load and the team's skills, and that somewhere has to be built from reviewed code, so it can be rebuilt after a disaster and repeated for every environment. Test environments must behave like production, nothing may change outside the code unnoticed, and the bill must stay within a known budget, with warnings before it is exceeded rather than after. The checks assume one infrastructure repository with envs/<environment>/ holding each environment's root (staging, production, test), policies/ holding the policy files, charts/<name> holding a Helm chart, infra/ holding CloudFormation or Bicep templates, and ephemeral environments named pr-<number>."
207
229
  },
208
230
  {
209
231
  "id": "req-iac",
@@ -212,7 +234,7 @@
212
234
  "x": 260,
213
235
  "y": 0,
214
236
  "ears_type": "ubiquitous",
215
- "action": "define 100% of the infrastructure in {{IAC}} code in version control, applied only by the pipeline after a reviewed plan, with 0 changes made by hand to staging or production",
237
+ "action": "define 100% of the infrastructure as code in version control, in the tool the infrastructure-as-code decision names, applied only by the pipeline after a reviewed plan, with 0 changes made by hand to any shared environment",
216
238
  "rationale": "Code can be reviewed, repeated and rebuilt after a disaster; a console click can do none of these (AWS Well-Architected, Operational Excellence: perform operations as code)."
217
239
  },
218
240
  {
@@ -223,7 +245,7 @@
223
245
  "y": 130,
224
246
  "ears_type": "event-driven",
225
247
  "trigger": "a plan for an infrastructure change is produced",
226
- "action": "check it against the security and tagging baseline (encryption at rest, no public storage, no administration port open to the internet, owner, environment and cost-centre tags on every resource) and refuse to apply it on any failed check",
248
+ "action": "check it against the security and tagging baseline (encryption at rest, no public storage, no administration port open to the internet, owner, environment and cost-centre tags on every taggable resource) and refuse to apply it on any failed check",
227
249
  "rationale": "Misconfiguration is the commonest cause of cloud breaches; a check before apply costs nothing compared to one after (CIS Benchmarks; Azure Well-Architected, Security)."
228
250
  },
229
251
  {
@@ -233,7 +255,7 @@
233
255
  "x": 260,
234
256
  "y": 260,
235
257
  "ears_type": "ubiquitous",
236
- "action": "build every environment from the same infrastructure code and deploy the same artefacts to it, differing from production only in size and configuration values, with the same engine versions of every backing service",
258
+ "action": "build every environment from the same infrastructure code and deploy the same artefacts to it, differing from production only in the values of its variable files, with the same engine versions of every backing service",
237
259
  "rationale": "Gaps between environments in time, people and tools hide the bugs that only production shows (The Twelve-Factor App, X. Dev/prod parity)."
238
260
  },
239
261
  {
@@ -254,9 +276,16 @@
254
276
  "x": 260,
255
277
  "y": 520,
256
278
  "ears_type": "event-driven",
257
- "trigger": "the forecast spend for the month reaches {{BUDGET_ALERT_PERCENT}}% of the budget of {{BUDGET_MONTHLY}}",
279
+ "trigger": "the forecast spend of the account for the month reaches {{BUDGET_ALERT_PERCENT}}% of its budget of {{BUDGET_MONTHLY}}",
258
280
  "action": "alert the owning team and the budget owner the same day, with the services that grew",
259
- "rationale": "Cloud spend grows quietly; a forecast alert leaves time to act within the month (FinOps Framework, budget management; AWS Well-Architected, Cost Optimization)."
281
+ "rationale": "Cloud spend grows quietly; a forecast alert leaves time to act within the month (FinOps Framework, budget management; AWS Well-Architected, Cost Optimization).",
282
+ "hubWhen": {
283
+ "CLOUD": [
284
+ "aws",
285
+ "azure",
286
+ "gcp"
287
+ ]
288
+ }
260
289
  },
261
290
  {
262
291
  "id": "req-cost-review",
@@ -267,20 +296,97 @@
267
296
  "ears_type": "event-driven",
268
297
  "trigger": "a change to the infrastructure code is proposed",
269
298
  "action": "show its estimated monthly cost change in the pull request, and require the budget owner's approval when it adds more than {{COST_STEP}} a month",
270
- "rationale": "The cheapest moment to question a cost is before it is incurred (FinOps Framework, shift-left cost estimation)."
299
+ "rationale": "The cheapest moment to question a cost is before it is incurred (FinOps Framework, shift-left cost estimation).",
300
+ "hubWhen": {
301
+ "IAC": [
302
+ "terraform"
303
+ ],
304
+ "CLOUD": [
305
+ "aws",
306
+ "azure",
307
+ "gcp"
308
+ ]
309
+ }
310
+ },
311
+ {
312
+ "id": "req-cost-review-fallback",
313
+ "type": "requirement",
314
+ "label": "Cost shown in review",
315
+ "x": 260,
316
+ "y": 780,
317
+ "ears_type": "event-driven",
318
+ "trigger": "a change to the infrastructure code is proposed",
319
+ "action": "show its estimated monthly cost change in the pull request, and require the budget owner's approval when it adds more than {{COST_STEP}} a month",
320
+ "rationale": "The cheapest moment to question a cost is before it is incurred (FinOps Framework, shift-left cost estimation).",
321
+ "hubWhen": {
322
+ "IAC": [
323
+ "native"
324
+ ],
325
+ "CLOUD": [
326
+ "gcp"
327
+ ]
328
+ }
329
+ },
330
+ {
331
+ "id": "req-cost-estimate",
332
+ "type": "requirement",
333
+ "label": "Cost estimated in review",
334
+ "x": 260,
335
+ "y": 910,
336
+ "ears_type": "event-driven",
337
+ "trigger": "a change to the infrastructure code adds or resizes a priced resource",
338
+ "action": "attach the provider's pricing-calculator estimate of the monthly change to the pull request, and require the budget owner's approval when it adds more than {{COST_STEP}} a month",
339
+ "rationale": "The cheapest moment to question a cost is before it is incurred; no estimator reads Pulumi or CloudFormation code, so the reviewer makes the estimate (FinOps Framework, shift-left cost estimation).",
340
+ "unchecked": "No tool estimates the cost of Pulumi, CloudFormation or Bicep changes: the reviewer attaches the pricing-calculator estimate to each infrastructure pull request, and the budget owner approves in the review above {{COST_STEP}} a month before it is merged.",
341
+ "hubWhen": {
342
+ "IAC": [
343
+ "pulumi"
344
+ ],
345
+ "CLOUD": [
346
+ "aws",
347
+ "azure",
348
+ "gcp"
349
+ ]
350
+ }
351
+ },
352
+ {
353
+ "id": "req-cost-estimate-native",
354
+ "type": "requirement",
355
+ "label": "Cost estimated in review",
356
+ "x": 260,
357
+ "y": 1040,
358
+ "ears_type": "event-driven",
359
+ "trigger": "a change to the infrastructure code adds or resizes a priced resource",
360
+ "action": "attach the provider's pricing-calculator estimate of the monthly change to the pull request, and require the budget owner's approval when it adds more than {{COST_STEP}} a month",
361
+ "rationale": "The cheapest moment to question a cost is before it is incurred; no estimator reads Pulumi or CloudFormation code, so the reviewer makes the estimate (FinOps Framework, shift-left cost estimation).",
362
+ "unchecked": "No tool estimates the cost of Pulumi, CloudFormation or Bicep changes: the reviewer attaches the pricing-calculator estimate to each infrastructure pull request, and the budget owner approves in the review above {{COST_STEP}} a month before it is merged.",
363
+ "hubWhen": {
364
+ "IAC": [
365
+ "native"
366
+ ],
367
+ "CLOUD": [
368
+ "aws",
369
+ "azure"
370
+ ]
371
+ }
271
372
  },
272
373
  {
273
374
  "id": "req-paas",
274
375
  "type": "requirement",
275
376
  "label": "Stateless and scaled",
276
377
  "x": 260,
277
- "y": 780,
378
+ "y": 1170,
278
379
  "ears_type": "ubiquitous",
279
380
  "action": "keep the element stateless, with no local file or session surviving an instance restart, run at least 2 instances in production and scale out automatically on load",
280
381
  "rationale": "A platform may stop or move any instance at any time; stateless processes make that harmless (The Twelve-Factor App, VI. Processes and IX. Disposability).",
281
382
  "hubWhen": {
282
383
  "HOSTING": [
283
384
  "paas"
385
+ ],
386
+ "CLOUD": [
387
+ "aws",
388
+ "azure",
389
+ "gcp"
284
390
  ]
285
391
  }
286
392
  },
@@ -289,28 +395,52 @@
289
395
  "type": "requirement",
290
396
  "label": "Workloads well specified",
291
397
  "x": 260,
292
- "y": 910,
398
+ "y": 1300,
293
399
  "ears_type": "ubiquitous",
294
- "action": "give every workload resource requests and limits, readiness and liveness probes, at least 2 replicas with a PodDisruptionBudget in production, and a non-root, read-only root file system",
295
- "rationale": "Without these the scheduler cannot place, protect or restart pods correctly, and one pod can starve its node (Kubernetes documentation, configuration best practices; CIS Kubernetes Benchmark).",
400
+ "action": "give every workload CPU and memory requests and a memory limit, readiness and liveness probes, at least 2 replicas with a PodDisruptionBudget in production, and a non-root, read-only root file system",
401
+ "rationale": "Without these the scheduler cannot place, protect or restart pods correctly, and one pod can starve its node (Kubernetes documentation, configuration best practices; CIS Benchmarks for Kubernetes).",
296
402
  "hubWhen": {
297
403
  "HOSTING": [
298
404
  "kubernetes"
299
405
  ]
300
406
  }
301
407
  },
408
+ {
409
+ "id": "req-k8s-onprem",
410
+ "type": "requirement",
411
+ "label": "Workloads well specified",
412
+ "x": 260,
413
+ "y": 1430,
414
+ "ears_type": "ubiquitous",
415
+ "action": "give every workload CPU and memory requests and a memory limit, readiness and liveness probes, at least 2 replicas with a PodDisruptionBudget in production, and a non-root, read-only root file system",
416
+ "rationale": "Without these the scheduler cannot place, protect or restart pods correctly, and one pod can starve its node (Kubernetes documentation, configuration best practices; CIS Benchmarks for Kubernetes).",
417
+ "hubWhen": {
418
+ "HOSTING": [
419
+ "paas",
420
+ "serverless"
421
+ ],
422
+ "CLOUD": [
423
+ "onprem"
424
+ ]
425
+ }
426
+ },
302
427
  {
303
428
  "id": "req-functions",
304
429
  "type": "requirement",
305
430
  "label": "Functions bounded",
306
431
  "x": 260,
307
- "y": 1040,
432
+ "y": 1560,
308
433
  "ears_type": "ubiquitous",
309
- "action": "give every function a timeout shorter than its caller's, a concurrency limit that protects what it calls, a dead-letter queue for failed events, and a 95th-percentile cold start under 1 second",
310
- "rationale": "Unbounded functions scale until something downstream breaks, and silently lose failed events (AWS Well-Architected Serverless Applications Lens).",
434
+ "action": "give every function a concurrency or instance limit that protects what it calls, and a dead-letter queue or failure destination for failed asynchronous events; cold starts are bounded as the Capacity and scaling pack decides",
435
+ "rationale": "Unbounded functions scale until something downstream breaks, and silently lose failed events (AWS Well-Architected, Serverless Applications Lens).",
311
436
  "hubWhen": {
312
437
  "HOSTING": [
313
438
  "serverless"
439
+ ],
440
+ "CLOUD": [
441
+ "aws",
442
+ "azure",
443
+ "gcp"
314
444
  ]
315
445
  }
316
446
  },
@@ -319,10 +449,10 @@
319
449
  "type": "requirement",
320
450
  "label": "Machines are replaced",
321
451
  "x": 260,
322
- "y": 1170,
452
+ "y": 1690,
323
453
  "ears_type": "ubiquitous",
324
- "action": "build every machine from a versioned image and replace machines instead of changing them, with 0 changes over SSH in production and no machine running an image older than 30 days",
325
- "rationale": "Machines changed by hand drift apart and cannot be rebuilt; images rebuilt monthly carry the operating system's patches (immutable infrastructure; AWS Well-Architected, Reliability).",
454
+ "action": "build every machine from a versioned image that records its build time, replace machines instead of changing them, with 0 changes over SSH in production and no machine running an image older than 30 days",
455
+ "rationale": "Machines changed by hand drift apart and cannot be rebuilt; images rebuilt monthly carry the operating system's patches (AWS Well-Architected, Reliability: immutable infrastructure).",
326
456
  "hubWhen": {
327
457
  "HOSTING": [
328
458
  "vms"
@@ -330,18 +460,17 @@
330
460
  }
331
461
  },
332
462
  {
333
- "id": "req-capacity",
463
+ "id": "req-cdn",
334
464
  "type": "requirement",
335
- "label": "Capacity headroom kept",
465
+ "label": "Served only through the CDN",
336
466
  "x": 260,
337
- "y": 1300,
338
- "ears_type": "state-driven",
339
- "precondition": "the element runs in our own data centre",
340
- "action": "keep at least 30% spare CPU, memory and storage at peak, and order hardware when the forecast shows the headroom gone within 6 months",
341
- "rationale": "In a data centre new capacity takes months to arrive; the headroom absorbs growth and a failed host in the meantime (Google SRE Book, ch. 18: capacity planning).",
467
+ "y": 1820,
468
+ "ears_type": "ubiquitous",
469
+ "action": "serve the files only through the CDN over TLS with HSTS, from an origin bucket that refuses direct requests, with every content-hashed asset cached for a year and every HTML page revalidated on each request",
470
+ "rationale": "An origin reachable directly bypasses the CDN's TLS, caching and protections; a hashed asset never changes, so it can be cached for a year, while a page cached without revalidation keeps users on an old build after a publish (AWS Well-Architected, Security and Performance Efficiency).",
342
471
  "hubWhen": {
343
- "CLOUD": [
344
- "onprem"
472
+ "HOSTING": [
473
+ "cdn"
345
474
  ]
346
475
  }
347
476
  },
@@ -350,7 +479,7 @@
350
479
  "type": "requirement",
351
480
  "label": "Ephemeral environments cleaned up",
352
481
  "x": 260,
353
- "y": 1430,
482
+ "y": 1950,
354
483
  "ears_type": "event-driven",
355
484
  "trigger": "a pull request is closed, or its environment has been idle for {{EPHEMERAL_HOURS}} hours",
356
485
  "action": "destroy its environment and everything in it within 1 hour",
@@ -364,31 +493,17 @@
364
493
  {
365
494
  "id": "req-staging",
366
495
  "type": "requirement",
367
- "label": "Staging mirrors production",
368
- "x": 260,
369
- "y": 1560,
370
- "ears_type": "ubiquitous",
371
- "action": "run staging with the same topology as production (zones, replicas of every backing service, network rules), scaled down, and promote to production only the artefact tested there",
372
- "rationale": "A staging environment that differs in topology hides failover and networking bugs; promoting the tested artefact keeps the test meaningful (Humble, Farley: Continuous Delivery).",
373
- "hubWhen": {
374
- "ENVIRONMENTS": [
375
- "staged"
376
- ]
377
- }
378
- },
379
- {
380
- "id": "req-canary",
381
- "type": "requirement",
382
- "label": "Releases start as canaries",
496
+ "label": "Tested artefact promoted",
383
497
  "x": 260,
384
- "y": 1690,
498
+ "y": 2080,
385
499
  "ears_type": "event-driven",
386
- "trigger": "a release is deployed to production",
387
- "action": "send it at most 10% of traffic for at least 15 minutes, and roll it back automatically when its error rate or latency is worse than the current version's",
388
- "rationale": "Without a staging environment, production is where releases are proved; a canary limits who is affected (Google SRE Workbook, canarying releases).",
500
+ "trigger": "a release is promoted to production",
501
+ "action": "deploy exactly the artefact, by digest, that the latest staging deployment tested",
502
+ "rationale": "Promoting the tested artefact, not a rebuild, keeps the staging test meaningful (Humble, Farley: Continuous Delivery).",
389
503
  "hubWhen": {
390
504
  "ENVIRONMENTS": [
391
- "minimal"
505
+ "staged",
506
+ "ephemeral"
392
507
  ]
393
508
  }
394
509
  },
@@ -400,7 +515,7 @@
400
515
  "y": 0,
401
516
  "given": "a change to the infrastructure",
402
517
  "when": "it is proposed",
403
- "then": "it arrives as a pull request with a plan, and only the pipeline applies it after review"
518
+ "then": "it arrives as a pull request with a plan, only the pipeline applies it after review, and a change made by hand shows up in the next drift check"
404
519
  },
405
520
  {
406
521
  "id": "sc-policy",
@@ -418,9 +533,9 @@
418
533
  "label": "Same code everywhere",
419
534
  "x": 520,
420
535
  "y": 260,
421
- "given": "the staging and production definitions",
536
+ "given": "the test environment's and production's folders under envs/",
422
537
  "when": "they are compared",
423
- "then": "they use the same modules and versions, and differ only in variables for size and configuration"
538
+ "then": "they differ only in their variable files"
424
539
  },
425
540
  {
426
541
  "id": "sc-drift",
@@ -438,9 +553,16 @@
438
553
  "label": "Forecast alert",
439
554
  "x": 520,
440
555
  "y": 520,
441
- "given": "a monthly budget of {{BUDGET_MONTHLY}}",
556
+ "given": "an account with a monthly budget of {{BUDGET_MONTHLY}}",
442
557
  "when": "the forecast passes {{BUDGET_ALERT_PERCENT}}% of it",
443
- "then": "the owning team and the budget owner are alerted the same day"
558
+ "then": "the owning team and the budget owner are alerted the same day",
559
+ "hubWhen": {
560
+ "CLOUD": [
561
+ "aws",
562
+ "azure",
563
+ "gcp"
564
+ ]
565
+ }
444
566
  },
445
567
  {
446
568
  "id": "sc-cost-review",
@@ -450,20 +572,92 @@
450
572
  "y": 650,
451
573
  "given": "a pull request that adds a large database instance",
452
574
  "when": "the cost estimate shows more than {{COST_STEP}} a month",
453
- "then": "the pull request cannot be merged without the budget owner's approval"
575
+ "then": "the pull request cannot be merged until the budget owner adds the budget-approved label",
576
+ "hubWhen": {
577
+ "IAC": [
578
+ "terraform"
579
+ ],
580
+ "CLOUD": [
581
+ "aws",
582
+ "azure",
583
+ "gcp"
584
+ ]
585
+ }
586
+ },
587
+ {
588
+ "id": "sc-cost-review-fallback",
589
+ "type": "scenario",
590
+ "label": "Costly change approved",
591
+ "x": 520,
592
+ "y": 780,
593
+ "given": "a pull request that adds a large database instance",
594
+ "when": "the cost estimate shows more than {{COST_STEP}} a month",
595
+ "then": "the pull request cannot be merged until the budget owner adds the budget-approved label",
596
+ "hubWhen": {
597
+ "IAC": [
598
+ "native"
599
+ ],
600
+ "CLOUD": [
601
+ "gcp"
602
+ ]
603
+ }
604
+ },
605
+ {
606
+ "id": "sc-cost-estimate",
607
+ "type": "scenario",
608
+ "label": "Costly change approved",
609
+ "x": 520,
610
+ "y": 910,
611
+ "given": "a pull request that adds a large database instance",
612
+ "when": "the reviewer's estimate shows more than {{COST_STEP}} a month",
613
+ "then": "the pull request is not merged until the budget owner approves it",
614
+ "hubWhen": {
615
+ "IAC": [
616
+ "pulumi"
617
+ ],
618
+ "CLOUD": [
619
+ "aws",
620
+ "azure",
621
+ "gcp"
622
+ ]
623
+ }
624
+ },
625
+ {
626
+ "id": "sc-cost-estimate-native",
627
+ "type": "scenario",
628
+ "label": "Costly change approved",
629
+ "x": 520,
630
+ "y": 1040,
631
+ "given": "a pull request that adds a large database instance",
632
+ "when": "the reviewer's estimate shows more than {{COST_STEP}} a month",
633
+ "then": "the pull request is not merged until the budget owner approves it",
634
+ "hubWhen": {
635
+ "IAC": [
636
+ "native"
637
+ ],
638
+ "CLOUD": [
639
+ "aws",
640
+ "azure"
641
+ ]
642
+ }
454
643
  },
455
644
  {
456
645
  "id": "sc-paas",
457
646
  "type": "scenario",
458
647
  "label": "Instance lost harmlessly",
459
648
  "x": 520,
460
- "y": 780,
461
- "given": "two instances serving traffic",
462
- "when": "one is stopped by the platform",
463
- "then": "no request or session is lost beyond retries, and a replacement starts",
649
+ "y": 1170,
650
+ "given": "the production service with its scaling settings read",
651
+ "when": "one of its instances is stopped by the platform",
652
+ "then": "at least 2 were running, a replacement starts within the autoscaling range, and no request or session is lost beyond retries",
464
653
  "hubWhen": {
465
654
  "HOSTING": [
466
655
  "paas"
656
+ ],
657
+ "CLOUD": [
658
+ "aws",
659
+ "azure",
660
+ "gcp"
467
661
  ]
468
662
  }
469
663
  },
@@ -472,8 +666,8 @@
472
666
  "type": "scenario",
473
667
  "label": "Incomplete manifest refused",
474
668
  "x": 520,
475
- "y": 910,
476
- "given": "a deployment without resource limits or a readiness probe",
669
+ "y": 1300,
670
+ "given": "a deployment without a memory limit or a readiness probe",
477
671
  "when": "the manifest check runs",
478
672
  "then": "it fails naming what is missing",
479
673
  "hubWhen": {
@@ -482,18 +676,42 @@
482
676
  ]
483
677
  }
484
678
  },
679
+ {
680
+ "id": "sc-k8s-onprem",
681
+ "type": "scenario",
682
+ "label": "Incomplete manifest refused",
683
+ "x": 520,
684
+ "y": 1430,
685
+ "given": "a deployment without a memory limit or a readiness probe",
686
+ "when": "the manifest check runs",
687
+ "then": "it fails naming what is missing",
688
+ "hubWhen": {
689
+ "HOSTING": [
690
+ "paas",
691
+ "serverless"
692
+ ],
693
+ "CLOUD": [
694
+ "onprem"
695
+ ]
696
+ }
697
+ },
485
698
  {
486
699
  "id": "sc-functions",
487
700
  "type": "scenario",
488
701
  "label": "Burst stays bounded",
489
702
  "x": 520,
490
- "y": 1040,
703
+ "y": 1560,
491
704
  "given": "a burst of events far above normal",
492
705
  "when": "the functions process it",
493
706
  "then": "concurrency stays at its limit, the database is not overloaded, and failed events land in the dead-letter queue",
494
707
  "hubWhen": {
495
708
  "HOSTING": [
496
709
  "serverless"
710
+ ],
711
+ "CLOUD": [
712
+ "aws",
713
+ "azure",
714
+ "gcp"
497
715
  ]
498
716
  }
499
717
  },
@@ -502,10 +720,10 @@
502
720
  "type": "scenario",
503
721
  "label": "Old image replaced",
504
722
  "x": 520,
505
- "y": 1170,
506
- "given": "a machine running an image 31 days old",
507
- "when": "the image age check runs",
508
- "then": "it fails and the machine is replaced from the current image",
723
+ "y": 1690,
724
+ "given": "a machine whose image was built 31 days ago",
725
+ "when": "the image-age alert evaluates",
726
+ "then": "it fires and the machine is replaced from the current image",
509
727
  "hubWhen": {
510
728
  "HOSTING": [
511
729
  "vms"
@@ -513,17 +731,17 @@
513
731
  }
514
732
  },
515
733
  {
516
- "id": "sc-capacity",
734
+ "id": "sc-cdn",
517
735
  "type": "scenario",
518
- "label": "Headroom forecast",
736
+ "label": "Origin refuses direct request",
519
737
  "x": 520,
520
- "y": 1300,
521
- "given": "the capacity report",
522
- "when": "the forecast shows headroom below 30% within 6 months",
523
- "then": "a hardware order is raised",
738
+ "y": 1820,
739
+ "given": "the deployed site",
740
+ "when": "a page and one of its hashed assets are requested through the CDN, and the page directly from the origin",
741
+ "then": "the CDN answers over TLS with HSTS, the page marked for revalidation and the asset cached for a year, and the origin refuses",
524
742
  "hubWhen": {
525
- "CLOUD": [
526
- "onprem"
743
+ "HOSTING": [
744
+ "cdn"
527
745
  ]
528
746
  }
529
747
  },
@@ -532,7 +750,7 @@
532
750
  "type": "scenario",
533
751
  "label": "Environment removed",
534
752
  "x": 520,
535
- "y": 1430,
753
+ "y": 1950,
536
754
  "given": "an ephemeral environment of a pull request",
537
755
  "when": "the pull request is merged",
538
756
  "then": "within 1 hour the environment and its resources are gone",
@@ -547,28 +765,14 @@
547
765
  "type": "scenario",
548
766
  "label": "Tested artefact promoted",
549
767
  "x": 520,
550
- "y": 1560,
768
+ "y": 2080,
551
769
  "given": "a build tested on staging",
552
770
  "when": "it is released",
553
- "then": "the same artefact, by digest, runs in production",
554
- "hubWhen": {
555
- "ENVIRONMENTS": [
556
- "staged"
557
- ]
558
- }
559
- },
560
- {
561
- "id": "sc-canary",
562
- "type": "scenario",
563
- "label": "Bad canary rolled back",
564
- "x": 520,
565
- "y": 1690,
566
- "given": "a release whose error rate doubles",
567
- "when": "it serves 10% of traffic",
568
- "then": "it is rolled back automatically before reaching more users",
771
+ "then": "the same artefact, by digest, runs in production, and a different digest is refused",
569
772
  "hubWhen": {
570
773
  "ENVIRONMENTS": [
571
- "minimal"
774
+ "staged",
775
+ "ephemeral"
572
776
  ]
573
777
  }
574
778
  },
@@ -582,12 +786,17 @@
582
786
  "status": "accepted",
583
787
  "date": "",
584
788
  "context": "This element is deployed and runs somewhere, and that somewhere has to be chosen, built and paid for. The forces: managed platforms take operations work off the team but limit what can run and tie it to a provider, while Kubernetes and virtual machines run anything at the price of running them; the cloud or data centre is chosen once and rarely left, by skills, existing contracts, services needed and where data may live; infrastructure built by hand in a console cannot be reviewed, repeated or rebuilt after a disaster; environments that differ from production hide the bugs that only production shows; cloud spend grows quietly with every resource nobody switches off; and changes made outside the code drift from it until the next apply undoes or breaks them.",
585
- "decision": "The element runs as a container on a managed platform in {{CLOUD}}: Google Cloud Run, Azure Container Apps (App Service for plain web apps), or AWS App Runner or ECS on Fargate; on premises, OpenShift or a similar platform run by a platform team. Infrastructure is built with {{IAC}}; environments: {{ENVIRONMENTS}}. Monthly budget {{BUDGET_MONTHLY}}, alert at {{BUDGET_ALERT_PERCENT}}%, drift checked every {{DRIFT_HOURS}} hours. Choosing the platform: the one in the chosen cloud that runs plain containers with scale-to-zero or autoscaling and managed TLS; avoid platform-specific build packs so the container can move.",
586
- "consequences": "• No nodes, clusters or operating systems to patch; scaling, TLS and rollouts come with the platform.\n• Limits on what can run: request timeouts, no privileged containers, limited networking and sidecars.\n• Tied to the provider's platform, but a plain container moves to another with little change.\n• Per-request or per-instance billing; idle cost near zero on platforms that scale to zero.",
789
+ "decision": "The element runs as a container on a managed platform in {{CLOUD}}: Google Cloud Run, Azure Container Apps (App Service for plain web apps), or AWS App Runner or ECS on Fargate, with at least 2 instances in production and autoscaling above them. The infrastructure is code, written and checked as the infrastructure-as-code decision records and applied only by the pipeline; environments: {{ENVIRONMENTS}}, built from envs/<environment>/ in one repository; drift checked every {{DRIFT_HOURS}} hours. Rollouts and canaries: as decided in the Deployment and rollback pack. Capacity and scaling: as decided in the Capacity and scaling pack. The engine of a database: hosted as decided in the Data store pack. Choosing the platform: the one in the chosen cloud that runs plain containers with scale-to-zero or autoscaling and managed TLS; avoid platform-specific build packs so the container can move.",
790
+ "consequences": "• No nodes, clusters or operating systems to patch; scaling, TLS and rollouts come with the platform.\n• Limits on what can run: request timeouts, no privileged containers, limited networking and sidecars.\n• Tied to the provider's platform, but a plain container moves to another with little change.\n• Per-request or per-instance billing; two instances kept warm are the floor of the bill.",
587
791
  "alternatives": "1. Kubernetes: runs anything, at the cost of running a cluster.\n2. Serverless functions: lower idle cost, a different programming model.\n3. Virtual machines: full control, all the operations work.",
588
792
  "hubWhen": {
589
793
  "HOSTING": [
590
794
  "paas"
795
+ ],
796
+ "CLOUD": [
797
+ "aws",
798
+ "azure",
799
+ "gcp"
591
800
  ]
592
801
  }
593
802
  },
@@ -601,7 +810,7 @@
601
810
  "status": "accepted",
602
811
  "date": "",
603
812
  "context": "This element is deployed and runs somewhere, and that somewhere has to be chosen, built and paid for. The forces: managed platforms take operations work off the team but limit what can run and tie it to a provider, while Kubernetes and virtual machines run anything at the price of running them; the cloud or data centre is chosen once and rarely left, by skills, existing contracts, services needed and where data may live; infrastructure built by hand in a console cannot be reviewed, repeated or rebuilt after a disaster; environments that differ from production hide the bugs that only production shows; cloud spend grows quietly with every resource nobody switches off; and changes made outside the code drift from it until the next apply undoes or breaks them.",
604
- "decision": "The element runs as containers on Kubernetes in {{CLOUD}}: Amazon EKS, Azure AKS or Google GKE (Autopilot where it fits), or OpenShift or Rancher on premises. Manifests are Helm charts or Kustomize overlays deployed by GitOps (Argo CD or Flux); the clusters themselves are built with {{IAC}}; environments: {{ENVIRONMENTS}}. Every workload has requests and limits, probes, a PodDisruptionBudget and runs as non-root. Monthly budget {{BUDGET_MONTHLY}}, alert at {{BUDGET_ALERT_PERCENT}}%, drift checked every {{DRIFT_HOURS}} hours (Argo CD shows drift of the manifests). Choose Kubernetes only with a platform team, or a managed offering that removes node operations.",
813
+ "decision": "The element runs as containers on Kubernetes in {{CLOUD}}: Amazon EKS, Azure AKS or Google GKE (Autopilot where it fits), or OpenShift or Rancher on premises. Manifests are Helm charts under charts/<name> or Kustomize overlays deployed by GitOps (Argo CD or Flux); every workload has requests and limits, probes, a PodDisruptionBudget and runs as non-root with a read-only root file system. The clusters and what surrounds them are infrastructure like any other: The infrastructure is code, written and checked as the infrastructure-as-code decision records and applied only by the pipeline; environments: {{ENVIRONMENTS}}, built from envs/<environment>/ in one repository; drift checked every {{DRIFT_HOURS}} hours. Argo CD shows drift of the manifests. Rollouts and canaries: as decided in the Deployment and rollback pack. Capacity and scaling: as decided in the Capacity and scaling pack. The engine of a database: hosted as decided in the Data store pack. Choose Kubernetes only with a platform team, or a managed offering that removes node operations.",
605
814
  "consequences": "• Runs anything that fits in a container, with the same model in every cloud and on premises.\n• A platform to run: cluster upgrades every few months (each minor is supported for about 14 months), add-ons, networking, security policies.\n• A large ecosystem (CNCF) for observability, policy, service mesh and operators, each one more thing to keep up.\n• Cost depends on packing workloads well; requests that are too high waste nodes.",
606
815
  "alternatives": "1. A managed container platform: far less to run, fewer options.\n2. Serverless functions: no cluster at all, a different programming model.\n3. Nomad or plain container hosts: simpler, smaller ecosystem.",
607
816
  "hubWhen": {
@@ -620,12 +829,17 @@
620
829
  "status": "accepted",
621
830
  "date": "",
622
831
  "context": "This element is deployed and runs somewhere, and that somewhere has to be chosen, built and paid for. The forces: managed platforms take operations work off the team but limit what can run and tie it to a provider, while Kubernetes and virtual machines run anything at the price of running them; the cloud or data centre is chosen once and rarely left, by skills, existing contracts, services needed and where data may live; infrastructure built by hand in a console cannot be reviewed, repeated or rebuilt after a disaster; environments that differ from production hide the bugs that only production shows; cloud spend grows quietly with every resource nobody switches off; and changes made outside the code drift from it until the next apply undoes or breaks them.",
623
- "decision": "The element runs as serverless functions in {{CLOUD}}: AWS Lambda, Azure Functions or Google Cloud Functions (Cloud Run functions), triggered by HTTP through an API gateway and by queues and events; on premises, Knative or OpenFaaS on the platform team's cluster. Each function has a timeout, a concurrency limit and a dead-letter queue. Infrastructure is built with {{IAC}} (or the AWS SAM or Serverless Framework on top of it); environments: {{ENVIRONMENTS}}. Monthly budget {{BUDGET_MONTHLY}}, alert at {{BUDGET_ALERT_PERCENT}}%, drift checked every {{DRIFT_HOURS}} hours. Choose functions for event-driven and spiky work with executions under a few minutes; long-running or steady-load work goes to containers.",
832
+ "decision": "The element runs as serverless functions in {{CLOUD}}: AWS Lambda, Azure Functions or Google Cloud Functions (Cloud Run functions), triggered by HTTP through an API gateway and by queues and events. Each function has a concurrency or instance limit and a dead-letter queue or failure destination for asynchronous events. The infrastructure is code, written and checked as the infrastructure-as-code decision records and applied only by the pipeline; environments: {{ENVIRONMENTS}}, built from envs/<environment>/ in one repository; drift checked every {{DRIFT_HOURS}} hours. The AWS SAM or the Serverless Framework may sit on top of the infrastructure tool. Rollouts and canaries: as decided in the Deployment and rollback pack. Capacity and scaling: as decided in the Capacity and scaling pack. The engine of a database: hosted as decided in the Data store pack. Choose functions for event-driven and spiky work with executions under a few minutes; long-running or steady-load work goes to containers.",
624
833
  "consequences": "• No servers to run; scales from zero to large bursts, billed per invocation.\n• Cold starts add latency to the first requests; execution time, payload size and connections are limited.\n• Steady high load can cost more than containers; the bill follows traffic, so budgets and alerts matter.\n• Closely tied to the provider's events, gateway and permissions model; moving is a rewrite of the glue.",
625
834
  "alternatives": "1. A managed container platform with scale-to-zero (Cloud Run, Container Apps): containers without cold-start limits on code shape.\n2. Kubernetes with KEDA for event-driven scaling.\n3. Virtual machines: steady cost, no limits, all the operations.",
626
835
  "hubWhen": {
627
836
  "HOSTING": [
628
837
  "serverless"
838
+ ],
839
+ "CLOUD": [
840
+ "aws",
841
+ "azure",
842
+ "gcp"
629
843
  ]
630
844
  }
631
845
  },
@@ -639,7 +853,7 @@
639
853
  "status": "accepted",
640
854
  "date": "",
641
855
  "context": "This element is deployed and runs somewhere, and that somewhere has to be chosen, built and paid for. The forces: managed platforms take operations work off the team but limit what can run and tie it to a provider, while Kubernetes and virtual machines run anything at the price of running them; the cloud or data centre is chosen once and rarely left, by skills, existing contracts, services needed and where data may live; infrastructure built by hand in a console cannot be reviewed, repeated or rebuilt after a disaster; environments that differ from production hide the bugs that only production shows; cloud spend grows quietly with every resource nobody switches off; and changes made outside the code drift from it until the next apply undoes or breaks them.",
642
- "decision": "The element runs on virtual machines in {{CLOUD}} (EC2 Auto Scaling groups, Azure Virtual Machine Scale Sets, Google Compute Engine managed instance groups, or VMware or Proxmox on premises), built from versioned images made with Packer and replaced rather than changed; configuration at boot with cloud-init or Ansible, and no changes over SSH in production. Infrastructure is built with {{IAC}}; environments: {{ENVIRONMENTS}}. Monthly budget {{BUDGET_MONTHLY}}, alert at {{BUDGET_ALERT_PERCENT}}%, drift checked every {{DRIFT_HOURS}} hours. Choose machines only for what cannot run in a container: licensed or legacy software, special kernels or hardware.",
856
+ "decision": "The element runs on virtual machines in {{CLOUD}} (EC2 Auto Scaling groups, Azure Virtual Machine Scale Sets, Google Compute Engine managed instance groups, or VMware or Proxmox on premises), built from versioned images made with Packer that record their build time, and replaced rather than changed; configuration at boot with cloud-init or Ansible, and no changes over SSH in production. The infrastructure is code, written and checked as the infrastructure-as-code decision records and applied only by the pipeline; environments: {{ENVIRONMENTS}}, built from envs/<environment>/ in one repository; drift checked every {{DRIFT_HOURS}} hours. Rollouts and canaries: as decided in the Deployment and rollback pack. Capacity and scaling: as decided in the Capacity and scaling pack. The engine of a database: hosted as decided in the Data store pack. Choose machines only for what cannot run in a container: licensed or legacy software, special kernels or hardware.",
643
857
  "consequences": "• Full control: any software, any kernel, any agent.\n• All the operations work: operating system patches, image builds, scaling groups, load balancers.\n• Slower to scale and to roll out than containers; images must be rebuilt at least monthly.\n• Steady, predictable cost; reserved instances or savings plans reduce it.",
644
858
  "alternatives": "1. A managed container platform: no machines to patch, if the software fits in a container.\n2. Kubernetes: containers with control, plus a cluster to run.\n3. Configuration management on long-lived machines (Ansible, Puppet): familiar, but machines drift apart.",
645
859
  "hubWhen": {
@@ -649,103 +863,470 @@
649
863
  }
650
864
  },
651
865
  {
652
- "id": "ff-checkov",
653
- "type": "fitness-fn",
654
- "label": "Plans pass policy",
655
- "x": 1040,
656
- "y": 0,
657
- "category": "structural",
658
- "threshold": "0 failed Checkov checks of the baseline (encryption, public access, open admin ports) and 0 resources without owner, environment and cost-centre tags",
659
- "description": "Checkov scans the Terraform plan (or the CloudFormation or Bicep templates) in every pull request with its built-in checks and a custom tagging policy, and fails on any finding. Terraform users can add Conftest policies over the plan JSON for rules of their own.\n\nTool: Checkov\n\n```yaml\n# policies/required_tags.yaml (custom check, run with --external-checks-dir policies)\nmetadata:\n id: CKV2_ORG_TAGS\n name: Resources carry owner, environment and cost-centre tags\n category: GENERAL_SECURITY\ndefinition:\n and:\n - { cond_type: attribute, resource_types: [aws_instance, aws_db_instance, aws_s3_bucket, aws_ecs_service, aws_lambda_function], attribute: tags.owner, operator: exists }\n - { cond_type: attribute, resource_types: [aws_instance, aws_db_instance, aws_s3_bucket, aws_ecs_service, aws_lambda_function], attribute: tags.environment, operator: exists }\n - { cond_type: attribute, resource_types: [aws_instance, aws_db_instance, aws_s3_bucket, aws_ecs_service, aws_lambda_function], attribute: tags.cost-centre, operator: exists }\n# CI:\n# terraform plan -out tf.plan && terraform show -json tf.plan > tf.json\n# checkov -f tf.json --framework terraform_plan --external-checks-dir policies --compact\n```",
866
+ "id": "adr-cdn",
867
+ "type": "adr",
868
+ "label": "Served from object storage behind a CDN",
869
+ "x": 780,
870
+ "y": 520,
871
+ "concern": "infrastructure",
872
+ "status": "accepted",
873
+ "date": "",
874
+ "context": "This element is deployed and runs somewhere, and that somewhere has to be chosen, built and paid for. The forces: managed platforms take operations work off the team but limit what can run and tie it to a provider, while Kubernetes and virtual machines run anything at the price of running them; the cloud or data centre is chosen once and rarely left, by skills, existing contracts, services needed and where data may live; infrastructure built by hand in a console cannot be reviewed, repeated or rebuilt after a disaster; environments that differ from production hide the bugs that only production shows; cloud spend grows quietly with every resource nobody switches off; and changes made outside the code drift from it until the next apply undoes or breaks them.",
875
+ "decision": "The element is a set of pre-built files in a private bucket in {{CLOUD}}, served only through a CDN over TLS with HSTS: Amazon CloudFront with S3 (origin access control), Azure Front Door with Blob Storage, Cloud CDN with Cloud Storage, or a static host such as Cloudflare Pages or Netlify; on premises, a web server with a cache in front. Hashed assets are cached for a year, HTML revalidated, as the Frontend stack pack's caching rules say. The infrastructure is code, written and checked as the infrastructure-as-code decision records and applied only by the pipeline; environments: {{ENVIRONMENTS}}, built from envs/<environment>/ in one repository; drift checked every {{DRIFT_HOURS}} hours. Rollouts and canaries: as decided in the Deployment and rollback pack. Capacity and scaling: as decided in the Capacity and scaling pack. The engine of a database: hosted as decided in the Data store pack. Choose it only when nothing runs on request; an API behind the same domain is its own element with its own hosting.",
876
+ "consequences": "• Nothing to run, patch or scale; the cheapest and most available hosting there is.\n• Every page is the same for everyone until the next publish; personalisation and sign-in need another element.\n• The origin must stay private, or the CDN's TLS, caching and protections are bypassed.\n• Cache invalidation on publish is the one operational step; a bad publish is undone by publishing the previous build.",
877
+ "alternatives": "1. A managed container platform serving the files: more to run, no CDN edge unless added.\n2. A web server on a virtual machine: full control, all the operations work.\n3. Server rendering: personalised pages, a server to run and scale.",
660
878
  "hubWhen": {
661
- "IAC": [
662
- "terraform",
663
- "native"
879
+ "HOSTING": [
880
+ "cdn"
664
881
  ]
665
882
  }
666
883
  },
667
884
  {
668
- "id": "ff-crossguard",
669
- "type": "fitness-fn",
670
- "label": "Previews pass policy",
671
- "x": 1040,
672
- "y": 130,
673
- "category": "structural",
674
- "threshold": "0 mandatory policy violations in the preview of every pull request",
675
- "description": "A Pulumi CrossGuard policy pack runs with every preview and update and stops on a mandatory violation: missing tags, unencrypted storage, public buckets.\n\nTool: Pulumi CrossGuard\n\n```ts\n// policy/index.ts — pulumi preview --policy-pack policy\nimport { PolicyPack, validateResourceOfType } from '@pulumi/policy'\nimport * as aws from '@pulumi/aws'\n\nnew PolicyPack('baseline', {\n policies: [\n {\n name: 'required-tags', enforcementLevel: 'mandatory',\n description: 'Every bucket carries owner, environment and cost-centre tags.',\n validateResource: validateResourceOfType(aws.s3.BucketV2, (bucket, _args, report) => {\n for (const tag of ['owner', 'environment', 'cost-centre']) {\n if (!bucket.tags?.[tag]) report(`missing tag \"${tag}\"`)\n }\n }),\n },\n {\n name: 'no-public-buckets', enforcementLevel: 'mandatory',\n description: 'Public access is blocked on every bucket.',\n validateResource: validateResourceOfType(aws.s3.BucketPublicAccessBlock, (block, _args, report) => {\n if (!block.blockPublicAcls || !block.blockPublicPolicy) report('public access must be blocked')\n }),\n },\n ],\n})\n```",
885
+ "id": "adr-onprem-platform",
886
+ "type": "adr",
887
+ "label": "A platform on our own Kubernetes",
888
+ "x": 780,
889
+ "y": 650,
890
+ "concern": "infrastructure",
891
+ "status": "accepted",
892
+ "date": "",
893
+ "context": "This element is deployed and runs somewhere, and that somewhere has to be chosen, built and paid for. The forces: managed platforms take operations work off the team but limit what can run and tie it to a provider, while Kubernetes and virtual machines run anything at the price of running them; the cloud or data centre is chosen once and rarely left, by skills, existing contracts, services needed and where data may live; infrastructure built by hand in a console cannot be reviewed, repeated or rebuilt after a disaster; environments that differ from production hide the bugs that only production shows; cloud spend grows quietly with every resource nobody switches off; and changes made outside the code drift from it until the next apply undoes or breaks them.",
894
+ "decision": "The hosting chosen, {{HOSTING}}, has no provider to run it in our own data centre, so the platform team provides the same model on our Kubernetes (OpenShift or Rancher): Knative Serving runs containers that scale with requests, down to zero, and Knative Functions or OpenFaaS run functions triggered by HTTP and by events. Every workload has CPU and memory requests and a memory limit, probes, at least 2 replicas with a PodDisruptionBudget in production, and runs as non-root with a read-only root file system. The infrastructure is code, written and checked as the infrastructure-as-code decision records and applied only by the pipeline; environments: {{ENVIRONMENTS}}, built from envs/<environment>/ in one repository; drift checked every {{DRIFT_HOURS}} hours. Rollouts and canaries: as decided in the Deployment and rollback pack. Capacity and scaling: as decided in the Capacity and scaling pack. The engine of a database: hosted as decided in the Data store pack.",
895
+ "consequences": "• The element keeps the platform's programming model: a container or a function, scaled for it.\n• Someone runs the cluster and Knative: upgrades, capacity and the hardware under them are the platform team's work.\n• Scaling stops at the hardware we own; bursts beyond it wait or fail.\n• Moving to a public cloud later is a change of platform, not of the element.",
896
+ "alternatives": "1. Plain Kubernetes Deployments without Knative: one model less, no scale to zero.\n2. Virtual machines: no cluster, all the operations work.\n3. A public cloud's managed platform: no cluster to run, if the data may leave the premises.",
676
897
  "hubWhen": {
677
- "IAC": [
678
- "pulumi"
898
+ "HOSTING": [
899
+ "paas",
900
+ "serverless"
901
+ ],
902
+ "CLOUD": [
903
+ "onprem"
679
904
  ]
680
905
  }
681
906
  },
682
907
  {
683
- "id": "ff-drift-terraform",
684
- "type": "fitness-fn",
685
- "label": "Drift detected",
686
- "x": 1040,
687
- "y": 260,
688
- "category": "operational",
689
- "threshold": "A drift check every {{DRIFT_HOURS}} hours per environment; 0 unexplained differences between code and infrastructure",
690
- "description": "A scheduled pipeline runs a refresh-only plan for each environment; exit code 2 means the infrastructure differs from the code, and the job opens an issue for the owning team.\n\nTool: Terraform (plan -detailed-exitcode)\n\n```bash\n#!/usr/bin/env bash\n# scheduled every {{DRIFT_HOURS}} hours per environment\nset -uo pipefail\nterraform init -input=false >/dev/null\nterraform plan -refresh-only -detailed-exitcode -input=false -no-color > drift.txt\ncase $? in\n 0) echo \"no drift\" ;;\n 2) gh issue create --title \"Drift in $ENVIRONMENT\" --body-file drift.txt --label drift; exit 1 ;;\n *) echo \"plan failed\"; exit 1 ;;\nesac\n```",
908
+ "id": "adr-budget",
909
+ "type": "adr",
910
+ "label": "Cloud spend held to a budget",
911
+ "x": 780,
912
+ "y": 780,
913
+ "concern": "infrastructure",
914
+ "status": "accepted",
915
+ "date": "",
916
+ "context": "This element is deployed and runs somewhere, and that somewhere has to be chosen, built and paid for. The forces: managed platforms take operations work off the team but limit what can run and tie it to a provider, while Kubernetes and virtual machines run anything at the price of running them; the cloud or data centre is chosen once and rarely left, by skills, existing contracts, services needed and where data may live; infrastructure built by hand in a console cannot be reviewed, repeated or rebuilt after a disaster; environments that differ from production hide the bugs that only production shows; cloud spend grows quietly with every resource nobody switches off; and changes made outside the code drift from it until the next apply undoes or breaks them.",
917
+ "decision": "The account (AWS account, Azure subscription or Google Cloud billing account) has a monthly cost budget of {{BUDGET_MONTHLY}} in the billing currency, with a forecast alert at {{BUDGET_ALERT_PERCENT}}% to the owning team and the budget owner; the budget is part of the infrastructure code (aws_budgets_budget, azurerm_consumption_budget_subscription, google_billing_budget). One budget per account, bound once, not per element. A change that adds more than {{COST_STEP}} a month needs the budget owner's approval: with Terraform, Infracost shows the change in the pull request and a label records the approval; with Pulumi or the cloud's own tool, which no estimator reads, the reviewer attaches the pricing calculator's estimate.",
918
+ "consequences": "• Overspend is seen within the month, from the forecast, not on the invoice.\n• Every costly change has a named approver before it ships.\n• The budget and the approval step need an owner who answers within a day, or changes wait.",
919
+ "alternatives": "1. Monthly review of the invoice: no tooling, and the money is spent before anyone looks.\n2. Hard spending caps: they stop the bill and the service with it.",
691
920
  "hubWhen": {
692
- "IAC": [
693
- "terraform"
921
+ "CLOUD": [
922
+ "aws",
923
+ "azure",
924
+ "gcp"
694
925
  ]
695
926
  }
696
927
  },
697
928
  {
698
- "id": "ff-drift-pulumi",
699
- "type": "fitness-fn",
700
- "label": "Drift detected",
701
- "x": 1040,
702
- "y": 390,
703
- "category": "operational",
704
- "threshold": "A drift check every {{DRIFT_HOURS}} hours per stack; 0 unexplained differences between code and infrastructure",
705
- "description": "A scheduled pipeline refreshes each stack in preview and fails when anything changed outside the code; Pulumi Deployments can run the same as a scheduled drift detection.\n\nTool: Pulumi (preview --refresh --expect-no-changes)\n\n```bash\n#!/usr/bin/env bash\n# scheduled every {{DRIFT_HOURS}} hours per stack\nset -euo pipefail\npulumi stack select \"$STACK\"\npulumi preview --refresh --expect-no-changes --diff --non-interactive\n```",
929
+ "id": "adr-iac-terraform",
930
+ "type": "adr",
931
+ "label": "Infrastructure in Terraform",
932
+ "x": 780,
933
+ "y": 910,
934
+ "concern": "infrastructure",
935
+ "status": "accepted",
936
+ "date": "",
937
+ "context": "This element is deployed and runs somewhere, and that somewhere has to be chosen, built and paid for. The forces: managed platforms take operations work off the team but limit what can run and tie it to a provider, while Kubernetes and virtual machines run anything at the price of running them; the cloud or data centre is chosen once and rarely left, by skills, existing contracts, services needed and where data may live; infrastructure built by hand in a console cannot be reviewed, repeated or rebuilt after a disaster; environments that differ from production hide the bugs that only production shows; cloud spend grows quietly with every resource nobody switches off; and changes made outside the code drift from it until the next apply undoes or breaks them.",
938
+ "decision": "The infrastructure is described in Terraform (OpenTofu where an open-source licence matters): one root per environment under envs/<environment>/, shared modules versioned, state in a remote backend with locking (S3, Azure Storage, Google Cloud Storage or HCP Terraform). Every pull request produces a plan, checked by Checkov against the security and tagging baseline; only the pipeline applies, after review; a refresh-only plan every {{DRIFT_HOURS}} hours reports drift.",
939
+ "consequences": "• One language and workflow for every cloud and most SaaS products.\n• The state file is critical and holds secrets: its backend, locking and access need care.\n• HCL has limited abstraction; large estates need module conventions.",
940
+ "alternatives": "1. Pulumi: the same providers in a general-purpose language.\n2. The cloud's own tool (CloudFormation, Bicep): state kept by the cloud, one cloud only.",
706
941
  "hubWhen": {
707
942
  "IAC": [
708
- "pulumi"
943
+ "terraform"
709
944
  ]
710
945
  }
711
946
  },
712
947
  {
713
- "id": "ff-drift-native",
948
+ "id": "adr-iac-pulumi",
949
+ "type": "adr",
950
+ "label": "Infrastructure in Pulumi",
951
+ "x": 780,
952
+ "y": 1040,
953
+ "concern": "infrastructure",
954
+ "status": "accepted",
955
+ "date": "",
956
+ "context": "This element is deployed and runs somewhere, and that somewhere has to be chosen, built and paid for. The forces: managed platforms take operations work off the team but limit what can run and tie it to a provider, while Kubernetes and virtual machines run anything at the price of running them; the cloud or data centre is chosen once and rarely left, by skills, existing contracts, services needed and where data may live; infrastructure built by hand in a console cannot be reviewed, repeated or rebuilt after a disaster; environments that differ from production hide the bugs that only production shows; cloud spend grows quietly with every resource nobody switches off; and changes made outside the code drift from it until the next apply undoes or breaks them.",
957
+ "decision": "The infrastructure is written with Pulumi in the language the team already uses, one stack per environment, state in Pulumi Cloud or a self-managed backend (S3, Azure Blob Storage, Google Cloud Storage). A CrossGuard policy pack runs with every preview and stops on a mandatory violation of the security and tagging baseline; only the pipeline runs pulumi up, after review; a refreshed preview every {{DRIFT_HOURS}} hours reports drift.",
958
+ "consequences": "• Loops, functions, types and unit tests for infrastructure, in the team's language.\n• Infrastructure code can grow as complex as application code; it needs the same review discipline.\n• Fewer ready-made scanners and cost estimators read Pulumi than Terraform.",
959
+ "alternatives": "1. Terraform: the widest ecosystem of scanners and estimators.\n2. The cloud's own tool: one cloud, state kept by the cloud.",
960
+ "hubWhen": {
961
+ "IAC": [
962
+ "pulumi"
963
+ ]
964
+ }
965
+ },
966
+ {
967
+ "id": "adr-iac-native",
968
+ "type": "adr",
969
+ "label": "Infrastructure in the cloud's own tool",
970
+ "x": 780,
971
+ "y": 1170,
972
+ "concern": "infrastructure",
973
+ "status": "accepted",
974
+ "date": "",
975
+ "context": "This element is deployed and runs somewhere, and that somewhere has to be chosen, built and paid for. The forces: managed platforms take operations work off the team but limit what can run and tie it to a provider, while Kubernetes and virtual machines run anything at the price of running them; the cloud or data centre is chosen once and rarely left, by skills, existing contracts, services needed and where data may live; infrastructure built by hand in a console cannot be reviewed, repeated or rebuilt after a disaster; environments that differ from production hide the bugs that only production shows; cloud spend grows quietly with every resource nobody switches off; and changes made outside the code drift from it until the next apply undoes or breaks them.",
976
+ "decision": "The infrastructure is described in the cloud's own tool: CloudFormation, written directly or synthesised from the AWS CDK, on AWS; Bicep on Azure. Templates live under infra/ with a parameter file per environment, and the cloud keeps the state. Checkov scans the templates in every pull request; tags are enforced at deployment by AWS Organizations tag policies or Azure Policy; only the pipeline deploys, after review; CloudFormation drift detection or a Bicep what-if every {{DRIFT_HOURS}} hours reports drift.",
977
+ "consequences": "• No state to run, and the newest services on the day they ship.\n• One cloud only: a second cloud or a SaaS product needs another tool.\n• Fewer policy and cost tools read the templates than read Terraform.",
978
+ "alternatives": "1. Terraform: every cloud and SaaS, a state backend to run.\n2. Pulumi: a general-purpose language, the same providers as Terraform.",
979
+ "hubWhen": {
980
+ "IAC": [
981
+ "native"
982
+ ],
983
+ "CLOUD": [
984
+ "aws",
985
+ "azure"
986
+ ]
987
+ }
988
+ },
989
+ {
990
+ "id": "adr-iac-native-fallback",
991
+ "type": "adr",
992
+ "label": "Infrastructure in Terraform, as the cloud has no tool of its own",
993
+ "x": 780,
994
+ "y": 1300,
995
+ "concern": "infrastructure",
996
+ "status": "accepted",
997
+ "date": "",
998
+ "context": "This element is deployed and runs somewhere, and that somewhere has to be chosen, built and paid for. The forces: managed platforms take operations work off the team but limit what can run and tie it to a provider, while Kubernetes and virtual machines run anything at the price of running them; the cloud or data centre is chosen once and rarely left, by skills, existing contracts, services needed and where data may live; infrastructure built by hand in a console cannot be reviewed, repeated or rebuilt after a disaster; environments that differ from production hide the bugs that only production shows; cloud spend grows quietly with every resource nobody switches off; and changes made outside the code drift from it until the next apply undoes or breaks them.",
999
+ "decision": "The cloud's own tool was chosen, but {{CLOUD}} has no CloudFormation or Bicep: Google Cloud's own tool, Infrastructure Manager, deploys Terraform configurations, and our own data centre has no provider tool at all. The infrastructure is therefore described in Terraform, deployed through Infrastructure Manager on Google Cloud and by the pipeline in our own data centre: one root per environment under envs/<environment>/, state in a remote backend with locking, a plan checked by Checkov in every pull request, applied only after review, and a refresh-only plan every {{DRIFT_HOURS}} hours reporting drift.",
1000
+ "consequences": "• The checks of this pack for Terraform apply as they are.\n• On Google Cloud, Infrastructure Manager keeps the state and the deployment history; elsewhere the backend is ours to run.\n• HCL has limited abstraction; large estates need module conventions.",
1001
+ "alternatives": "1. Pulumi: the same providers in a general-purpose language.\n2. Deployment Manager on Google Cloud: retired in favour of Infrastructure Manager.",
1002
+ "hubWhen": {
1003
+ "IAC": [
1004
+ "native"
1005
+ ],
1006
+ "CLOUD": [
1007
+ "gcp",
1008
+ "onprem"
1009
+ ]
1010
+ }
1011
+ },
1012
+ {
1013
+ "id": "ff-checkov",
1014
+ "type": "fitness-fn",
1015
+ "label": "Plans pass policy",
1016
+ "x": 1040,
1017
+ "y": 0,
1018
+ "characteristic": "security",
1019
+ "scope": "atomic",
1020
+ "cadence": "triggered",
1021
+ "trigger": "pull-request",
1022
+ "invocation": "automated",
1023
+ "description": "Checkov scans the Terraform plan in every pull request with its built-in checks and a custom tagging policy over every taggable resource type of every provider (AWS and Azure resources carry tags, Google Cloud resources labels), and fails on any finding. Rules of your own go into Conftest policies over the same plan JSON.\n\nThreshold: 0 failed Checkov checks of the baseline (encryption, public access, open admin ports) and 0 taggable resources without owner, environment and cost-centre tags (labels on Google Cloud) in the plan of every pull request\n\nTool: Checkov\n\n```yaml\n# policies/required_tags.yaml — custom check, run with --external-checks-dir policies\nmetadata:\n id: CKV2_ORG_TAGS\n name: Taggable resources carry owner, environment and cost-centre tags (labels on Google Cloud)\n category: GENERAL_SECURITY\ndefinition:\n or:\n - and:\n - { cond_type: attribute, resource_types: taggable, attribute: tags.owner, operator: exists }\n - { cond_type: attribute, resource_types: taggable, attribute: tags.environment, operator: exists }\n - { cond_type: attribute, resource_types: taggable, attribute: tags.cost-centre, operator: exists }\n - and:\n - { cond_type: attribute, resource_types: taggable, attribute: labels.owner, operator: exists }\n - { cond_type: attribute, resource_types: taggable, attribute: labels.environment, operator: exists }\n - { cond_type: attribute, resource_types: taggable, attribute: labels.cost-centre, operator: exists }\n# CI, in envs/<environment>:\n# terraform plan -out tf.plan && terraform show -json tf.plan > tf.json\n# checkov -f tf.json --framework terraform_plan --external-checks-dir ../../policies --compact\n```",
1024
+ "hubWhen": {
1025
+ "IAC": [
1026
+ "terraform"
1027
+ ]
1028
+ }
1029
+ },
1030
+ {
1031
+ "id": "ff-checkov-fallback",
1032
+ "type": "fitness-fn",
1033
+ "label": "Plans pass policy",
1034
+ "x": 1040,
1035
+ "y": 130,
1036
+ "characteristic": "security",
1037
+ "scope": "atomic",
1038
+ "cadence": "triggered",
1039
+ "trigger": "pull-request",
1040
+ "invocation": "automated",
1041
+ "description": "Checkov scans the Terraform plan in every pull request with its built-in checks and a custom tagging policy over every taggable resource type of every provider (AWS and Azure resources carry tags, Google Cloud resources labels), and fails on any finding. Rules of your own go into Conftest policies over the same plan JSON.\n\nThreshold: 0 failed Checkov checks of the baseline (encryption, public access, open admin ports) and 0 taggable resources without owner, environment and cost-centre tags (labels on Google Cloud) in the plan of every pull request\n\nTool: Checkov\n\n```yaml\n# policies/required_tags.yaml — custom check, run with --external-checks-dir policies\nmetadata:\n id: CKV2_ORG_TAGS\n name: Taggable resources carry owner, environment and cost-centre tags (labels on Google Cloud)\n category: GENERAL_SECURITY\ndefinition:\n or:\n - and:\n - { cond_type: attribute, resource_types: taggable, attribute: tags.owner, operator: exists }\n - { cond_type: attribute, resource_types: taggable, attribute: tags.environment, operator: exists }\n - { cond_type: attribute, resource_types: taggable, attribute: tags.cost-centre, operator: exists }\n - and:\n - { cond_type: attribute, resource_types: taggable, attribute: labels.owner, operator: exists }\n - { cond_type: attribute, resource_types: taggable, attribute: labels.environment, operator: exists }\n - { cond_type: attribute, resource_types: taggable, attribute: labels.cost-centre, operator: exists }\n# CI, in envs/<environment>:\n# terraform plan -out tf.plan && terraform show -json tf.plan > tf.json\n# checkov -f tf.json --framework terraform_plan --external-checks-dir ../../policies --compact\n```",
1042
+ "hubWhen": {
1043
+ "IAC": [
1044
+ "native"
1045
+ ],
1046
+ "CLOUD": [
1047
+ "gcp",
1048
+ "onprem"
1049
+ ]
1050
+ }
1051
+ },
1052
+ {
1053
+ "id": "ff-checkov-native",
1054
+ "type": "fitness-fn",
1055
+ "label": "Templates pass policy",
1056
+ "x": 1040,
1057
+ "y": 260,
1058
+ "characteristic": "security",
1059
+ "scope": "atomic",
1060
+ "cadence": "triggered",
1061
+ "trigger": "pull-request",
1062
+ "invocation": "automated",
1063
+ "description": "Checkov scans the CloudFormation (synthesised from the CDK with cdk synth) or Bicep templates under infra/ in every pull request with its built-in checks and fails on any finding. Tags are enforced at deploy time by the cloud (AWS Organizations tag policies, Azure Policy \"Require a tag on resources\"), not by this check.\n\nThreshold: 0 failed Checkov checks of the baseline (encryption, public access, open admin ports) in the CloudFormation or Bicep templates of every pull request\n\nTool: Checkov\n\n```bash\n#!/usr/bin/env bash\n# CloudFormation (AWS, incl. cdk synth output) and Bicep (Azure) templates under infra/\nset -euo pipefail\ncheckov --directory infra --framework cloudformation,bicep --compact\n```",
1064
+ "hubWhen": {
1065
+ "IAC": [
1066
+ "native"
1067
+ ],
1068
+ "CLOUD": [
1069
+ "aws",
1070
+ "azure"
1071
+ ]
1072
+ }
1073
+ },
1074
+ {
1075
+ "id": "ff-crossguard",
1076
+ "type": "fitness-fn",
1077
+ "label": "Previews pass policy",
1078
+ "x": 1040,
1079
+ "y": 390,
1080
+ "characteristic": "security",
1081
+ "scope": "atomic",
1082
+ "cadence": "triggered",
1083
+ "trigger": "pull-request",
1084
+ "invocation": "automated",
1085
+ "description": "A Pulumi CrossGuard policy pack runs with every preview and update and stops on a mandatory violation. The tag rule covers the listed resource types of AWS, Azure and Google Cloud (labels there); the public-storage rule knows each cloud's bucket setting. Extend the lists with the resource types the stacks use.\n\nThreshold: 0 mandatory policy violations in the preview of every pull request: missing owner, environment or cost-centre tags on the listed resource types, public storage\n\nTool: Pulumi CrossGuard (@pulumi/policy)\n\n```ts\n// policy/index.ts — pulumi preview --policy-pack policy\nimport { PolicyPack, type ResourceValidationArgs } from '@pulumi/policy'\n\nconst TAGGED = new Set([\n 'aws:ec2/instance:Instance', 'aws:rds/instance:Instance', 'aws:s3/bucketV2:BucketV2', 'aws:ecs/service:Service', 'aws:lambda/function:Function',\n 'azure-native:compute:VirtualMachine', 'azure-native:storage:StorageAccount', 'azure-native:app:ContainerApp', 'azure-native:web:WebApp',\n 'gcp:compute/instance:Instance', 'gcp:storage/bucket:Bucket', 'gcp:cloudrunv2/service:Service', 'gcp:cloudfunctions2/function:Function',\n])\nconst PRIVATE: Record<string, (props: Record<string, any>) => boolean> = {\n 'aws:s3/bucketPublicAccessBlock:BucketPublicAccessBlock': (p) => p.blockPublicAcls && p.blockPublicPolicy,\n 'azure-native:storage:StorageAccount': (p) => p.allowBlobPublicAccess === false,\n 'gcp:storage/bucket:Bucket': (p) => p.publicAccessPrevention === 'enforced',\n}\n\nnew PolicyPack('baseline', {\n policies: [\n {\n name: 'required-tags', enforcementLevel: 'mandatory',\n description: 'Every listed resource carries owner, environment and cost-centre tags (labels on Google Cloud).',\n validateResource: (args: ResourceValidationArgs, report) => {\n if (!TAGGED.has(args.type)) return\n const tags = args.props.tags ?? args.props.labels ?? {}\n for (const tag of ['owner', 'environment', 'cost-centre']) if (!tags[tag]) report(`${args.type} ${args.name}: missing tag \"${tag}\"`)\n },\n },\n {\n name: 'no-public-storage', enforcementLevel: 'mandatory',\n description: 'Public access is blocked on every bucket.',\n validateResource: (args: ResourceValidationArgs, report) => {\n const isPrivate = PRIVATE[args.type]\n if (isPrivate && !isPrivate(args.props)) report(`${args.type} ${args.name}: public access must be blocked`)\n },\n },\n ],\n})\n```",
1086
+ "hubWhen": {
1087
+ "IAC": [
1088
+ "pulumi"
1089
+ ]
1090
+ }
1091
+ },
1092
+ {
1093
+ "id": "ff-drift-terraform",
714
1094
  "type": "fitness-fn",
715
1095
  "label": "Drift detected",
716
1096
  "x": 1040,
717
1097
  "y": 520,
718
- "category": "operational",
719
- "threshold": "A drift check every {{DRIFT_HOURS}} hours per stack; 0 stacks in DRIFTED state",
720
- "description": "A scheduled job starts CloudFormation drift detection on every stack and fails when one is DRIFTED. With Bicep, `az deployment group what-if` against the deployed template shows the same.\n\nTool: AWS CloudFormation drift detection (AWS CLI)\n\n```bash\n#!/usr/bin/env bash\n# scheduled every {{DRIFT_HOURS}} hours\nset -euo pipefail\nfor stack in $(aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE UPDATE_COMPLETE \\\n --query 'StackSummaries[].StackName' --output text); do\n id=$(aws cloudformation detect-stack-drift --stack-name \"$stack\" --query StackDriftDetectionId --output text)\n until [ \"$(aws cloudformation describe-stack-drift-detection-status --stack-drift-detection-id \"$id\" \\\n --query DetectionStatus --output text)\" != DETECTION_IN_PROGRESS ]; do sleep 5; done\n status=$(aws cloudformation describe-stack-drift-detection-status --stack-drift-detection-id \"$id\" \\\n --query StackDriftStatus --output text)\n [ \"$status\" = DRIFTED ] && { echo \"$stack has drifted\"; failed=1; }\ndone\nexit ${failed:-0}\n```",
1098
+ "characteristic": "maintainability",
1099
+ "scope": "atomic",
1100
+ "cadence": "triggered",
1101
+ "trigger": "nightly",
1102
+ "invocation": "automated",
1103
+ "description": "A scheduled pipeline runs a refresh-only plan in each environment's root; exit code 2 means the infrastructure differs from the code, and the job opens an issue for the owning team.\n\nThreshold: A drift check every {{DRIFT_HOURS}} hours per environment; 0 unexplained differences between code and infrastructure\n\nTool: Terraform (plan -detailed-exitcode) with the GitHub CLI\n\n```bash\n#!/usr/bin/env bash\n# scheduled every {{DRIFT_HOURS}} hours, in envs/$ENVIRONMENT\nset -uo pipefail\nterraform init -input=false >/dev/null\nterraform plan -refresh-only -detailed-exitcode -input=false -no-color > drift.txt\ncase $? in\n 0) echo \"no drift\" ;;\n 2) gh issue create --title \"Drift in $ENVIRONMENT\" --body-file drift.txt --label drift; exit 1 ;;\n *) echo \"plan failed\"; exit 1 ;;\nesac\n```",
721
1104
  "hubWhen": {
722
1105
  "IAC": [
723
- "native"
1106
+ "terraform"
724
1107
  ]
725
1108
  }
726
1109
  },
727
1110
  {
728
- "id": "ff-budget",
1111
+ "id": "ff-drift-terraform-fallback",
729
1112
  "type": "fitness-fn",
730
- "label": "Budget alert in place",
1113
+ "label": "Drift detected",
731
1114
  "x": 1040,
732
1115
  "y": 650,
733
- "category": "operational",
734
- "threshold": "A monthly budget of {{BUDGET_MONTHLY}} with a forecast alert at {{BUDGET_ALERT_PERCENT}}% exists for every account or subscription, defined in code",
735
- "description": "The budget and its forecast alert are part of the infrastructure code, so every account gets one. Azure: azurerm_consumption_budget_subscription; Google Cloud: google_billing_budget; on premises: chargeback reports from the virtualisation platform.\n\nTool: AWS Budgets (Terraform aws_budgets_budget)\n\n```hcl\nresource \"aws_budgets_budget\" \"monthly\" {\n name = \"${var.system}-${var.environment}-monthly\"\n budget_type = \"COST\"\n limit_amount = \"{{BUDGET_MONTHLY}}\"\n limit_unit = \"USD\"\n time_unit = \"MONTHLY\"\n\n notification {\n comparison_operator = \"GREATER_THAN\"\n threshold = {{BUDGET_ALERT_PERCENT}}\n threshold_type = \"PERCENTAGE\"\n notification_type = \"FORECASTED\"\n subscriber_email_addresses = [var.owner_email, var.budget_owner_email]\n }\n}\n```"
1116
+ "characteristic": "maintainability",
1117
+ "scope": "atomic",
1118
+ "cadence": "triggered",
1119
+ "trigger": "nightly",
1120
+ "invocation": "automated",
1121
+ "description": "A scheduled pipeline runs a refresh-only plan in each environment's root; exit code 2 means the infrastructure differs from the code, and the job opens an issue for the owning team.\n\nThreshold: A drift check every {{DRIFT_HOURS}} hours per environment; 0 unexplained differences between code and infrastructure\n\nTool: Terraform (plan -detailed-exitcode) with the GitHub CLI\n\n```bash\n#!/usr/bin/env bash\n# scheduled every {{DRIFT_HOURS}} hours, in envs/$ENVIRONMENT\nset -uo pipefail\nterraform init -input=false >/dev/null\nterraform plan -refresh-only -detailed-exitcode -input=false -no-color > drift.txt\ncase $? in\n 0) echo \"no drift\" ;;\n 2) gh issue create --title \"Drift in $ENVIRONMENT\" --body-file drift.txt --label drift; exit 1 ;;\n *) echo \"plan failed\"; exit 1 ;;\nesac\n```",
1122
+ "hubWhen": {
1123
+ "IAC": [
1124
+ "native"
1125
+ ],
1126
+ "CLOUD": [
1127
+ "gcp",
1128
+ "onprem"
1129
+ ]
1130
+ }
1131
+ },
1132
+ {
1133
+ "id": "ff-drift-pulumi",
1134
+ "type": "fitness-fn",
1135
+ "label": "Drift detected",
1136
+ "x": 1040,
1137
+ "y": 780,
1138
+ "characteristic": "maintainability",
1139
+ "scope": "atomic",
1140
+ "cadence": "triggered",
1141
+ "trigger": "nightly",
1142
+ "invocation": "automated",
1143
+ "description": "A scheduled pipeline refreshes each stack in preview and fails when anything changed outside the code; Pulumi Deployments can run the same as a scheduled drift detection.\n\nThreshold: A drift check every {{DRIFT_HOURS}} hours per stack; 0 unexplained differences between code and infrastructure\n\nTool: Pulumi (preview --refresh --expect-no-changes)\n\n```bash\n#!/usr/bin/env bash\n# scheduled every {{DRIFT_HOURS}} hours per stack\nset -euo pipefail\npulumi stack select \"$STACK\"\npulumi preview --refresh --expect-no-changes --diff --non-interactive\n```",
1144
+ "hubWhen": {
1145
+ "IAC": [
1146
+ "pulumi"
1147
+ ]
1148
+ }
1149
+ },
1150
+ {
1151
+ "id": "ff-drift-native",
1152
+ "type": "fitness-fn",
1153
+ "label": "Drift detected",
1154
+ "x": 1040,
1155
+ "y": 910,
1156
+ "characteristic": "maintainability",
1157
+ "scope": "atomic",
1158
+ "cadence": "triggered",
1159
+ "trigger": "nightly",
1160
+ "invocation": "automated",
1161
+ "description": "A scheduled job runs the part for the cloud in use (the CLOUD variable of the pipeline): on AWS it starts CloudFormation drift detection on every stack and fails when one is DRIFTED; on Azure it runs a what-if of the deployed Bicep template against the resource group and fails on any change other than NoChange or Ignore.\n\nThreshold: A drift check every {{DRIFT_HOURS}} hours; 0 CloudFormation stacks in DRIFTED state, 0 resources a Bicep what-if would change\n\nTool: AWS CloudFormation drift detection (AWS CLI); Azure: az deployment group what-if\n\n```bash\n#!/usr/bin/env bash\n# scheduled every {{DRIFT_HOURS}} hours; the pipeline sets CLOUD to aws or azure\nset -euo pipefail\nfailed=0\ncase \"$CLOUD\" in\n aws)\n for stack in $(aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE UPDATE_COMPLETE \\\n --query 'StackSummaries[].StackName' --output text); do\n id=$(aws cloudformation detect-stack-drift --stack-name \"$stack\" --query StackDriftDetectionId --output text)\n until [ \"$(aws cloudformation describe-stack-drift-detection-status --stack-drift-detection-id \"$id\" \\\n --query DetectionStatus --output text)\" != DETECTION_IN_PROGRESS ]; do sleep 5; done\n status=$(aws cloudformation describe-stack-drift-detection-status --stack-drift-detection-id \"$id\" \\\n --query StackDriftStatus --output text)\n [ \"$status\" != DRIFTED ] || { echo \"$stack has drifted\"; failed=1; }\n done ;;\n azure)\n changes=$(az deployment group what-if --resource-group \"$RESOURCE_GROUP\" --template-file infra/main.bicep \\\n --parameters \"infra/$ENVIRONMENT.bicepparam\" --no-pretty-print --exclude-change-types NoChange Ignore \\\n --query 'changes[].[resourceId, changeType]' --output tsv)\n [ -z \"$changes\" ] || { echo \"$changes\"; failed=1; } ;;\nesac\nexit $failed\n```",
1162
+ "hubWhen": {
1163
+ "IAC": [
1164
+ "native"
1165
+ ],
1166
+ "CLOUD": [
1167
+ "aws",
1168
+ "azure"
1169
+ ]
1170
+ }
1171
+ },
1172
+ {
1173
+ "id": "ff-budget-aws",
1174
+ "type": "fitness-fn",
1175
+ "label": "Budget alert in place (AWS Budgets)",
1176
+ "x": 1040,
1177
+ "y": 1040,
1178
+ "characteristic": "other",
1179
+ "scope": "atomic",
1180
+ "cadence": "triggered",
1181
+ "trigger": "nightly",
1182
+ "invocation": "automated",
1183
+ "description": "A scheduled job reads the account's budgets through the cloud's CLI and fails when none is a monthly cost budget of {{BUDGET_MONTHLY}} with an enabled forecast notification at {{BUDGET_ALERT_PERCENT}}% or lower; the budget itself is part of the infrastructure code. One budget per account: bind this pack's budget details once per account, not per element.\n\nThreshold: A monthly cost budget of {{BUDGET_MONTHLY}} with a forecast alert at {{BUDGET_ALERT_PERCENT}}% or lower exists in the account the element runs in\n\nTool: AWS CLI (budgets)\n\n```bash\n#!/usr/bin/env bash\n# scheduled: the account's monthly cost budget with a forecast alert exists\nset -euo pipefail\naccount=$(aws sts get-caller-identity --query Account --output text)\nname=$(aws budgets describe-budgets --account-id \"$account\" \\\n --query \"Budgets[?BudgetType=='COST' && TimeUnit=='MONTHLY' && to_number(BudgetLimit.Amount)==\\`{{BUDGET_MONTHLY}}\\`].BudgetName | [0]\" --output text)\n[ \"$name\" != None ] || { echo \"no monthly cost budget of {{BUDGET_MONTHLY}} in account $account\"; exit 1; }\naws budgets describe-notifications-for-budget --account-id \"$account\" --budget-name \"$name\" \\\n --query \"Notifications[?NotificationType=='FORECASTED' && ThresholdType=='PERCENTAGE' && Threshold<=\\`{{BUDGET_ALERT_PERCENT}}\\`]\" --output text | grep -q . \\\n || { echo \"budget $name has no forecast alert at {{BUDGET_ALERT_PERCENT}} % or lower\"; exit 1; }\n```",
1184
+ "hubWhen": {
1185
+ "CLOUD": [
1186
+ "aws"
1187
+ ]
1188
+ }
1189
+ },
1190
+ {
1191
+ "id": "ff-budget-azure",
1192
+ "type": "fitness-fn",
1193
+ "label": "Budget alert in place (Azure Cost Management)",
1194
+ "x": 1040,
1195
+ "y": 1170,
1196
+ "characteristic": "other",
1197
+ "scope": "atomic",
1198
+ "cadence": "triggered",
1199
+ "trigger": "nightly",
1200
+ "invocation": "automated",
1201
+ "description": "A scheduled job reads the account's budgets through the cloud's CLI and fails when none is a monthly cost budget of {{BUDGET_MONTHLY}} with an enabled forecast notification at {{BUDGET_ALERT_PERCENT}}% or lower; the budget itself is part of the infrastructure code. One budget per account: bind this pack's budget details once per account, not per element.\n\nThreshold: A monthly cost budget of {{BUDGET_MONTHLY}} with a forecast alert at {{BUDGET_ALERT_PERCENT}}% or lower exists in the account the element runs in\n\nTool: Azure CLI (consumption budget) with jq\n\n```bash\n#!/usr/bin/env bash\n# scheduled: the subscription's monthly budget with a forecast alert exists\nset -euo pipefail\naz consumption budget list --output json | jq -e --argjson amount {{BUDGET_MONTHLY}} --argjson pct {{BUDGET_ALERT_PERCENT}} '\n map(select(.timeGrain == \"Monthly\" and .amount == $amount\n and any(.notifications[]?; .enabled and .thresholdType == \"Forecasted\" and .threshold <= $pct))) | length > 0' >/dev/null \\\n || { echo \"no monthly budget of {{BUDGET_MONTHLY}} with a forecast alert at {{BUDGET_ALERT_PERCENT}} % or lower in this subscription\"; exit 1; }\n```",
1202
+ "hubWhen": {
1203
+ "CLOUD": [
1204
+ "azure"
1205
+ ]
1206
+ }
1207
+ },
1208
+ {
1209
+ "id": "ff-budget-gcp",
1210
+ "type": "fitness-fn",
1211
+ "label": "Budget alert in place (Cloud Billing budgets)",
1212
+ "x": 1040,
1213
+ "y": 1300,
1214
+ "characteristic": "other",
1215
+ "scope": "atomic",
1216
+ "cadence": "triggered",
1217
+ "trigger": "nightly",
1218
+ "invocation": "automated",
1219
+ "description": "A scheduled job reads the account's budgets through the cloud's CLI and fails when none is a monthly cost budget of {{BUDGET_MONTHLY}} with an enabled forecast notification at {{BUDGET_ALERT_PERCENT}}% or lower; the budget itself is part of the infrastructure code. One budget per account: bind this pack's budget details once per account, not per element.\n\nThreshold: A monthly cost budget of {{BUDGET_MONTHLY}} with a forecast alert at {{BUDGET_ALERT_PERCENT}}% or lower exists in the account the element runs in\n\nTool: gcloud (billing budgets) with jq\n\n```bash\n#!/usr/bin/env bash\n# scheduled: the billing account's monthly budget with a forecast alert exists\nset -euo pipefail\ngcloud billing budgets list --billing-account \"$BILLING_ACCOUNT\" --format=json | jq -e --argjson amount {{BUDGET_MONTHLY}} --argjson pct {{BUDGET_ALERT_PERCENT}} '\n map(select((.budgetFilter.calendarPeriod // \"MONTH\") == \"MONTH\" and (.amount.specifiedAmount.units | tonumber) == $amount\n and any(.thresholdRules[]?; .spendBasis == \"FORECASTED_SPEND\" and (.thresholdPercent * 100) <= $pct))) | length > 0' >/dev/null \\\n || { echo \"no monthly budget of {{BUDGET_MONTHLY}} with a forecast alert at {{BUDGET_ALERT_PERCENT}} % or lower on $BILLING_ACCOUNT\"; exit 1; }\n```",
1220
+ "hubWhen": {
1221
+ "CLOUD": [
1222
+ "gcp"
1223
+ ]
1224
+ }
736
1225
  },
737
1226
  {
738
1227
  "id": "ff-infracost",
739
1228
  "type": "fitness-fn",
740
1229
  "label": "Cost change in review",
741
1230
  "x": 1040,
742
- "y": 780,
743
- "category": "process",
744
- "threshold": "100% of infrastructure pull requests show the monthly cost change; above {{COST_STEP}} a month the budget owner must approve",
745
- "description": "Infracost compares the cost of the pull request's Terraform with the main branch and comments the difference; a step fails the check above the limit until the budget owner approves.\n\nTool: Infracost\n\n```bash\ninfracost breakdown --path . --format json --out-file base.json # on main\ninfracost diff --path . --compare-to base.json --format json --out-file diff.json\ninfracost comment github --path diff.json --repo \"$GITHUB_REPOSITORY\" \\\n --pull-request \"$PR_NUMBER\" --github-token \"$GITHUB_TOKEN\" --behavior update\nincrease=$(jq -r '.diffTotalMonthlyCost | tonumber | floor' diff.json)\n[ \"$increase\" -le {{COST_STEP}} ] || { echo \"adds $increase a month: budget owner approval needed\"; exit 1; }\n```",
1231
+ "y": 1430,
1232
+ "characteristic": "other",
1233
+ "scope": "atomic",
1234
+ "cadence": "triggered",
1235
+ "trigger": "pull-request",
1236
+ "invocation": "manual",
1237
+ "description": "Infracost compares the cost of the pull request's Terraform with the main branch and comments the difference; the step then fails above the limit unless the budget owner has added the label budget-approved, which only they may add (a CODEOWNERS-protected label rule or a workflow that checks who added it).\n\nThreshold: 100% of infrastructure pull requests show the monthly cost change; above {{COST_STEP}} a month the check fails until the pull request carries the label budget-approved\n\nTool: Infracost with the GitHub CLI\n\n```bash\ninfracost breakdown --path . --format json --out-file base.json # run on the main branch checkout\ninfracost diff --path . --compare-to base.json --format json --out-file diff.json\ninfracost comment github --path diff.json --repo \"$GITHUB_REPOSITORY\" \\\n --pull-request \"$PR_NUMBER\" --github-token \"$GITHUB_TOKEN\" --behavior update\nincrease=$(jq -r '(.diffTotalMonthlyCost // \"0\") | tonumber | floor' diff.json)\napproved=$(gh pr view \"$PR_NUMBER\" --json labels -q '.labels[].name' | grep -cx budget-approved || true)\n[ \"$increase\" -le {{COST_STEP}} ] || [ \"$approved\" -gt 0 ] \\\n || { echo \"adds $increase a month: the budget owner adds the label budget-approved\"; exit 1; }\n```",
746
1238
  "hubWhen": {
747
1239
  "IAC": [
748
1240
  "terraform"
1241
+ ],
1242
+ "CLOUD": [
1243
+ "aws",
1244
+ "azure",
1245
+ "gcp"
1246
+ ]
1247
+ }
1248
+ },
1249
+ {
1250
+ "id": "ff-infracost-fallback",
1251
+ "type": "fitness-fn",
1252
+ "label": "Cost change in review",
1253
+ "x": 1040,
1254
+ "y": 1560,
1255
+ "characteristic": "other",
1256
+ "scope": "atomic",
1257
+ "cadence": "triggered",
1258
+ "trigger": "pull-request",
1259
+ "invocation": "manual",
1260
+ "description": "Infracost compares the cost of the pull request's Terraform with the main branch and comments the difference; the step then fails above the limit unless the budget owner has added the label budget-approved, which only they may add (a CODEOWNERS-protected label rule or a workflow that checks who added it).\n\nThreshold: 100% of infrastructure pull requests show the monthly cost change; above {{COST_STEP}} a month the check fails until the pull request carries the label budget-approved\n\nTool: Infracost with the GitHub CLI\n\n```bash\ninfracost breakdown --path . --format json --out-file base.json # run on the main branch checkout\ninfracost diff --path . --compare-to base.json --format json --out-file diff.json\ninfracost comment github --path diff.json --repo \"$GITHUB_REPOSITORY\" \\\n --pull-request \"$PR_NUMBER\" --github-token \"$GITHUB_TOKEN\" --behavior update\nincrease=$(jq -r '(.diffTotalMonthlyCost // \"0\") | tonumber | floor' diff.json)\napproved=$(gh pr view \"$PR_NUMBER\" --json labels -q '.labels[].name' | grep -cx budget-approved || true)\n[ \"$increase\" -le {{COST_STEP}} ] || [ \"$approved\" -gt 0 ] \\\n || { echo \"adds $increase a month: the budget owner adds the label budget-approved\"; exit 1; }\n```",
1261
+ "hubWhen": {
1262
+ "IAC": [
1263
+ "native"
1264
+ ],
1265
+ "CLOUD": [
1266
+ "gcp"
1267
+ ]
1268
+ }
1269
+ },
1270
+ {
1271
+ "id": "ff-paas-aws",
1272
+ "type": "fitness-fn",
1273
+ "label": "Scaled on ECS on Fargate",
1274
+ "x": 1040,
1275
+ "y": 1690,
1276
+ "characteristic": "reliability",
1277
+ "scope": "atomic",
1278
+ "cadence": "triggered",
1279
+ "trigger": "deploy",
1280
+ "invocation": "automated",
1281
+ "description": "A check after each deploy reads the production service's scaling settings from ECS on Fargate and fails when fewer than 2 instances are kept or no autoscaling range exists above them.\n\nThreshold: The production service runs at least 2 instances and autoscales above that minimum\n\nTool: AWS CLI (ecs, application-autoscaling); App Runner: describe-service and its auto-scaling configuration's MinSize\n\n```bash\n#!/usr/bin/env bash\n# production: the service keeps at least 2 tasks and has an autoscaling target above them\nset -euo pipefail\ndesired=$(aws ecs describe-services --cluster \"$CLUSTER\" --services \"$SERVICE\" --query 'services[0].desiredCount' --output text)\nread -r min max < <(aws application-autoscaling describe-scalable-targets --service-namespace ecs \\\n --resource-ids \"service/$CLUSTER/$SERVICE\" --query 'ScalableTargets[0].[MinCapacity, MaxCapacity]' --output text)\n[ \"$desired\" -ge 2 ] && [ \"$min\" != None ] && [ \"$min\" -ge 2 ] && [ \"$max\" -gt \"$min\" ] \\\n || { echo \"desired $desired, autoscaling $min-$max (at least 2, scaling above it)\"; exit 1; }\n```",
1282
+ "hubWhen": {
1283
+ "HOSTING": [
1284
+ "paas"
1285
+ ],
1286
+ "CLOUD": [
1287
+ "aws"
1288
+ ]
1289
+ }
1290
+ },
1291
+ {
1292
+ "id": "ff-paas-azure",
1293
+ "type": "fitness-fn",
1294
+ "label": "Scaled on Container Apps",
1295
+ "x": 1040,
1296
+ "y": 1820,
1297
+ "characteristic": "reliability",
1298
+ "scope": "atomic",
1299
+ "cadence": "triggered",
1300
+ "trigger": "deploy",
1301
+ "invocation": "automated",
1302
+ "description": "A check after each deploy reads the production service's scaling settings from Container Apps and fails when fewer than 2 instances are kept or no autoscaling range exists above them.\n\nThreshold: The production service runs at least 2 instances and autoscales above that minimum\n\nTool: Azure CLI (containerapp)\n\n```bash\n#!/usr/bin/env bash\n# production: the container app keeps at least 2 replicas and scales above them\nset -euo pipefail\nread -r min max < <(az containerapp show --name \"$APP\" --resource-group \"$RESOURCE_GROUP\" \\\n --query '[properties.template.scale.minReplicas, properties.template.scale.maxReplicas]' --output tsv)\n[ \"$min\" -ge 2 ] && [ \"$max\" -gt \"$min\" ] || { echo \"replicas $min-$max (at least 2, scaling above it)\"; exit 1; }\n```",
1303
+ "hubWhen": {
1304
+ "HOSTING": [
1305
+ "paas"
1306
+ ],
1307
+ "CLOUD": [
1308
+ "azure"
1309
+ ]
1310
+ }
1311
+ },
1312
+ {
1313
+ "id": "ff-paas-gcp",
1314
+ "type": "fitness-fn",
1315
+ "label": "Scaled on Cloud Run",
1316
+ "x": 1040,
1317
+ "y": 1950,
1318
+ "characteristic": "reliability",
1319
+ "scope": "atomic",
1320
+ "cadence": "triggered",
1321
+ "trigger": "deploy",
1322
+ "invocation": "automated",
1323
+ "description": "A check after each deploy reads the production service's scaling settings from Cloud Run and fails when fewer than 2 instances are kept or no autoscaling range exists above them.\n\nThreshold: The production service runs at least 2 instances and autoscales above that minimum\n\nTool: gcloud (run services) with jq\n\n```bash\n#!/usr/bin/env bash\n# production: the service keeps at least 2 instances and scales above them\nset -euo pipefail\nread -r min max < <(gcloud run services describe \"$SERVICE\" --region \"$REGION\" --format=json \\\n | jq -r '.spec.template.metadata.annotations | \"\\(.[\"autoscaling.knative.dev/minScale\"] // 0) \\(.[\"autoscaling.knative.dev/maxScale\"] // 0)\"')\n[ \"$min\" -ge 2 ] && [ \"$max\" -gt \"$min\" ] || { echo \"instances $min-$max (at least 2, scaling above it)\"; exit 1; }\n```",
1324
+ "hubWhen": {
1325
+ "HOSTING": [
1326
+ "paas"
1327
+ ],
1328
+ "CLOUD": [
1329
+ "gcp"
749
1330
  ]
750
1331
  }
751
1332
  },
@@ -754,10 +1335,13 @@
754
1335
  "type": "fitness-fn",
755
1336
  "label": "Manifests well specified",
756
1337
  "x": 1040,
757
- "y": 910,
758
- "category": "structural",
759
- "threshold": "0 critical kube-score findings (missing limits, probes, PodDisruptionBudget, root user) in rendered manifests",
760
- "description": "The rendered manifests of every chart or overlay are scored in each pull request; a critical finding fails the build.\n\nTool: kube-score\n\n```bash\nhelm template order-api charts/order-api -f charts/order-api/values-production.yaml \\\n | kube-score score - --output-format ci \\\n --enable-optional-test container-security-context-readonlyrootfilesystem\n```",
1338
+ "y": 2080,
1339
+ "characteristic": "reliability",
1340
+ "scope": "atomic",
1341
+ "cadence": "triggered",
1342
+ "trigger": "pull-request",
1343
+ "invocation": "automated",
1344
+ "description": "The rendered manifests of every chart or overlay are scored in each pull request; a critical finding fails the build. The chart renders its PodDisruptionBudget with the Deployment, so the deployment-has-poddisruptionbudget check sees both; the user-and-group and read-only-root-file-system checks are on by default in current kube-score. The defaults that ask for more than the requirement (a CPU limit, ephemeral-storage requests and limits, pull policy Always, a NetworkPolicy per pod, host anti-affinity) are switched off; network reachability is not decided in this pack.\n\nThreshold: 0 critical kube-score findings in the rendered manifests (CPU and memory requests, memory limit, probes, replicas, PodDisruptionBudget, non-root user and group, read-only root file system, and kube-score's correctness checks), with the default checks the requirement does not ask for switched off\n\nTool: kube-score\n\n```bash\nhelm template order-api charts/order-api -f charts/order-api/values-production.yaml \\\n | kube-score score - --output-format ci \\\n --ignore-container-cpu-limit \\\n --ignore-test container-ephemeral-storage-request-and-limit \\\n --ignore-test container-image-pull-policy \\\n --ignore-test pod-networkpolicy \\\n --ignore-test deployment-has-host-podantiaffinity \\\n --ignore-test statefulset-has-host-podantiaffinity\n```",
761
1345
  "hubWhen": {
762
1346
  "HOSTING": [
763
1347
  "kubernetes"
@@ -765,17 +1349,291 @@
765
1349
  }
766
1350
  },
767
1351
  {
768
- "id": "ff-ephemeral-ttl",
1352
+ "id": "ff-kube-score-onprem",
769
1353
  "type": "fitness-fn",
770
- "label": "No forgotten environments",
1354
+ "label": "Manifests well specified",
771
1355
  "x": 1040,
772
- "y": 1040,
773
- "category": "operational",
774
- "threshold": "0 ephemeral environments idle for more than {{EPHEMERAL_HOURS}} hours or alive after their pull request closed",
775
- "description": "A scheduled job lists the namespaces labelled as ephemeral, deletes those whose pull request is closed or that have been idle past the limit, and reports what it removed.\n\nTool: kubectl with GitHub CLI (scheduled job)\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nlimit=$(( $(date +%s) - {{EPHEMERAL_HOURS}} * 3600 ))\nkubectl get ns -l env-type=ephemeral -o json | jq -r '.items[] | [.metadata.name, .metadata.labels.pr, .metadata.annotations[\"last-deploy\"]] | @tsv' |\nwhile IFS=$'\\t' read -r ns pr last; do\n state=$(gh pr view \"$pr\" --json state -q .state)\n if [ \"$state\" != OPEN ] || [ \"$(date -d \"$last\" +%s)\" -lt \"$limit\" ]; then\n echo \"deleting $ns (PR $pr $state, last deploy $last)\"; kubectl delete ns \"$ns\" --wait=false\n fi\ndone\n```",
1356
+ "y": 2210,
1357
+ "characteristic": "reliability",
1358
+ "scope": "atomic",
1359
+ "cadence": "triggered",
1360
+ "trigger": "pull-request",
1361
+ "invocation": "automated",
1362
+ "description": "The rendered manifests of every chart or overlay are scored in each pull request; a critical finding fails the build. The chart renders its PodDisruptionBudget with the Deployment, so the deployment-has-poddisruptionbudget check sees both; the user-and-group and read-only-root-file-system checks are on by default in current kube-score. The defaults that ask for more than the requirement (a CPU limit, ephemeral-storage requests and limits, pull policy Always, a NetworkPolicy per pod, host anti-affinity) are switched off; network reachability is not decided in this pack.\n\nThreshold: 0 critical kube-score findings in the rendered manifests (CPU and memory requests, memory limit, probes, replicas, PodDisruptionBudget, non-root user and group, read-only root file system, and kube-score's correctness checks), with the default checks the requirement does not ask for switched off\n\nTool: kube-score\n\n```bash\nhelm template order-api charts/order-api -f charts/order-api/values-production.yaml \\\n | kube-score score - --output-format ci \\\n --ignore-container-cpu-limit \\\n --ignore-test container-ephemeral-storage-request-and-limit \\\n --ignore-test container-image-pull-policy \\\n --ignore-test pod-networkpolicy \\\n --ignore-test deployment-has-host-podantiaffinity \\\n --ignore-test statefulset-has-host-podantiaffinity\n```",
1363
+ "hubWhen": {
1364
+ "HOSTING": [
1365
+ "paas",
1366
+ "serverless"
1367
+ ],
1368
+ "CLOUD": [
1369
+ "onprem"
1370
+ ]
1371
+ }
1372
+ },
1373
+ {
1374
+ "id": "ff-functions-aws",
1375
+ "type": "fitness-fn",
1376
+ "label": "Lambda functions bounded",
1377
+ "x": 1040,
1378
+ "y": 2340,
1379
+ "characteristic": "reliability",
1380
+ "scope": "atomic",
1381
+ "cadence": "triggered",
1382
+ "trigger": "deploy",
1383
+ "invocation": "automated",
1384
+ "description": "A check after each deploy lists the account's functions and fails on one with neither a reserved concurrency nor a maximum concurrency on each of its SQS triggers (the event source mapping's ScalingConfig, which caps the function's pollers without carving from the account's pool), or without either a dead-letter queue or an on-failure destination. Provisioned concurrency keeps instances warm but sets no ceiling, so it does not count as a limit.\n\nThreshold: 100% of functions have a concurrency limit (reserved concurrency, or a maximum concurrency on every SQS trigger) and a dead-letter queue or on-failure destination\n\nTool: AWS CLI (lambda) with jq\n\n```bash\n#!/usr/bin/env bash\n# every function: a concurrency limit (reserved, or a maximum on every SQS trigger)\n# and a dead-letter queue or on-failure destination\nset -euo pipefail\nfail=0\nfor fn in $(aws lambda list-functions --query 'Functions[].FunctionName' --output text); do\n reserved=$(aws lambda get-function-concurrency --function-name \"$fn\" --query ReservedConcurrentExecutions --output text)\n read -r sqs unbounded < <(aws lambda list-event-source-mappings --function-name \"$fn\" --output json | jq -r '\n [.EventSourceMappings[] | select(.EventSourceArn | startswith(\"arn:aws:sqs:\"))]\n | \"\\(length) \\(map(select(.ScalingConfig.MaximumConcurrency == null)) | length)\"')\n dlq=$(aws lambda get-function-configuration --function-name \"$fn\" --query 'DeadLetterConfig.TargetArn' --output text)\n dest=$(aws lambda get-function-event-invoke-config --function-name \"$fn\" \\\n --query 'DestinationConfig.OnFailure.Destination' --output text 2>/dev/null || echo None)\n if [ \"$reserved\" = None ] && { [ \"$sqs\" -eq 0 ] || [ \"$unbounded\" -gt 0 ]; }; then\n echo \"$fn: no concurrency limit (reserved, or a maximum concurrency on every SQS trigger)\"; fail=1\n fi\n [ \"$dlq\" != None ] || [ \"$dest\" != None ] || { echo \"$fn: no dead-letter queue or on-failure destination\"; fail=1; }\ndone\nexit $fail\n```",
1385
+ "hubWhen": {
1386
+ "HOSTING": [
1387
+ "serverless"
1388
+ ],
1389
+ "CLOUD": [
1390
+ "aws"
1391
+ ]
1392
+ }
1393
+ },
1394
+ {
1395
+ "id": "ff-functions-azure",
1396
+ "type": "fitness-fn",
1397
+ "label": "Azure Functions functions bounded",
1398
+ "x": 1040,
1399
+ "y": 2470,
1400
+ "characteristic": "reliability",
1401
+ "scope": "atomic",
1402
+ "cadence": "triggered",
1403
+ "trigger": "deploy",
1404
+ "invocation": "automated",
1405
+ "description": "A check after each deploy lists the subscription's function apps and fails on one whose site configuration has no scale-out limit. Failed Service Bus and Event Hubs events dead-letter on the queue itself, which the Messaging pack decides; Flex Consumption apps carry the limit in az functionapp scale config show instead.\n\nThreshold: 100% of function apps have a scale-out limit (functionAppScaleLimit above 0)\n\nTool: Azure CLI (functionapp)\n\n```bash\n#!/usr/bin/env bash\n# every function app: a scale-out limit\nset -euo pipefail\nfail=0\nwhile IFS=$'\\t' read -r name group; do\n limit=$(az functionapp config show --name \"$name\" --resource-group \"$group\" --query functionAppScaleLimit --output tsv)\n [ \"${limit:-0}\" -gt 0 ] || { echo \"$name: no scale-out limit (functionAppScaleLimit)\"; fail=1; }\ndone < <(az functionapp list --query '[].[name, resourceGroup]' --output tsv)\nexit $fail\n```",
1406
+ "hubWhen": {
1407
+ "HOSTING": [
1408
+ "serverless"
1409
+ ],
1410
+ "CLOUD": [
1411
+ "azure"
1412
+ ]
1413
+ }
1414
+ },
1415
+ {
1416
+ "id": "ff-functions-gcp",
1417
+ "type": "fitness-fn",
1418
+ "label": "Cloud Run functions functions bounded",
1419
+ "x": 1040,
1420
+ "y": 2600,
1421
+ "characteristic": "reliability",
1422
+ "scope": "atomic",
1423
+ "cadence": "triggered",
1424
+ "trigger": "deploy",
1425
+ "invocation": "automated",
1426
+ "description": "A check after each deploy lists the project's functions (2nd gen) and fails on one without a maximum instance count or, for an event trigger, without an explicit retry policy; failed events dead-letter on the Pub/Sub subscription, which the Messaging pack decides.\n\nThreshold: 100% of functions have a maximum instance count, and every event-triggered one an explicit retry policy\n\nTool: gcloud (functions)\n\n```bash\n#!/usr/bin/env bash\n# every function: a maximum instance count; event-triggered ones an explicit retry policy\nset -euo pipefail\nfail=0\nwhile IFS=, read -r name max trigger retry; do\n [ -n \"$max\" ] && [ \"$max\" -gt 0 ] || { echo \"$name: no maximum instance count\"; fail=1; }\n [ -z \"$trigger\" ] || [ -n \"$retry\" ] || { echo \"$name: event trigger without an explicit retry policy\"; fail=1; }\ndone < <(gcloud functions list --v2 --format='csv[no-heading](name, serviceConfig.maxInstanceCount, eventTrigger.trigger, eventTrigger.retryPolicy)')\nexit $fail\n```",
1427
+ "hubWhen": {
1428
+ "HOSTING": [
1429
+ "serverless"
1430
+ ],
1431
+ "CLOUD": [
1432
+ "gcp"
1433
+ ]
1434
+ }
1435
+ },
1436
+ {
1437
+ "id": "ff-image-age",
1438
+ "type": "fitness-fn",
1439
+ "label": "No machine on an old image",
1440
+ "x": 1040,
1441
+ "y": 2730,
1442
+ "characteristic": "security",
1443
+ "scope": "atomic",
1444
+ "cadence": "continual",
1445
+ "invocation": "automated",
1446
+ "description": "Packer bakes the build time into /etc/image-release; at boot, cloud-init writes it as a node_exporter textfile metric, and a Prometheus rule fires for any machine whose image is older than 30 days, in every cloud and on premises alike.\n\nThreshold: 0 machines whose image was built more than 30 days ago; the alert opens a ticket after 1 hour\n\nTool: Prometheus with node_exporter (textfile collector)\n\n```yaml\n# at boot (cloud-init), from the file Packer baked in: /etc/image-release holds BUILD_DATE=<epoch seconds>\n# . /etc/image-release && echo \"image_build_timestamp_seconds $BUILD_DATE\" > /var/lib/node_exporter/textfile/image.prom\ngroups:\n - name: machine-images\n rules:\n - alert: MachineImageOlderThan30Days\n expr: time() - image_build_timestamp_seconds > 30 * 86400\n for: 1h\n labels: { severity: ticket }\n annotations:\n summary: \"{{ $labels.instance }} runs an image built {{ $value | humanizeDuration }} ago; replace it from the current image\"\n```",
1447
+ "hubWhen": {
1448
+ "HOSTING": [
1449
+ "vms"
1450
+ ]
1451
+ }
1452
+ },
1453
+ {
1454
+ "id": "ff-cdn-origin",
1455
+ "type": "fitness-fn",
1456
+ "label": "Only through the CDN",
1457
+ "x": 1040,
1458
+ "y": 2860,
1459
+ "characteristic": "performance-efficiency",
1460
+ "scope": "atomic",
1461
+ "cadence": "triggered",
1462
+ "trigger": "deploy",
1463
+ "invocation": "automated",
1464
+ "description": "A check after each deploy fetches the page and one content-hashed asset of the build through the CDN and reads their headers against adr-cdn's caching rule (hashed assets cached for a year, the page revalidated), then requests the page directly from the origin bucket's URL and expects it refused: 403 or 404 from S3 and Cloud Storage, 409 (PublicAccessNotPermitted) from Azure Blob Storage with public access off.\n\nThreshold: The site answers over TLS with an HSTS header; its page with Cache-Control no-cache (or max-age=0 with must-revalidate) and a content-hashed asset with max-age=31536000; the origin answers a direct request for the page with 403, 404 or 409\n\nTool: curl (post-deploy check)\n\n```bash\n#!/usr/bin/env bash\n# SITE_URL: through the CDN; ORIGIN_URL: the bucket's own endpoint;\n# ASSET_PATH: one content-hashed file of this build (by default the first script under dist/assets)\nset -euo pipefail\nasset=${ASSET_PATH:-$(cd dist && ls assets/*.js | head -n 1)}\npage=$(curl -fsSI \"$SITE_URL/\" | tr -d '\\r')\ngrep -qi '^strict-transport-security:' <<<\"$page\" || { echo \"no HSTS header on $SITE_URL\"; exit 1; }\npage_cc=$(grep -i '^cache-control:' <<<\"$page\" || true)\n[[ \"$page_cc\" =~ no-cache ]] || { [[ \"$page_cc\" =~ max-age=0([^0-9]|$) ]] && [[ \"$page_cc\" =~ must-revalidate ]]; } \\\n || { echo \"the page is not revalidated on each request ($page_cc)\"; exit 1; }\nasset_cc=$(curl -fsSI \"$SITE_URL/$asset\" | tr -d '\\r' | grep -i '^cache-control:' || true)\n[[ \"$asset_cc\" =~ max-age=31536000 ]] || { echo \"$asset is not cached for a year ($asset_cc)\"; exit 1; }\ncode=$(curl -s -o /dev/null -w '%{http_code}' \"$ORIGIN_URL/index.html\")\n[ \"$code\" = 403 ] || [ \"$code\" = 404 ] || [ \"$code\" = 409 ] \\\n || { echo \"origin $ORIGIN_URL answers $code to a direct request (must refuse)\"; exit 1; }\n```",
1465
+ "hubWhen": {
1466
+ "HOSTING": [
1467
+ "cdn"
1468
+ ]
1469
+ }
1470
+ },
1471
+ {
1472
+ "id": "ff-ephemeral-k8s",
1473
+ "type": "fitness-fn",
1474
+ "label": "No forgotten environments (namespaces)",
1475
+ "x": 1040,
1476
+ "y": 2990,
1477
+ "characteristic": "other",
1478
+ "scope": "atomic",
1479
+ "cadence": "triggered",
1480
+ "trigger": "nightly",
1481
+ "invocation": "automated",
1482
+ "description": "A scheduled job lists the namespaces labelled as ephemeral, deletes those whose pull request is closed or whose last deploy (an annotation the deploy writes) is past the limit, and reports what it removed. Runs on Linux (GNU date).\n\nThreshold: 0 ephemeral namespaces alive after their pull request closed or idle for more than {{EPHEMERAL_HOURS}} hours\n\nTool: kubectl with the GitHub CLI (scheduled job)\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nlimit=$(( $(date +%s) - {{EPHEMERAL_HOURS}} * 3600 ))\nkubectl get ns -l env-type=ephemeral -o json \\\n | jq -r '.items[] | [.metadata.name, .metadata.labels.pr, (.metadata.annotations[\"last-deploy\"] // \"\")] | @tsv' |\nwhile IFS=$'\\t' read -r ns pr last; do\n state=$(gh pr view \"$pr\" --repo \"$GITHUB_REPOSITORY\" --json state -q .state)\n if [ \"$state\" != OPEN ] || [ -z \"$last\" ] || [ \"$(date -d \"$last\" +%s)\" -lt \"$limit\" ]; then\n echo \"deleting $ns (PR $pr $state, last deploy ${last:-unknown})\"; kubectl delete ns \"$ns\" --wait=false\n fi\ndone\n```",
776
1483
  "hubWhen": {
777
1484
  "ENVIRONMENTS": [
778
1485
  "ephemeral"
1486
+ ],
1487
+ "HOSTING": [
1488
+ "kubernetes"
1489
+ ]
1490
+ }
1491
+ },
1492
+ {
1493
+ "id": "ff-ephemeral-terraform",
1494
+ "type": "fitness-fn",
1495
+ "label": "No forgotten environments (workspaces)",
1496
+ "x": 1040,
1497
+ "y": 3120,
1498
+ "characteristic": "other",
1499
+ "scope": "atomic",
1500
+ "cadence": "triggered",
1501
+ "trigger": "nightly",
1502
+ "invocation": "automated",
1503
+ "description": "A scheduled job lists the Terraform workspaces named pr-<number>, destroys those whose pull request is closed or last updated past the limit, and deletes the workspace. Runs on Linux (GNU date).\n\nThreshold: 0 ephemeral environments alive after their pull request closed or idle for more than {{EPHEMERAL_HOURS}} hours\n\nTool: Terraform with the GitHub CLI (scheduled job)\n\n```bash\n#!/usr/bin/env bash\n# in envs/ephemeral; workspaces are named pr-<number>\nset -euo pipefail\nlimit=$(( $(date +%s) - {{EPHEMERAL_HOURS}} * 3600 ))\nfor ws in $(terraform workspace list | tr -d '* ' | grep -E '^pr-[0-9]+$'); do\n pr=${ws#pr-}\n read -r state updated < <(gh pr view \"$pr\" --repo \"$GITHUB_REPOSITORY\" --json state,updatedAt -q '\"\\(.state) \\(.updatedAt)\"')\n if [ \"$state\" != OPEN ] || [ \"$(date -d \"$updated\" +%s)\" -lt \"$limit\" ]; then\n echo \"destroying $ws (PR $pr $state, last activity $updated)\"\n terraform workspace select \"$ws\"\n terraform destroy -auto-approve -input=false -var \"pr=$pr\"\n terraform workspace select default && terraform workspace delete \"$ws\"\n fi\ndone\n```",
1504
+ "hubWhen": {
1505
+ "ENVIRONMENTS": [
1506
+ "ephemeral"
1507
+ ],
1508
+ "HOSTING": [
1509
+ "paas",
1510
+ "serverless",
1511
+ "vms",
1512
+ "cdn"
1513
+ ],
1514
+ "IAC": [
1515
+ "terraform"
1516
+ ]
1517
+ }
1518
+ },
1519
+ {
1520
+ "id": "ff-ephemeral-terraform-fallback",
1521
+ "type": "fitness-fn",
1522
+ "label": "No forgotten environments (workspaces)",
1523
+ "x": 1040,
1524
+ "y": 3250,
1525
+ "characteristic": "other",
1526
+ "scope": "atomic",
1527
+ "cadence": "triggered",
1528
+ "trigger": "nightly",
1529
+ "invocation": "automated",
1530
+ "description": "A scheduled job lists the Terraform workspaces named pr-<number>, destroys those whose pull request is closed or last updated past the limit, and deletes the workspace. Runs on Linux (GNU date).\n\nThreshold: 0 ephemeral environments alive after their pull request closed or idle for more than {{EPHEMERAL_HOURS}} hours\n\nTool: Terraform with the GitHub CLI (scheduled job)\n\n```bash\n#!/usr/bin/env bash\n# in envs/ephemeral; workspaces are named pr-<number>\nset -euo pipefail\nlimit=$(( $(date +%s) - {{EPHEMERAL_HOURS}} * 3600 ))\nfor ws in $(terraform workspace list | tr -d '* ' | grep -E '^pr-[0-9]+$'); do\n pr=${ws#pr-}\n read -r state updated < <(gh pr view \"$pr\" --repo \"$GITHUB_REPOSITORY\" --json state,updatedAt -q '\"\\(.state) \\(.updatedAt)\"')\n if [ \"$state\" != OPEN ] || [ \"$(date -d \"$updated\" +%s)\" -lt \"$limit\" ]; then\n echo \"destroying $ws (PR $pr $state, last activity $updated)\"\n terraform workspace select \"$ws\"\n terraform destroy -auto-approve -input=false -var \"pr=$pr\"\n terraform workspace select default && terraform workspace delete \"$ws\"\n fi\ndone\n```",
1531
+ "hubWhen": {
1532
+ "ENVIRONMENTS": [
1533
+ "ephemeral"
1534
+ ],
1535
+ "HOSTING": [
1536
+ "paas",
1537
+ "serverless",
1538
+ "vms",
1539
+ "cdn"
1540
+ ],
1541
+ "IAC": [
1542
+ "native"
1543
+ ],
1544
+ "CLOUD": [
1545
+ "gcp",
1546
+ "onprem"
1547
+ ]
1548
+ }
1549
+ },
1550
+ {
1551
+ "id": "ff-ephemeral-pulumi",
1552
+ "type": "fitness-fn",
1553
+ "label": "No forgotten environments (stacks)",
1554
+ "x": 1040,
1555
+ "y": 3380,
1556
+ "characteristic": "other",
1557
+ "scope": "atomic",
1558
+ "cadence": "triggered",
1559
+ "trigger": "nightly",
1560
+ "invocation": "automated",
1561
+ "description": "A scheduled job lists the stacks named pr-<number> with their last update, destroys those whose pull request is closed or last updated past the limit, and removes the stack. Runs on Linux (GNU date).\n\nThreshold: 0 ephemeral environments alive after their pull request closed or idle for more than {{EPHEMERAL_HOURS}} hours\n\nTool: Pulumi with the GitHub CLI (scheduled job)\n\n```bash\n#!/usr/bin/env bash\n# stacks are named pr-<number>\nset -euo pipefail\nlimit=$(( $(date +%s) - {{EPHEMERAL_HOURS}} * 3600 ))\npulumi stack ls --json | jq -r '.[] | select(.name | test(\"^pr-[0-9]+$\")) | \"\\(.name) \\(.lastUpdate // \"\")\"' |\nwhile read -r stack last; do\n pr=${stack#pr-}\n state=$(gh pr view \"$pr\" --repo \"$GITHUB_REPOSITORY\" --json state -q .state)\n if [ \"$state\" != OPEN ] || [ -z \"$last\" ] || [ \"$(date -d \"$last\" +%s)\" -lt \"$limit\" ]; then\n echo \"destroying $stack (PR $pr $state, last update ${last:-unknown})\"\n pulumi destroy --stack \"$stack\" --yes --non-interactive && pulumi stack rm \"$stack\" --yes\n fi\ndone\n```",
1562
+ "hubWhen": {
1563
+ "ENVIRONMENTS": [
1564
+ "ephemeral"
1565
+ ],
1566
+ "HOSTING": [
1567
+ "paas",
1568
+ "serverless",
1569
+ "vms",
1570
+ "cdn"
1571
+ ],
1572
+ "IAC": [
1573
+ "pulumi"
1574
+ ]
1575
+ }
1576
+ },
1577
+ {
1578
+ "id": "ff-ephemeral-native",
1579
+ "type": "fitness-fn",
1580
+ "label": "No forgotten environments (stacks and resource groups)",
1581
+ "x": 1040,
1582
+ "y": 3510,
1583
+ "characteristic": "other",
1584
+ "scope": "atomic",
1585
+ "cadence": "triggered",
1586
+ "trigger": "nightly",
1587
+ "invocation": "automated",
1588
+ "description": "A scheduled job runs the part for the cloud in use (the CLOUD variable): on AWS it lists the CloudFormation stacks tagged pr=<number>, on Azure the resource groups tagged pr=<number>, and deletes those whose pull request is closed or last updated past the limit. Runs on Linux (GNU date).\n\nThreshold: 0 ephemeral environments alive after their pull request closed or idle for more than {{EPHEMERAL_HOURS}} hours\n\nTool: AWS CLI (cloudformation) or Azure CLI (group) with the GitHub CLI (scheduled job)\n\n```bash\n#!/usr/bin/env bash\n# the pipeline sets CLOUD to aws or azure; ephemeral stacks or resource groups are tagged pr=<number>\nset -euo pipefail\nlimit=$(( $(date +%s) - {{EPHEMERAL_HOURS}} * 3600 ))\ngone() { [ \"$(gh pr view \"$1\" --repo \"$GITHUB_REPOSITORY\" --json state -q .state)\" != OPEN ] || [ \"$(date -d \"$2\" +%s)\" -lt \"$limit\" ]; }\ncase \"$CLOUD\" in\n aws)\n aws cloudformation describe-stacks \\\n --query \"Stacks[?Tags[?Key=='pr']].[StackName, Tags[?Key=='pr'].Value | [0], LastUpdatedTime || CreationTime]\" --output text |\n while IFS=$'\\t' read -r stack pr updated; do\n if gone \"$pr\" \"$updated\"; then echo \"deleting $stack (PR $pr)\"; aws cloudformation delete-stack --stack-name \"$stack\"; fi\n done ;;\n azure)\n az group list --query \"[?tags.pr].[name, tags.pr]\" --output tsv |\n while IFS=$'\\t' read -r group pr; do\n updated=$(gh pr view \"$pr\" --repo \"$GITHUB_REPOSITORY\" --json updatedAt -q .updatedAt)\n if gone \"$pr\" \"$updated\"; then echo \"deleting $group (PR $pr)\"; az group delete --name \"$group\" --yes --no-wait; fi\n done ;;\nesac\n```",
1589
+ "hubWhen": {
1590
+ "ENVIRONMENTS": [
1591
+ "ephemeral"
1592
+ ],
1593
+ "HOSTING": [
1594
+ "paas",
1595
+ "serverless",
1596
+ "vms",
1597
+ "cdn"
1598
+ ],
1599
+ "IAC": [
1600
+ "native"
1601
+ ],
1602
+ "CLOUD": [
1603
+ "aws",
1604
+ "azure"
1605
+ ]
1606
+ }
1607
+ },
1608
+ {
1609
+ "id": "ff-parity",
1610
+ "type": "fitness-fn",
1611
+ "label": "Environments share their code",
1612
+ "x": 1040,
1613
+ "y": 3640,
1614
+ "characteristic": "maintainability",
1615
+ "scope": "atomic",
1616
+ "cadence": "triggered",
1617
+ "trigger": "pull-request",
1618
+ "invocation": "automated",
1619
+ "description": "A check in every pull request compares the test environment's root with production's, ignoring the variable files of the tool in use (tfvars, Pulumi stack configuration, Bicep or CloudFormation parameter files); any other difference, a module version or an extra resource, fails it.\n\nThreshold: The test environment's and production's folders under envs/ differ only in their variable files\n\nTool: diff (CI job)\n\n```bash\n#!/usr/bin/env bash\n# TEST_ENV: staging, or test when there is no staging\nset -euo pipefail\ndiff -rq \"envs/${TEST_ENV:-staging}\" envs/production \\\n --exclude='*.tfvars' --exclude='*.auto.tfvars' --exclude='Pulumi.*.yaml' --exclude='*.bicepparam' --exclude='*.params.json' \\\n && echo \"environments share the same code\" \\\n || { echo \"the environments differ beyond their variable files (above)\"; exit 1; }\n```"
1620
+ },
1621
+ {
1622
+ "id": "ff-promote",
1623
+ "type": "fitness-fn",
1624
+ "label": "Only the tested digest reaches production",
1625
+ "x": 1040,
1626
+ "y": 3770,
1627
+ "characteristic": "reliability",
1628
+ "scope": "atomic",
1629
+ "cadence": "triggered",
1630
+ "trigger": "deploy",
1631
+ "invocation": "automated",
1632
+ "description": "The staging deploy job records the image digest in the payload of the GitHub deployment it creates; the production deploy job reads the latest staging deployment's payload and refuses to continue with any other digest, so production never gets a rebuild or a newer image than staging tested.\n\nThreshold: The digest the production deploy job deploys equals the digest recorded by the latest staging deployment; any other digest fails the job\n\nTool: GitHub CLI (deployments API) in the deploy pipeline\n\n```bash\n#!/usr/bin/env bash\n# production deploy step; IMAGE_DIGEST is what this job is about to deploy\nset -euo pipefail\ntested=$(gh api \"repos/$GITHUB_REPOSITORY/deployments?environment=staging&per_page=1\" -q '.[0].payload.digest')\n[ \"$tested\" = \"$IMAGE_DIGEST\" ] || { echo \"production would get $IMAGE_DIGEST; staging tested $tested\"; exit 1; }\n# the staging deploy job created its deployment with:\n# gh api \"repos/$GITHUB_REPOSITORY/deployments\" -f ref=\"$GITHUB_SHA\" -f environment=staging -f \"payload[digest]=$IMAGE_DIGEST\"\n```",
1633
+ "hubWhen": {
1634
+ "ENVIRONMENTS": [
1635
+ "staged",
1636
+ "ephemeral"
779
1637
  ]
780
1638
  }
781
1639
  }
@@ -817,6 +1675,24 @@
817
1675
  "targetId": "need",
818
1676
  "relationType": "derives"
819
1677
  },
1678
+ {
1679
+ "id": "req-cost-review-fallback--derives--need",
1680
+ "sourceId": "req-cost-review-fallback",
1681
+ "targetId": "need",
1682
+ "relationType": "derives"
1683
+ },
1684
+ {
1685
+ "id": "req-cost-estimate--derives--need",
1686
+ "sourceId": "req-cost-estimate",
1687
+ "targetId": "need",
1688
+ "relationType": "derives"
1689
+ },
1690
+ {
1691
+ "id": "req-cost-estimate-native--derives--need",
1692
+ "sourceId": "req-cost-estimate-native",
1693
+ "targetId": "need",
1694
+ "relationType": "derives"
1695
+ },
820
1696
  {
821
1697
  "id": "req-paas--derives--need",
822
1698
  "sourceId": "req-paas",
@@ -829,6 +1705,12 @@
829
1705
  "targetId": "need",
830
1706
  "relationType": "derives"
831
1707
  },
1708
+ {
1709
+ "id": "req-k8s-onprem--derives--need",
1710
+ "sourceId": "req-k8s-onprem",
1711
+ "targetId": "need",
1712
+ "relationType": "derives"
1713
+ },
832
1714
  {
833
1715
  "id": "req-functions--derives--need",
834
1716
  "sourceId": "req-functions",
@@ -842,8 +1724,8 @@
842
1724
  "relationType": "derives"
843
1725
  },
844
1726
  {
845
- "id": "req-capacity--derives--need",
846
- "sourceId": "req-capacity",
1727
+ "id": "req-cdn--derives--need",
1728
+ "sourceId": "req-cdn",
847
1729
  "targetId": "need",
848
1730
  "relationType": "derives"
849
1731
  },
@@ -859,12 +1741,6 @@
859
1741
  "targetId": "need",
860
1742
  "relationType": "derives"
861
1743
  },
862
- {
863
- "id": "req-canary--derives--need",
864
- "sourceId": "req-canary",
865
- "targetId": "need",
866
- "relationType": "derives"
867
- },
868
1744
  {
869
1745
  "id": "sc-iac--verifies--req-iac",
870
1746
  "sourceId": "sc-iac",
@@ -901,6 +1777,24 @@
901
1777
  "targetId": "req-cost-review",
902
1778
  "relationType": "verifies"
903
1779
  },
1780
+ {
1781
+ "id": "sc-cost-review-fallback--verifies--req-cost-review-fallback",
1782
+ "sourceId": "sc-cost-review-fallback",
1783
+ "targetId": "req-cost-review-fallback",
1784
+ "relationType": "verifies"
1785
+ },
1786
+ {
1787
+ "id": "sc-cost-estimate--verifies--req-cost-estimate",
1788
+ "sourceId": "sc-cost-estimate",
1789
+ "targetId": "req-cost-estimate",
1790
+ "relationType": "verifies"
1791
+ },
1792
+ {
1793
+ "id": "sc-cost-estimate-native--verifies--req-cost-estimate-native",
1794
+ "sourceId": "sc-cost-estimate-native",
1795
+ "targetId": "req-cost-estimate-native",
1796
+ "relationType": "verifies"
1797
+ },
904
1798
  {
905
1799
  "id": "sc-paas--verifies--req-paas",
906
1800
  "sourceId": "sc-paas",
@@ -913,6 +1807,12 @@
913
1807
  "targetId": "req-k8s",
914
1808
  "relationType": "verifies"
915
1809
  },
1810
+ {
1811
+ "id": "sc-k8s-onprem--verifies--req-k8s-onprem",
1812
+ "sourceId": "sc-k8s-onprem",
1813
+ "targetId": "req-k8s-onprem",
1814
+ "relationType": "verifies"
1815
+ },
916
1816
  {
917
1817
  "id": "sc-functions--verifies--req-functions",
918
1818
  "sourceId": "sc-functions",
@@ -926,9 +1826,9 @@
926
1826
  "relationType": "verifies"
927
1827
  },
928
1828
  {
929
- "id": "sc-capacity--verifies--req-capacity",
930
- "sourceId": "sc-capacity",
931
- "targetId": "req-capacity",
1829
+ "id": "sc-cdn--verifies--req-cdn",
1830
+ "sourceId": "sc-cdn",
1831
+ "targetId": "req-cdn",
932
1832
  "relationType": "verifies"
933
1833
  },
934
1834
  {
@@ -944,208 +1844,340 @@
944
1844
  "relationType": "verifies"
945
1845
  },
946
1846
  {
947
- "id": "sc-canary--verifies--req-canary",
948
- "sourceId": "sc-canary",
949
- "targetId": "req-canary",
950
- "relationType": "verifies"
1847
+ "id": "ff-checkov--implements--adr-iac-terraform",
1848
+ "sourceId": "ff-checkov",
1849
+ "targetId": "adr-iac-terraform",
1850
+ "relationType": "implements"
951
1851
  },
952
1852
  {
953
- "id": "ff-checkov--implements--adr-paas",
954
- "sourceId": "ff-checkov",
955
- "targetId": "adr-paas",
1853
+ "id": "ff-checkov-fallback--implements--adr-iac-native-fallback",
1854
+ "sourceId": "ff-checkov-fallback",
1855
+ "targetId": "adr-iac-native-fallback",
956
1856
  "relationType": "implements"
957
1857
  },
958
1858
  {
959
- "id": "ff-checkov--implements--adr-kubernetes",
960
- "sourceId": "ff-checkov",
961
- "targetId": "adr-kubernetes",
1859
+ "id": "ff-checkov-native--implements--adr-iac-native",
1860
+ "sourceId": "ff-checkov-native",
1861
+ "targetId": "adr-iac-native",
962
1862
  "relationType": "implements"
963
1863
  },
964
1864
  {
965
- "id": "ff-checkov--implements--adr-serverless",
966
- "sourceId": "ff-checkov",
967
- "targetId": "adr-serverless",
1865
+ "id": "ff-crossguard--implements--adr-iac-pulumi",
1866
+ "sourceId": "ff-crossguard",
1867
+ "targetId": "adr-iac-pulumi",
968
1868
  "relationType": "implements"
969
1869
  },
970
1870
  {
971
- "id": "ff-checkov--implements--adr-vms",
972
- "sourceId": "ff-checkov",
973
- "targetId": "adr-vms",
1871
+ "id": "ff-drift-terraform--implements--adr-iac-terraform",
1872
+ "sourceId": "ff-drift-terraform",
1873
+ "targetId": "adr-iac-terraform",
974
1874
  "relationType": "implements"
975
1875
  },
976
1876
  {
977
- "id": "ff-crossguard--implements--adr-paas",
978
- "sourceId": "ff-crossguard",
1877
+ "id": "ff-drift-terraform-fallback--implements--adr-iac-native-fallback",
1878
+ "sourceId": "ff-drift-terraform-fallback",
1879
+ "targetId": "adr-iac-native-fallback",
1880
+ "relationType": "implements"
1881
+ },
1882
+ {
1883
+ "id": "ff-drift-pulumi--implements--adr-iac-pulumi",
1884
+ "sourceId": "ff-drift-pulumi",
1885
+ "targetId": "adr-iac-pulumi",
1886
+ "relationType": "implements"
1887
+ },
1888
+ {
1889
+ "id": "ff-drift-native--implements--adr-iac-native",
1890
+ "sourceId": "ff-drift-native",
1891
+ "targetId": "adr-iac-native",
1892
+ "relationType": "implements"
1893
+ },
1894
+ {
1895
+ "id": "ff-budget-aws--implements--adr-budget",
1896
+ "sourceId": "ff-budget-aws",
1897
+ "targetId": "adr-budget",
1898
+ "relationType": "implements"
1899
+ },
1900
+ {
1901
+ "id": "ff-budget-azure--implements--adr-budget",
1902
+ "sourceId": "ff-budget-azure",
1903
+ "targetId": "adr-budget",
1904
+ "relationType": "implements"
1905
+ },
1906
+ {
1907
+ "id": "ff-budget-gcp--implements--adr-budget",
1908
+ "sourceId": "ff-budget-gcp",
1909
+ "targetId": "adr-budget",
1910
+ "relationType": "implements"
1911
+ },
1912
+ {
1913
+ "id": "ff-infracost--implements--adr-budget",
1914
+ "sourceId": "ff-infracost",
1915
+ "targetId": "adr-budget",
1916
+ "relationType": "implements"
1917
+ },
1918
+ {
1919
+ "id": "ff-infracost-fallback--implements--adr-budget",
1920
+ "sourceId": "ff-infracost-fallback",
1921
+ "targetId": "adr-budget",
1922
+ "relationType": "implements"
1923
+ },
1924
+ {
1925
+ "id": "ff-paas-aws--implements--adr-paas",
1926
+ "sourceId": "ff-paas-aws",
979
1927
  "targetId": "adr-paas",
980
1928
  "relationType": "implements"
981
1929
  },
982
1930
  {
983
- "id": "ff-crossguard--implements--adr-kubernetes",
984
- "sourceId": "ff-crossguard",
1931
+ "id": "ff-paas-azure--implements--adr-paas",
1932
+ "sourceId": "ff-paas-azure",
1933
+ "targetId": "adr-paas",
1934
+ "relationType": "implements"
1935
+ },
1936
+ {
1937
+ "id": "ff-paas-gcp--implements--adr-paas",
1938
+ "sourceId": "ff-paas-gcp",
1939
+ "targetId": "adr-paas",
1940
+ "relationType": "implements"
1941
+ },
1942
+ {
1943
+ "id": "ff-kube-score--implements--adr-kubernetes",
1944
+ "sourceId": "ff-kube-score",
985
1945
  "targetId": "adr-kubernetes",
986
1946
  "relationType": "implements"
987
1947
  },
988
1948
  {
989
- "id": "ff-crossguard--implements--adr-serverless",
990
- "sourceId": "ff-crossguard",
1949
+ "id": "ff-kube-score-onprem--implements--adr-onprem-platform",
1950
+ "sourceId": "ff-kube-score-onprem",
1951
+ "targetId": "adr-onprem-platform",
1952
+ "relationType": "implements"
1953
+ },
1954
+ {
1955
+ "id": "ff-functions-aws--implements--adr-serverless",
1956
+ "sourceId": "ff-functions-aws",
991
1957
  "targetId": "adr-serverless",
992
1958
  "relationType": "implements"
993
1959
  },
994
1960
  {
995
- "id": "ff-crossguard--implements--adr-vms",
996
- "sourceId": "ff-crossguard",
1961
+ "id": "ff-functions-azure--implements--adr-serverless",
1962
+ "sourceId": "ff-functions-azure",
1963
+ "targetId": "adr-serverless",
1964
+ "relationType": "implements"
1965
+ },
1966
+ {
1967
+ "id": "ff-functions-gcp--implements--adr-serverless",
1968
+ "sourceId": "ff-functions-gcp",
1969
+ "targetId": "adr-serverless",
1970
+ "relationType": "implements"
1971
+ },
1972
+ {
1973
+ "id": "ff-image-age--implements--adr-vms",
1974
+ "sourceId": "ff-image-age",
997
1975
  "targetId": "adr-vms",
998
1976
  "relationType": "implements"
999
1977
  },
1000
1978
  {
1001
- "id": "ff-drift-terraform--implements--adr-paas",
1002
- "sourceId": "ff-drift-terraform",
1003
- "targetId": "adr-paas",
1979
+ "id": "ff-cdn-origin--implements--adr-cdn",
1980
+ "sourceId": "ff-cdn-origin",
1981
+ "targetId": "adr-cdn",
1004
1982
  "relationType": "implements"
1005
1983
  },
1006
1984
  {
1007
- "id": "ff-drift-terraform--implements--adr-kubernetes",
1008
- "sourceId": "ff-drift-terraform",
1985
+ "id": "ff-ephemeral-k8s--implements--adr-kubernetes",
1986
+ "sourceId": "ff-ephemeral-k8s",
1009
1987
  "targetId": "adr-kubernetes",
1010
1988
  "relationType": "implements"
1011
1989
  },
1012
1990
  {
1013
- "id": "ff-drift-terraform--implements--adr-serverless",
1014
- "sourceId": "ff-drift-terraform",
1991
+ "id": "ff-ephemeral-terraform--implements--adr-paas",
1992
+ "sourceId": "ff-ephemeral-terraform",
1993
+ "targetId": "adr-paas",
1994
+ "relationType": "implements"
1995
+ },
1996
+ {
1997
+ "id": "ff-ephemeral-terraform--implements--adr-serverless",
1998
+ "sourceId": "ff-ephemeral-terraform",
1015
1999
  "targetId": "adr-serverless",
1016
2000
  "relationType": "implements"
1017
2001
  },
1018
2002
  {
1019
- "id": "ff-drift-terraform--implements--adr-vms",
1020
- "sourceId": "ff-drift-terraform",
2003
+ "id": "ff-ephemeral-terraform--implements--adr-vms",
2004
+ "sourceId": "ff-ephemeral-terraform",
1021
2005
  "targetId": "adr-vms",
1022
2006
  "relationType": "implements"
1023
2007
  },
1024
2008
  {
1025
- "id": "ff-drift-pulumi--implements--adr-paas",
1026
- "sourceId": "ff-drift-pulumi",
1027
- "targetId": "adr-paas",
2009
+ "id": "ff-ephemeral-terraform--implements--adr-cdn",
2010
+ "sourceId": "ff-ephemeral-terraform",
2011
+ "targetId": "adr-cdn",
1028
2012
  "relationType": "implements"
1029
2013
  },
1030
2014
  {
1031
- "id": "ff-drift-pulumi--implements--adr-kubernetes",
1032
- "sourceId": "ff-drift-pulumi",
1033
- "targetId": "adr-kubernetes",
2015
+ "id": "ff-ephemeral-terraform--implements--adr-onprem-platform",
2016
+ "sourceId": "ff-ephemeral-terraform",
2017
+ "targetId": "adr-onprem-platform",
1034
2018
  "relationType": "implements"
1035
2019
  },
1036
2020
  {
1037
- "id": "ff-drift-pulumi--implements--adr-serverless",
1038
- "sourceId": "ff-drift-pulumi",
2021
+ "id": "ff-ephemeral-terraform-fallback--implements--adr-paas",
2022
+ "sourceId": "ff-ephemeral-terraform-fallback",
2023
+ "targetId": "adr-paas",
2024
+ "relationType": "implements"
2025
+ },
2026
+ {
2027
+ "id": "ff-ephemeral-terraform-fallback--implements--adr-serverless",
2028
+ "sourceId": "ff-ephemeral-terraform-fallback",
1039
2029
  "targetId": "adr-serverless",
1040
2030
  "relationType": "implements"
1041
2031
  },
1042
2032
  {
1043
- "id": "ff-drift-pulumi--implements--adr-vms",
1044
- "sourceId": "ff-drift-pulumi",
2033
+ "id": "ff-ephemeral-terraform-fallback--implements--adr-vms",
2034
+ "sourceId": "ff-ephemeral-terraform-fallback",
1045
2035
  "targetId": "adr-vms",
1046
2036
  "relationType": "implements"
1047
2037
  },
1048
2038
  {
1049
- "id": "ff-drift-native--implements--adr-paas",
1050
- "sourceId": "ff-drift-native",
1051
- "targetId": "adr-paas",
2039
+ "id": "ff-ephemeral-terraform-fallback--implements--adr-cdn",
2040
+ "sourceId": "ff-ephemeral-terraform-fallback",
2041
+ "targetId": "adr-cdn",
1052
2042
  "relationType": "implements"
1053
2043
  },
1054
2044
  {
1055
- "id": "ff-drift-native--implements--adr-kubernetes",
1056
- "sourceId": "ff-drift-native",
1057
- "targetId": "adr-kubernetes",
2045
+ "id": "ff-ephemeral-terraform-fallback--implements--adr-onprem-platform",
2046
+ "sourceId": "ff-ephemeral-terraform-fallback",
2047
+ "targetId": "adr-onprem-platform",
1058
2048
  "relationType": "implements"
1059
2049
  },
1060
2050
  {
1061
- "id": "ff-drift-native--implements--adr-serverless",
1062
- "sourceId": "ff-drift-native",
2051
+ "id": "ff-ephemeral-pulumi--implements--adr-paas",
2052
+ "sourceId": "ff-ephemeral-pulumi",
2053
+ "targetId": "adr-paas",
2054
+ "relationType": "implements"
2055
+ },
2056
+ {
2057
+ "id": "ff-ephemeral-pulumi--implements--adr-serverless",
2058
+ "sourceId": "ff-ephemeral-pulumi",
1063
2059
  "targetId": "adr-serverless",
1064
2060
  "relationType": "implements"
1065
2061
  },
1066
2062
  {
1067
- "id": "ff-drift-native--implements--adr-vms",
1068
- "sourceId": "ff-drift-native",
2063
+ "id": "ff-ephemeral-pulumi--implements--adr-vms",
2064
+ "sourceId": "ff-ephemeral-pulumi",
1069
2065
  "targetId": "adr-vms",
1070
2066
  "relationType": "implements"
1071
2067
  },
1072
2068
  {
1073
- "id": "ff-budget--implements--adr-paas",
1074
- "sourceId": "ff-budget",
1075
- "targetId": "adr-paas",
2069
+ "id": "ff-ephemeral-pulumi--implements--adr-cdn",
2070
+ "sourceId": "ff-ephemeral-pulumi",
2071
+ "targetId": "adr-cdn",
1076
2072
  "relationType": "implements"
1077
2073
  },
1078
2074
  {
1079
- "id": "ff-budget--implements--adr-kubernetes",
1080
- "sourceId": "ff-budget",
1081
- "targetId": "adr-kubernetes",
2075
+ "id": "ff-ephemeral-pulumi--implements--adr-onprem-platform",
2076
+ "sourceId": "ff-ephemeral-pulumi",
2077
+ "targetId": "adr-onprem-platform",
2078
+ "relationType": "implements"
2079
+ },
2080
+ {
2081
+ "id": "ff-ephemeral-native--implements--adr-paas",
2082
+ "sourceId": "ff-ephemeral-native",
2083
+ "targetId": "adr-paas",
1082
2084
  "relationType": "implements"
1083
2085
  },
1084
2086
  {
1085
- "id": "ff-budget--implements--adr-serverless",
1086
- "sourceId": "ff-budget",
2087
+ "id": "ff-ephemeral-native--implements--adr-serverless",
2088
+ "sourceId": "ff-ephemeral-native",
1087
2089
  "targetId": "adr-serverless",
1088
2090
  "relationType": "implements"
1089
2091
  },
1090
2092
  {
1091
- "id": "ff-budget--implements--adr-vms",
1092
- "sourceId": "ff-budget",
2093
+ "id": "ff-ephemeral-native--implements--adr-vms",
2094
+ "sourceId": "ff-ephemeral-native",
1093
2095
  "targetId": "adr-vms",
1094
2096
  "relationType": "implements"
1095
2097
  },
1096
2098
  {
1097
- "id": "ff-infracost--implements--adr-paas",
1098
- "sourceId": "ff-infracost",
2099
+ "id": "ff-ephemeral-native--implements--adr-cdn",
2100
+ "sourceId": "ff-ephemeral-native",
2101
+ "targetId": "adr-cdn",
2102
+ "relationType": "implements"
2103
+ },
2104
+ {
2105
+ "id": "ff-ephemeral-native--implements--adr-onprem-platform",
2106
+ "sourceId": "ff-ephemeral-native",
2107
+ "targetId": "adr-onprem-platform",
2108
+ "relationType": "implements"
2109
+ },
2110
+ {
2111
+ "id": "ff-parity--implements--adr-paas",
2112
+ "sourceId": "ff-parity",
1099
2113
  "targetId": "adr-paas",
1100
2114
  "relationType": "implements"
1101
2115
  },
1102
2116
  {
1103
- "id": "ff-infracost--implements--adr-kubernetes",
1104
- "sourceId": "ff-infracost",
2117
+ "id": "ff-parity--implements--adr-kubernetes",
2118
+ "sourceId": "ff-parity",
1105
2119
  "targetId": "adr-kubernetes",
1106
2120
  "relationType": "implements"
1107
2121
  },
1108
2122
  {
1109
- "id": "ff-infracost--implements--adr-serverless",
1110
- "sourceId": "ff-infracost",
2123
+ "id": "ff-parity--implements--adr-serverless",
2124
+ "sourceId": "ff-parity",
1111
2125
  "targetId": "adr-serverless",
1112
2126
  "relationType": "implements"
1113
2127
  },
1114
2128
  {
1115
- "id": "ff-infracost--implements--adr-vms",
1116
- "sourceId": "ff-infracost",
2129
+ "id": "ff-parity--implements--adr-vms",
2130
+ "sourceId": "ff-parity",
1117
2131
  "targetId": "adr-vms",
1118
2132
  "relationType": "implements"
1119
2133
  },
1120
2134
  {
1121
- "id": "ff-kube-score--implements--adr-kubernetes",
1122
- "sourceId": "ff-kube-score",
1123
- "targetId": "adr-kubernetes",
2135
+ "id": "ff-parity--implements--adr-cdn",
2136
+ "sourceId": "ff-parity",
2137
+ "targetId": "adr-cdn",
1124
2138
  "relationType": "implements"
1125
2139
  },
1126
2140
  {
1127
- "id": "ff-ephemeral-ttl--implements--adr-paas",
1128
- "sourceId": "ff-ephemeral-ttl",
2141
+ "id": "ff-parity--implements--adr-onprem-platform",
2142
+ "sourceId": "ff-parity",
2143
+ "targetId": "adr-onprem-platform",
2144
+ "relationType": "implements"
2145
+ },
2146
+ {
2147
+ "id": "ff-promote--implements--adr-paas",
2148
+ "sourceId": "ff-promote",
1129
2149
  "targetId": "adr-paas",
1130
2150
  "relationType": "implements"
1131
2151
  },
1132
2152
  {
1133
- "id": "ff-ephemeral-ttl--implements--adr-kubernetes",
1134
- "sourceId": "ff-ephemeral-ttl",
2153
+ "id": "ff-promote--implements--adr-kubernetes",
2154
+ "sourceId": "ff-promote",
1135
2155
  "targetId": "adr-kubernetes",
1136
2156
  "relationType": "implements"
1137
2157
  },
1138
2158
  {
1139
- "id": "ff-ephemeral-ttl--implements--adr-serverless",
1140
- "sourceId": "ff-ephemeral-ttl",
2159
+ "id": "ff-promote--implements--adr-serverless",
2160
+ "sourceId": "ff-promote",
1141
2161
  "targetId": "adr-serverless",
1142
2162
  "relationType": "implements"
1143
2163
  },
1144
2164
  {
1145
- "id": "ff-ephemeral-ttl--implements--adr-vms",
1146
- "sourceId": "ff-ephemeral-ttl",
2165
+ "id": "ff-promote--implements--adr-vms",
2166
+ "sourceId": "ff-promote",
1147
2167
  "targetId": "adr-vms",
1148
2168
  "relationType": "implements"
2169
+ },
2170
+ {
2171
+ "id": "ff-promote--implements--adr-cdn",
2172
+ "sourceId": "ff-promote",
2173
+ "targetId": "adr-cdn",
2174
+ "relationType": "implements"
2175
+ },
2176
+ {
2177
+ "id": "ff-promote--implements--adr-onprem-platform",
2178
+ "sourceId": "ff-promote",
2179
+ "targetId": "adr-onprem-platform",
2180
+ "relationType": "implements"
1149
2181
  }
1150
2182
  ]
1151
2183
  }