@friggframework/devtools 2.0.0-next.61 → 2.0.0-next.62

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 (305) hide show
  1. package/package.json +14 -7
  2. package/.eslintrc.json +0 -3
  3. package/CHANGELOG.md +0 -132
  4. package/infrastructure/ARCHITECTURE.md +0 -487
  5. package/infrastructure/CLAUDE.md +0 -481
  6. package/infrastructure/HEALTH.md +0 -468
  7. package/infrastructure/README.md +0 -522
  8. package/infrastructure/__tests__/fixtures/mock-aws-resources.js +0 -391
  9. package/infrastructure/__tests__/helpers/test-utils.js +0 -277
  10. package/infrastructure/__tests__/postgres-config.test.js +0 -914
  11. package/infrastructure/__tests__/template-generation.test.js +0 -687
  12. package/infrastructure/create-frigg-infrastructure.js +0 -147
  13. package/infrastructure/docs/POSTGRES-CONFIGURATION.md +0 -630
  14. package/infrastructure/docs/PRE-DEPLOYMENT-HEALTH-CHECK-SPEC.md +0 -1317
  15. package/infrastructure/docs/WEBSOCKET-CONFIGURATION.md +0 -105
  16. package/infrastructure/docs/deployment-instructions.md +0 -268
  17. package/infrastructure/docs/generate-iam-command.md +0 -278
  18. package/infrastructure/docs/iam-policy-templates.md +0 -193
  19. package/infrastructure/domains/database/aurora-builder.js +0 -809
  20. package/infrastructure/domains/database/aurora-builder.test.js +0 -950
  21. package/infrastructure/domains/database/aurora-discovery.js +0 -87
  22. package/infrastructure/domains/database/aurora-discovery.test.js +0 -188
  23. package/infrastructure/domains/database/aurora-resolver.js +0 -210
  24. package/infrastructure/domains/database/aurora-resolver.test.js +0 -347
  25. package/infrastructure/domains/database/migration-builder.js +0 -701
  26. package/infrastructure/domains/database/migration-builder.test.js +0 -321
  27. package/infrastructure/domains/database/migration-resolver.js +0 -163
  28. package/infrastructure/domains/database/migration-resolver.test.js +0 -337
  29. package/infrastructure/domains/health/application/ports/IPropertyReconciler.js +0 -164
  30. package/infrastructure/domains/health/application/ports/IResourceDetector.js +0 -129
  31. package/infrastructure/domains/health/application/ports/IResourceImporter.js +0 -142
  32. package/infrastructure/domains/health/application/ports/IStackRepository.js +0 -131
  33. package/infrastructure/domains/health/application/ports/index.js +0 -26
  34. package/infrastructure/domains/health/application/use-cases/__tests__/execute-resource-import-use-case.test.js +0 -679
  35. package/infrastructure/domains/health/application/use-cases/__tests__/mismatch-analyzer-method-name.test.js +0 -167
  36. package/infrastructure/domains/health/application/use-cases/__tests__/repair-via-import-use-case.test.js +0 -1130
  37. package/infrastructure/domains/health/application/use-cases/execute-resource-import-use-case.js +0 -221
  38. package/infrastructure/domains/health/application/use-cases/reconcile-properties-use-case.js +0 -152
  39. package/infrastructure/domains/health/application/use-cases/reconcile-properties-use-case.test.js +0 -343
  40. package/infrastructure/domains/health/application/use-cases/repair-via-import-use-case.js +0 -535
  41. package/infrastructure/domains/health/application/use-cases/repair-via-import-use-case.test.js +0 -376
  42. package/infrastructure/domains/health/application/use-cases/run-health-check-use-case.js +0 -213
  43. package/infrastructure/domains/health/application/use-cases/run-health-check-use-case.test.js +0 -441
  44. package/infrastructure/domains/health/docs/ACME-DEV-DRIFT-ANALYSIS.md +0 -267
  45. package/infrastructure/domains/health/docs/BUILD-VS-DEPLOYED-TEMPLATE-ANALYSIS.md +0 -324
  46. package/infrastructure/domains/health/docs/ORPHAN-DETECTION-ANALYSIS.md +0 -386
  47. package/infrastructure/domains/health/docs/SPEC-CLEANUP-COMMAND.md +0 -1419
  48. package/infrastructure/domains/health/docs/TDD-IMPLEMENTATION-SUMMARY.md +0 -391
  49. package/infrastructure/domains/health/docs/TEMPLATE-COMPARISON-IMPLEMENTATION.md +0 -551
  50. package/infrastructure/domains/health/domain/entities/issue.js +0 -299
  51. package/infrastructure/domains/health/domain/entities/issue.test.js +0 -528
  52. package/infrastructure/domains/health/domain/entities/property-mismatch.js +0 -108
  53. package/infrastructure/domains/health/domain/entities/property-mismatch.test.js +0 -275
  54. package/infrastructure/domains/health/domain/entities/resource.js +0 -159
  55. package/infrastructure/domains/health/domain/entities/resource.test.js +0 -432
  56. package/infrastructure/domains/health/domain/entities/stack-health-report.js +0 -306
  57. package/infrastructure/domains/health/domain/entities/stack-health-report.test.js +0 -601
  58. package/infrastructure/domains/health/domain/services/__tests__/health-score-percentage-based.test.js +0 -380
  59. package/infrastructure/domains/health/domain/services/__tests__/import-progress-monitor.test.js +0 -971
  60. package/infrastructure/domains/health/domain/services/__tests__/import-template-generator.test.js +0 -1150
  61. package/infrastructure/domains/health/domain/services/__tests__/logical-id-mapper.test.js +0 -672
  62. package/infrastructure/domains/health/domain/services/__tests__/template-parser.test.js +0 -496
  63. package/infrastructure/domains/health/domain/services/__tests__/update-progress-monitor.test.js +0 -419
  64. package/infrastructure/domains/health/domain/services/health-score-calculator.js +0 -248
  65. package/infrastructure/domains/health/domain/services/health-score-calculator.test.js +0 -504
  66. package/infrastructure/domains/health/domain/services/import-progress-monitor.js +0 -195
  67. package/infrastructure/domains/health/domain/services/import-template-generator.js +0 -435
  68. package/infrastructure/domains/health/domain/services/logical-id-mapper.js +0 -345
  69. package/infrastructure/domains/health/domain/services/mismatch-analyzer.js +0 -234
  70. package/infrastructure/domains/health/domain/services/mismatch-analyzer.test.js +0 -431
  71. package/infrastructure/domains/health/domain/services/property-mutability-config.js +0 -382
  72. package/infrastructure/domains/health/domain/services/template-parser.js +0 -245
  73. package/infrastructure/domains/health/domain/services/update-progress-monitor.js +0 -192
  74. package/infrastructure/domains/health/domain/value-objects/health-score.js +0 -138
  75. package/infrastructure/domains/health/domain/value-objects/health-score.test.js +0 -267
  76. package/infrastructure/domains/health/domain/value-objects/property-mutability.js +0 -161
  77. package/infrastructure/domains/health/domain/value-objects/property-mutability.test.js +0 -198
  78. package/infrastructure/domains/health/domain/value-objects/resource-state.js +0 -167
  79. package/infrastructure/domains/health/domain/value-objects/resource-state.test.js +0 -196
  80. package/infrastructure/domains/health/domain/value-objects/stack-identifier.js +0 -192
  81. package/infrastructure/domains/health/domain/value-objects/stack-identifier.test.js +0 -262
  82. package/infrastructure/domains/health/infrastructure/adapters/__tests__/orphan-detection-cfn-tagged.test.js +0 -312
  83. package/infrastructure/domains/health/infrastructure/adapters/__tests__/orphan-detection-multi-stack.test.js +0 -367
  84. package/infrastructure/domains/health/infrastructure/adapters/__tests__/orphan-detection-relationship-analysis.test.js +0 -432
  85. package/infrastructure/domains/health/infrastructure/adapters/aws-property-reconciler.js +0 -784
  86. package/infrastructure/domains/health/infrastructure/adapters/aws-property-reconciler.test.js +0 -1133
  87. package/infrastructure/domains/health/infrastructure/adapters/aws-resource-detector.js +0 -565
  88. package/infrastructure/domains/health/infrastructure/adapters/aws-resource-detector.test.js +0 -554
  89. package/infrastructure/domains/health/infrastructure/adapters/aws-resource-importer.js +0 -318
  90. package/infrastructure/domains/health/infrastructure/adapters/aws-resource-importer.test.js +0 -398
  91. package/infrastructure/domains/health/infrastructure/adapters/aws-stack-repository.js +0 -777
  92. package/infrastructure/domains/health/infrastructure/adapters/aws-stack-repository.test.js +0 -580
  93. package/infrastructure/domains/integration/integration-builder.js +0 -404
  94. package/infrastructure/domains/integration/integration-builder.test.js +0 -690
  95. package/infrastructure/domains/integration/integration-resolver.js +0 -170
  96. package/infrastructure/domains/integration/integration-resolver.test.js +0 -369
  97. package/infrastructure/domains/integration/websocket-builder.js +0 -69
  98. package/infrastructure/domains/integration/websocket-builder.test.js +0 -195
  99. package/infrastructure/domains/networking/vpc-builder.js +0 -2051
  100. package/infrastructure/domains/networking/vpc-builder.test.js +0 -1960
  101. package/infrastructure/domains/networking/vpc-discovery.js +0 -177
  102. package/infrastructure/domains/networking/vpc-discovery.test.js +0 -350
  103. package/infrastructure/domains/networking/vpc-resolver.js +0 -505
  104. package/infrastructure/domains/networking/vpc-resolver.test.js +0 -801
  105. package/infrastructure/domains/parameters/ssm-builder.js +0 -79
  106. package/infrastructure/domains/parameters/ssm-builder.test.js +0 -189
  107. package/infrastructure/domains/parameters/ssm-discovery.js +0 -84
  108. package/infrastructure/domains/parameters/ssm-discovery.test.js +0 -210
  109. package/infrastructure/domains/security/iam-generator.js +0 -816
  110. package/infrastructure/domains/security/iam-generator.test.js +0 -204
  111. package/infrastructure/domains/security/kms-builder.js +0 -415
  112. package/infrastructure/domains/security/kms-builder.test.js +0 -392
  113. package/infrastructure/domains/security/kms-discovery.js +0 -80
  114. package/infrastructure/domains/security/kms-discovery.test.js +0 -177
  115. package/infrastructure/domains/security/kms-resolver.js +0 -96
  116. package/infrastructure/domains/security/kms-resolver.test.js +0 -216
  117. package/infrastructure/domains/security/templates/frigg-deployment-iam-stack.yaml +0 -401
  118. package/infrastructure/domains/security/templates/iam-policy-basic.json +0 -218
  119. package/infrastructure/domains/security/templates/iam-policy-full.json +0 -288
  120. package/infrastructure/domains/shared/base-builder.js +0 -112
  121. package/infrastructure/domains/shared/base-resolver.js +0 -186
  122. package/infrastructure/domains/shared/base-resolver.test.js +0 -305
  123. package/infrastructure/domains/shared/builder-orchestrator.js +0 -212
  124. package/infrastructure/domains/shared/builder-orchestrator.test.js +0 -213
  125. package/infrastructure/domains/shared/cloudformation-discovery-v2.js +0 -334
  126. package/infrastructure/domains/shared/cloudformation-discovery.js +0 -672
  127. package/infrastructure/domains/shared/cloudformation-discovery.test.js +0 -985
  128. package/infrastructure/domains/shared/environment-builder.js +0 -119
  129. package/infrastructure/domains/shared/environment-builder.test.js +0 -247
  130. package/infrastructure/domains/shared/providers/aws-provider-adapter.js +0 -579
  131. package/infrastructure/domains/shared/providers/aws-provider-adapter.test.js +0 -416
  132. package/infrastructure/domains/shared/providers/azure-provider-adapter.stub.js +0 -93
  133. package/infrastructure/domains/shared/providers/cloud-provider-adapter.js +0 -136
  134. package/infrastructure/domains/shared/providers/gcp-provider-adapter.stub.js +0 -82
  135. package/infrastructure/domains/shared/providers/provider-factory.js +0 -108
  136. package/infrastructure/domains/shared/providers/provider-factory.test.js +0 -170
  137. package/infrastructure/domains/shared/resource-discovery.enhanced.test.js +0 -306
  138. package/infrastructure/domains/shared/resource-discovery.js +0 -233
  139. package/infrastructure/domains/shared/resource-discovery.test.js +0 -588
  140. package/infrastructure/domains/shared/types/app-definition.js +0 -205
  141. package/infrastructure/domains/shared/types/discovery-result.js +0 -106
  142. package/infrastructure/domains/shared/types/discovery-result.test.js +0 -258
  143. package/infrastructure/domains/shared/types/index.js +0 -46
  144. package/infrastructure/domains/shared/types/resource-ownership.js +0 -108
  145. package/infrastructure/domains/shared/types/resource-ownership.test.js +0 -101
  146. package/infrastructure/domains/shared/utilities/base-definition-factory.js +0 -394
  147. package/infrastructure/domains/shared/utilities/base-definition-factory.js.bak +0 -338
  148. package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +0 -291
  149. package/infrastructure/domains/shared/utilities/handler-path-resolver.js +0 -134
  150. package/infrastructure/domains/shared/utilities/handler-path-resolver.test.js +0 -268
  151. package/infrastructure/domains/shared/utilities/prisma-layer-manager.js +0 -159
  152. package/infrastructure/domains/shared/utilities/prisma-layer-manager.test.js +0 -444
  153. package/infrastructure/domains/shared/validation/env-validator.js +0 -78
  154. package/infrastructure/domains/shared/validation/env-validator.test.js +0 -173
  155. package/infrastructure/domains/shared/validation/plugin-validator.js +0 -187
  156. package/infrastructure/domains/shared/validation/plugin-validator.test.js +0 -323
  157. package/infrastructure/esbuild.config.js +0 -53
  158. package/infrastructure/index.js +0 -4
  159. package/infrastructure/infrastructure-composer.js +0 -117
  160. package/infrastructure/infrastructure-composer.test.js +0 -1895
  161. package/infrastructure/integration.test.js +0 -383
  162. package/infrastructure/scripts/build-prisma-layer.js +0 -701
  163. package/infrastructure/scripts/build-prisma-layer.test.js +0 -170
  164. package/infrastructure/scripts/build-time-discovery.js +0 -238
  165. package/infrastructure/scripts/build-time-discovery.test.js +0 -379
  166. package/infrastructure/scripts/run-discovery.js +0 -110
  167. package/infrastructure/scripts/verify-prisma-layer.js +0 -72
  168. package/layers/prisma/.build-complete +0 -3
  169. package/layers/prisma/nodejs/package.json +0 -8
  170. package/management-ui/.eslintrc.js +0 -22
  171. package/management-ui/components.json +0 -21
  172. package/management-ui/docs/phase2-integration-guide.md +0 -320
  173. package/management-ui/index.html +0 -13
  174. package/management-ui/package.json +0 -76
  175. package/management-ui/packages/devtools/frigg-cli/ui-command/index.js +0 -302
  176. package/management-ui/postcss.config.js +0 -6
  177. package/management-ui/server/api/backend.js +0 -256
  178. package/management-ui/server/api/cli.js +0 -315
  179. package/management-ui/server/api/codegen.js +0 -663
  180. package/management-ui/server/api/connections.js +0 -857
  181. package/management-ui/server/api/discovery.js +0 -185
  182. package/management-ui/server/api/environment/index.js +0 -1
  183. package/management-ui/server/api/environment/router.js +0 -378
  184. package/management-ui/server/api/environment.js +0 -328
  185. package/management-ui/server/api/integrations.js +0 -876
  186. package/management-ui/server/api/logs.js +0 -248
  187. package/management-ui/server/api/monitoring.js +0 -282
  188. package/management-ui/server/api/open-ide.js +0 -31
  189. package/management-ui/server/api/project.js +0 -1029
  190. package/management-ui/server/api/users/sessions.js +0 -371
  191. package/management-ui/server/api/users/simulation.js +0 -254
  192. package/management-ui/server/api/users.js +0 -362
  193. package/management-ui/server/api-contract.md +0 -275
  194. package/management-ui/server/index.js +0 -873
  195. package/management-ui/server/middleware/errorHandler.js +0 -93
  196. package/management-ui/server/middleware/security.js +0 -32
  197. package/management-ui/server/processManager.js +0 -296
  198. package/management-ui/server/server.js +0 -346
  199. package/management-ui/server/services/aws-monitor.js +0 -413
  200. package/management-ui/server/services/npm-registry.js +0 -347
  201. package/management-ui/server/services/template-engine.js +0 -538
  202. package/management-ui/server/utils/cliIntegration.js +0 -220
  203. package/management-ui/server/utils/environment/auditLogger.js +0 -471
  204. package/management-ui/server/utils/environment/awsParameterStore.js +0 -275
  205. package/management-ui/server/utils/environment/encryption.js +0 -278
  206. package/management-ui/server/utils/environment/envFileManager.js +0 -286
  207. package/management-ui/server/utils/import-commonjs.js +0 -28
  208. package/management-ui/server/utils/response.js +0 -83
  209. package/management-ui/server/websocket/handler.js +0 -325
  210. package/management-ui/src/App.jsx +0 -25
  211. package/management-ui/src/assets/FriggLogo.svg +0 -1
  212. package/management-ui/src/components/AppRouter.jsx +0 -65
  213. package/management-ui/src/components/Button.jsx +0 -70
  214. package/management-ui/src/components/Card.jsx +0 -97
  215. package/management-ui/src/components/EnvironmentCompare.jsx +0 -400
  216. package/management-ui/src/components/EnvironmentEditor.jsx +0 -372
  217. package/management-ui/src/components/EnvironmentImportExport.jsx +0 -469
  218. package/management-ui/src/components/EnvironmentSchema.jsx +0 -491
  219. package/management-ui/src/components/EnvironmentSecurity.jsx +0 -463
  220. package/management-ui/src/components/ErrorBoundary.jsx +0 -73
  221. package/management-ui/src/components/IntegrationCard.jsx +0 -481
  222. package/management-ui/src/components/IntegrationCardEnhanced.jsx +0 -770
  223. package/management-ui/src/components/IntegrationExplorer.jsx +0 -379
  224. package/management-ui/src/components/IntegrationStatus.jsx +0 -336
  225. package/management-ui/src/components/Layout.jsx +0 -716
  226. package/management-ui/src/components/LoadingSpinner.jsx +0 -113
  227. package/management-ui/src/components/RepositoryPicker.jsx +0 -248
  228. package/management-ui/src/components/SessionMonitor.jsx +0 -350
  229. package/management-ui/src/components/StatusBadge.jsx +0 -208
  230. package/management-ui/src/components/UserContextSwitcher.jsx +0 -212
  231. package/management-ui/src/components/UserSimulation.jsx +0 -327
  232. package/management-ui/src/components/Welcome.jsx +0 -434
  233. package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +0 -637
  234. package/management-ui/src/components/codegen/APIModuleSelector.jsx +0 -227
  235. package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +0 -247
  236. package/management-ui/src/components/codegen/CodePreviewEditor.jsx +0 -316
  237. package/management-ui/src/components/codegen/DynamicModuleForm.jsx +0 -271
  238. package/management-ui/src/components/codegen/FormBuilder.jsx +0 -737
  239. package/management-ui/src/components/codegen/IntegrationGenerator.jsx +0 -855
  240. package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +0 -797
  241. package/management-ui/src/components/codegen/SchemaBuilder.jsx +0 -303
  242. package/management-ui/src/components/codegen/TemplateSelector.jsx +0 -586
  243. package/management-ui/src/components/codegen/index.js +0 -10
  244. package/management-ui/src/components/connections/ConnectionConfigForm.jsx +0 -362
  245. package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +0 -182
  246. package/management-ui/src/components/connections/ConnectionTester.jsx +0 -200
  247. package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +0 -292
  248. package/management-ui/src/components/connections/OAuthFlow.jsx +0 -204
  249. package/management-ui/src/components/connections/index.js +0 -5
  250. package/management-ui/src/components/index.js +0 -21
  251. package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +0 -222
  252. package/management-ui/src/components/monitoring/LambdaMetrics.jsx +0 -169
  253. package/management-ui/src/components/monitoring/MetricsChart.jsx +0 -197
  254. package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +0 -393
  255. package/management-ui/src/components/monitoring/SQSMetrics.jsx +0 -246
  256. package/management-ui/src/components/monitoring/index.js +0 -6
  257. package/management-ui/src/components/monitoring/monitoring.css +0 -218
  258. package/management-ui/src/components/theme-provider.jsx +0 -52
  259. package/management-ui/src/components/theme-toggle.jsx +0 -39
  260. package/management-ui/src/components/ui/badge.tsx +0 -36
  261. package/management-ui/src/components/ui/button.test.jsx +0 -56
  262. package/management-ui/src/components/ui/button.tsx +0 -57
  263. package/management-ui/src/components/ui/card.tsx +0 -76
  264. package/management-ui/src/components/ui/dropdown-menu.tsx +0 -199
  265. package/management-ui/src/components/ui/select.tsx +0 -157
  266. package/management-ui/src/components/ui/skeleton.jsx +0 -15
  267. package/management-ui/src/hooks/useFrigg.jsx +0 -387
  268. package/management-ui/src/hooks/useSocket.jsx +0 -58
  269. package/management-ui/src/index.css +0 -193
  270. package/management-ui/src/lib/utils.ts +0 -6
  271. package/management-ui/src/main.jsx +0 -10
  272. package/management-ui/src/pages/CodeGeneration.jsx +0 -14
  273. package/management-ui/src/pages/Connections.jsx +0 -252
  274. package/management-ui/src/pages/ConnectionsEnhanced.jsx +0 -633
  275. package/management-ui/src/pages/Dashboard.jsx +0 -311
  276. package/management-ui/src/pages/Environment.jsx +0 -314
  277. package/management-ui/src/pages/IntegrationConfigure.jsx +0 -669
  278. package/management-ui/src/pages/IntegrationDiscovery.jsx +0 -567
  279. package/management-ui/src/pages/IntegrationTest.jsx +0 -742
  280. package/management-ui/src/pages/Integrations.jsx +0 -253
  281. package/management-ui/src/pages/Monitoring.jsx +0 -17
  282. package/management-ui/src/pages/Simulation.jsx +0 -155
  283. package/management-ui/src/pages/Users.jsx +0 -492
  284. package/management-ui/src/services/api.js +0 -41
  285. package/management-ui/src/services/apiModuleService.js +0 -193
  286. package/management-ui/src/services/websocket-handlers.js +0 -120
  287. package/management-ui/src/test/api/project.test.js +0 -273
  288. package/management-ui/src/test/components/Welcome.test.jsx +0 -378
  289. package/management-ui/src/test/mocks/server.js +0 -178
  290. package/management-ui/src/test/setup.js +0 -61
  291. package/management-ui/src/test/utils/test-utils.jsx +0 -134
  292. package/management-ui/src/utils/repository.js +0 -98
  293. package/management-ui/src/utils/repository.test.js +0 -118
  294. package/management-ui/src/workflows/phase2-integration-workflows.js +0 -884
  295. package/management-ui/tailwind.config.js +0 -63
  296. package/management-ui/tsconfig.json +0 -37
  297. package/management-ui/tsconfig.node.json +0 -10
  298. package/management-ui/vite.config.js +0 -26
  299. package/management-ui/vitest.config.js +0 -38
  300. package/test/auther-definition-method-tester.js +0 -45
  301. package/test/index.js +0 -9
  302. package/test/integration-validator.js +0 -2
  303. package/test/mock-api-readme.md +0 -102
  304. package/test/mock-api.js +0 -284
  305. package/test/mock-integration.js +0 -78
@@ -1,630 +0,0 @@
1
- # PostgreSQL (Aurora) Configuration Guide
2
-
3
- This guide covers Aurora PostgreSQL provisioning and configuration in Frigg Framework applications.
4
-
5
- ## Overview
6
-
7
- Frigg Framework supports automatic provisioning of Amazon Aurora Serverless v2 PostgreSQL databases for your integrations. Aurora databases are deployed in the same VPC as your Lambda functions with secure access via AWS Secrets Manager.
8
-
9
- ### Key Features
10
-
11
- - **Aurora Serverless v2**: Cost-efficient auto-scaling database (0.5-1.0 ACU default)
12
- - **VPC Integration**: Deployed in same private subnets as Lambda functions
13
- - **Secrets Manager**: Automatic credential management and rotation
14
- - **Three Management Modes**: discover, create-new, use-existing
15
- - **Security**: Private subnet deployment with security group isolation
16
- - **High Availability**: Multi-AZ deployment with automatic failover
17
-
18
- ---
19
-
20
- ## Configuration Schema
21
-
22
- ### App Definition Structure
23
-
24
- ```javascript
25
- // backend/index.js
26
- const appDefinition = {
27
- name: 'my-frigg-app',
28
-
29
- // Enable VPC deployment (required for Aurora)
30
- vpc: {
31
- enable: true,
32
- },
33
-
34
- // Aurora PostgreSQL Configuration
35
- database: {
36
- postgres: {
37
- enable: true,
38
-
39
- // Management mode: 'discover' | 'create-new' | 'use-existing'
40
- management: 'discover',
41
-
42
- // Basic Configuration
43
- databaseName: 'frigg_db',
44
- masterUsername: 'frigg_admin',
45
-
46
- // Engine Configuration
47
- engine: 'aurora-postgresql',
48
- engineVersion: '15.3',
49
-
50
- // Scaling Configuration (Aurora Serverless v2)
51
- scaling: {
52
- minCapacity: 0.5, // ACUs (0.5 = ~1GB RAM, ~$43/month)
53
- maxCapacity: 1.0, // ACUs (1.0 = ~2GB RAM, ~$87/month)
54
- },
55
-
56
- // Backup Configuration
57
- backupRetentionDays: 7,
58
- preferredBackupWindow: '03:00-04:00',
59
-
60
- // Security & Advanced
61
- deletionProtection: true,
62
- enablePerformanceInsights: false,
63
-
64
- // For use-existing mode
65
- clusterIdentifier: 'my-existing-cluster',
66
- secretArn: 'arn:aws:secretsmanager:...',
67
- }
68
- }
69
- };
70
-
71
- module.exports = {
72
- Definition: appDefinition,
73
- };
74
- ```
75
-
76
- ---
77
-
78
- ## Management Modes
79
-
80
- ### 1. Discover Mode (Default)
81
-
82
- Automatically discovers existing Aurora clusters or creates new one if none found.
83
-
84
- ```javascript
85
- database: {
86
- postgres: {
87
- enable: true,
88
- management: 'discover', // Default
89
- }
90
- }
91
- ```
92
-
93
- **Discovery Priority**:
94
- 1. Frigg-managed cluster with matching service + stage tags
95
- 2. Any Frigg-managed cluster
96
- 3. First available Aurora PostgreSQL cluster
97
- 4. Creates new cluster if none found
98
-
99
- **Best For**: Development and staging environments where you want automatic setup.
100
-
101
- ---
102
-
103
- ### 2. Create-New Mode
104
-
105
- Always creates a new Aurora cluster, even if existing clusters are found.
106
-
107
- ```javascript
108
- database: {
109
- postgres: {
110
- enable: true,
111
- management: 'create-new',
112
-
113
- // Customization options
114
- databaseName: 'my_app_db',
115
- masterUsername: 'admin',
116
- engineVersion: '15.3',
117
- scaling: {
118
- minCapacity: 1.0,
119
- maxCapacity: 2.0,
120
- },
121
- backupRetentionDays: 14,
122
- deletionProtection: true,
123
- }
124
- }
125
- ```
126
-
127
- **Best For**: Production environments where you want dedicated database resources.
128
-
129
- ---
130
-
131
- ### 3. Use-Existing Mode
132
-
133
- Uses a specific existing Aurora cluster by identifier.
134
-
135
- ```javascript
136
- database: {
137
- postgres: {
138
- enable: true,
139
- management: 'use-existing',
140
-
141
- // Required: existing cluster identifier
142
- clusterIdentifier: 'my-existing-aurora-cluster',
143
-
144
- // Optional: secret ARN (discovered if not provided)
145
- secretArn: 'arn:aws:secretsmanager:us-east-1:123456789012:secret:my-db-secret',
146
-
147
- // Database name to connect to
148
- databaseName: 'frigg_db',
149
- }
150
- }
151
- ```
152
-
153
- **Best For**: Shared database scenarios or when you manage Aurora outside of Frigg.
154
-
155
- ---
156
-
157
- ## Created AWS Resources
158
-
159
- When provisioning Aurora (`create-new` or `discover` mode without existing cluster), Frigg creates:
160
-
161
- ### 1. RDS DB Subnet Group
162
- - **Name**: `{service}-{stage}-db-subnet-group`
163
- - **Subnets**: Uses same private subnets as Lambda functions
164
- - **Purpose**: Defines which subnets Aurora can use
165
-
166
- ### 2. Security Group
167
- - **Name**: `{service}-{stage}-aurora-sg`
168
- - **Ingress**: Port 5432 from Lambda security group
169
- - **Purpose**: Allows Lambda → Aurora communication
170
-
171
- ### 3. Secrets Manager Secret
172
- - **Name**: `{service}-{stage}-aurora-credentials`
173
- - **Contents**: `{ username, password }`
174
- - **Purpose**: Stores database credentials securely
175
- - **Rotation**: Automatic (optional, can be configured)
176
-
177
- ### 4. Aurora Cluster
178
- - **Engine**: aurora-postgresql (version 15.3 default)
179
- - **Mode**: Provisioned (Serverless v2)
180
- - **Scaling**: 0.5-1.0 ACU (configurable)
181
- - **Backup**: 7-day retention (configurable)
182
- - **Multi-AZ**: Yes (high availability)
183
-
184
- ### 5. Aurora Instance
185
- - **Class**: db.serverless
186
- - **Cluster**: Attached to cluster above
187
- - **Public Access**: No (private subnet only)
188
-
189
- ### 6. IAM Permissions
190
- - **Secrets Manager**: GetSecretValue, DescribeSecret
191
- - **Purpose**: Lambda functions can retrieve credentials
192
-
193
- ---
194
-
195
- ## Cost Optimization
196
-
197
- ### Default Configuration (Most Cost-Efficient)
198
-
199
- ```javascript
200
- database: {
201
- postgres: {
202
- enable: true,
203
- // Uses defaults:
204
- // - 0.5 ACU minimum (scales to near-zero during idle)
205
- // - 1.0 ACU maximum
206
- // - No Performance Insights
207
- // - 7-day backup retention
208
- }
209
- }
210
- ```
211
-
212
- **Estimated Monthly Costs**:
213
- - **Idle/Low Traffic**: $15-30/month (0.5 ACU minimum)
214
- - **Moderate Traffic**: $30-60/month (0.5-1.0 ACU average)
215
- - **Storage**: $0.10/GB-month
216
- - **Backup Storage**: Free (within retention period)
217
-
218
- ### Production Configuration
219
-
220
- ```javascript
221
- database: {
222
- postgres: {
223
- enable: true,
224
- scaling: {
225
- minCapacity: 1.0, // Higher baseline for production
226
- maxCapacity: 4.0, // Handle traffic spikes
227
- },
228
- backupRetentionDays: 30, // Longer retention
229
- enablePerformanceInsights: true, // Monitoring
230
- deletionProtection: true, // Prevent accidental deletion
231
- }
232
- }
233
- ```
234
-
235
- **Estimated Monthly Costs**:
236
- - **Baseline**: $87/month (1.0 ACU minimum)
237
- - **Peak Traffic**: $348/month (4.0 ACU maximum)
238
- - **Performance Insights**: $7/month
239
-
240
- ### Cost-Saving Tips
241
-
242
- 1. **Use Aurora Serverless v2**: Scales to near-zero during idle periods
243
- 2. **Right-size ACU limits**: Start with defaults, increase only if needed
244
- 3. **Disable Performance Insights** in dev/staging
245
- 4. **Shorter backup retention** for non-production (7 days)
246
- 5. **Monitor CloudWatch metrics** to optimize scaling configuration
247
-
248
- ---
249
-
250
- ## Security Best Practices
251
-
252
- ### 1. Network Isolation
253
-
254
- - ✅ **Private Subnets Only**: Aurora deployed in private subnets (no internet access)
255
- - ✅ **Security Groups**: Restricts access to Lambda security group only
256
- - ✅ **VPC Endpoints**: Use VPC endpoints for AWS services (no NAT Gateway costs)
257
-
258
- ### 2. Credential Management
259
-
260
- - ✅ **Secrets Manager**: Never hardcode database passwords
261
- - ✅ **Auto-Rotation**: Enable automatic secret rotation (recommended)
262
- - ✅ **IAM Integration**: Lambda uses IAM role to access secrets
263
- - ❌ **Never commit** `DATABASE_URL` to source control
264
-
265
- ### 3. Access Control
266
-
267
- ```javascript
268
- // Lambda functions automatically get DATABASE_URL from Secrets Manager
269
- // No manual credential management required
270
-
271
- // Example: Prisma client automatically uses DATABASE_URL
272
- import { prismaClient } from '@friggframework/core/database/prisma';
273
-
274
- const users = await prismaClient.user.findMany();
275
- ```
276
-
277
- ### 4. Deletion Protection
278
-
279
- ```javascript
280
- database: {
281
- postgres: {
282
- deletionProtection: true, // Prevents accidental deletion
283
- }
284
- }
285
- ```
286
-
287
- **Important**: When enabled, you must manually disable deletion protection in AWS console before stack deletion.
288
-
289
- ---
290
-
291
- ## Environment Variables
292
-
293
- ### Automatically Set
294
-
295
- Frigg automatically sets these environment variables for Lambda functions:
296
-
297
- ```bash
298
- # Database connection (from Secrets Manager)
299
- DATABASE_URL=postgresql://user:pass@endpoint:5432/dbname
300
-
301
- # Database type (for Prisma client selection)
302
- DB_TYPE=postgresql
303
-
304
- # Discovery metadata (for debugging)
305
- AWS_DISCOVERY_AURORA_CLUSTER_ID=my-cluster
306
- AWS_DISCOVERY_AURORA_ENDPOINT=my-cluster.cluster-abc.us-east-1.rds.amazonaws.com
307
- AWS_DISCOVERY_AURORA_PORT=5432
308
- AWS_DISCOVERY_AURORA_SECRET_ARN=arn:aws:secretsmanager:...
309
- ```
310
-
311
- ### Usage in Lambda Functions
312
-
313
- ```javascript
314
- // No manual configuration needed!
315
- // DATABASE_URL is automatically available
316
-
317
- import { prismaClient } from '@friggframework/core/database/prisma';
318
-
319
- export async function handler(event, context) {
320
- // Prisma client uses DATABASE_URL automatically
321
- const result = await prismaClient.user.create({
322
- data: { email: 'user@example.com' }
323
- });
324
-
325
- return { statusCode: 200, body: JSON.stringify(result) };
326
- }
327
- ```
328
-
329
- ---
330
-
331
- ## Local Development
332
-
333
- ### Option 1: Docker Compose PostgreSQL
334
-
335
- ```yaml
336
- # docker-compose.yml
337
- version: '3.8'
338
- services:
339
- postgres:
340
- image: postgres:15
341
- environment:
342
- POSTGRES_USER: frigg_admin
343
- POSTGRES_PASSWORD: local_password
344
- POSTGRES_DB: frigg_db
345
- ports:
346
- - "5432:5432"
347
- volumes:
348
- - postgres_data:/var/lib/postgresql/data
349
-
350
- volumes:
351
- postgres_data:
352
- ```
353
-
354
- ```bash
355
- # .env (local development)
356
- DATABASE_URL=postgresql://frigg_admin:local_password@localhost:5432/frigg_db
357
- DB_TYPE=postgresql
358
- ```
359
-
360
- ### Option 2: Connect to AWS Aurora (Not Recommended)
361
-
362
- ```bash
363
- # .env (staging Aurora - for testing only)
364
- DATABASE_URL=postgresql://user:pass@staging-cluster.abc.us-east-1.rds.amazonaws.com:5432/frigg_db
365
- DB_TYPE=postgresql
366
- ```
367
-
368
- **Security Note**: Never commit Aurora credentials to source control. Use AWS SSO or parameter store for team access.
369
-
370
- ---
371
-
372
- ## Migration Guide
373
-
374
- ### From External PostgreSQL to Aurora
375
-
376
- 1. **Backup Existing Database**
377
- ```bash
378
- pg_dump -h old-host -U user -d dbname > backup.sql
379
- ```
380
-
381
- 2. **Deploy Aurora Cluster**
382
- ```javascript
383
- // backend/index.js
384
- database: {
385
- postgres: {
386
- enable: true,
387
- management: 'create-new',
388
- }
389
- }
390
- ```
391
-
392
- ```bash
393
- npm run frigg:deploy
394
- ```
395
-
396
- 3. **Restore to Aurora**
397
- ```bash
398
- # Get Aurora endpoint from AWS console or deployment output
399
- psql -h aurora-endpoint.us-east-1.rds.amazonaws.com -U frigg_admin -d frigg_db < backup.sql
400
- ```
401
-
402
- 4. **Run Migrations**
403
- ```bash
404
- npm run frigg:db:setup
405
- ```
406
-
407
- ### From MongoDB to PostgreSQL
408
-
409
- 1. **Add PostgreSQL Configuration**
410
- ```javascript
411
- database: {
412
- postgres: {
413
- enable: true,
414
- management: 'create-new',
415
- }
416
- }
417
- ```
418
-
419
- 2. **Run Prisma Migrations**
420
- ```bash
421
- # Generate Prisma PostgreSQL client
422
- npm run frigg:db:setup
423
- ```
424
-
425
- 3. **Data Migration Script** (custom per application)
426
- ```javascript
427
- // migrate-data.js
428
- const { MongoClient } = require('mongodb');
429
- const { prismaClient } = require('@friggframework/core/database/prisma');
430
-
431
- async function migrate() {
432
- const mongo = await MongoClient.connect(process.env.MONGO_URI);
433
- const users = await mongo.db().collection('users').find().toArray();
434
-
435
- for (const user of users) {
436
- await prismaClient.user.create({
437
- data: {
438
- id: user._id.toString(),
439
- email: user.email,
440
- // ... map fields
441
- }
442
- });
443
- }
444
-
445
- await mongo.close();
446
- }
447
-
448
- migrate().catch(console.error);
449
- ```
450
-
451
- ---
452
-
453
- ## Troubleshooting
454
-
455
- ### Issue: "No Aurora cluster found"
456
-
457
- **Error**:
458
- ```
459
- No Aurora cluster found in discovery mode. Set management to "create-new"...
460
- ```
461
-
462
- **Solution**:
463
- 1. Check VPC is enabled: `vpc.enable: true`
464
- 2. Set management mode: `management: 'create-new'`
465
- 3. Or provide cluster identifier: `clusterIdentifier: 'my-cluster'`
466
-
467
- ---
468
-
469
- ### Issue: "Timeout connecting to database"
470
-
471
- **Symptoms**: Lambda functions timeout when connecting to Aurora
472
-
473
- **Possible Causes**:
474
- 1. **Security Group Misconfiguration**
475
- - Check Lambda SG can access Aurora SG on port 5432
476
- - Verify Aurora SG allows inbound from Lambda SG
477
-
478
- 2. **VPC/Subnet Issues**
479
- - Ensure Lambda and Aurora in same VPC
480
- - Verify Aurora in private subnets
481
- - Check route tables allow internal VPC traffic
482
-
483
- 3. **Secret Not Found**
484
- - Verify Secrets Manager secret exists
485
- - Check IAM role has secretsmanager:GetSecretValue permission
486
-
487
- **Debug Steps**:
488
- ```bash
489
- # Check Aurora cluster status
490
- aws rds describe-db-clusters --db-cluster-identifier my-cluster
491
-
492
- # Check security groups
493
- aws ec2 describe-security-groups --group-ids sg-xxx
494
-
495
- # Test Lambda → Aurora connectivity (requires VPC endpoint or NAT)
496
- aws lambda invoke --function-name test-db-connection output.json
497
- ```
498
-
499
- ---
500
-
501
- ### Issue: "Insufficient capacity"
502
-
503
- **Error**:
504
- ```
505
- Cannot create Aurora cluster: InsufficientDBInstanceCapacity
506
- ```
507
-
508
- **Solution**:
509
- 1. Try different availability zones
510
- 2. Change instance class (though Serverless v2 shouldn't have this issue)
511
- 3. Contact AWS support for capacity increase
512
-
513
- ---
514
-
515
- ### Issue: "Cost unexpectedly high"
516
-
517
- **Symptoms**: Aurora costs higher than expected
518
-
519
- **Investigation**:
520
- 1. **Check ACU Usage**:
521
- ```bash
522
- # CloudWatch metric: ServerlessDatabaseCapacity
523
- aws cloudwatch get-metric-statistics \
524
- --namespace AWS/RDS \
525
- --metric-name ServerlessDatabaseCapacity \
526
- --dimensions Name=DBClusterIdentifier,Value=my-cluster \
527
- --start-time 2024-01-01T00:00:00Z \
528
- --end-time 2024-01-02T00:00:00Z \
529
- --period 3600 \
530
- --statistics Average
531
- ```
532
-
533
- 2. **Review Scaling Configuration**:
534
- - Lower `maxCapacity` if traffic spikes are rare
535
- - Increase `minCapacity` only if cold starts are an issue
536
-
537
- 3. **Check for Long-Running Connections**:
538
- - Aurora doesn't scale down if connections are open
539
- - Review application connection pooling
540
-
541
- 4. **Disable Performance Insights** in non-production
542
-
543
- ---
544
-
545
- ## Advanced Configuration
546
-
547
- ### Custom Backup Window
548
-
549
- ```javascript
550
- database: {
551
- postgres: {
552
- enable: true,
553
- backupRetentionDays: 30,
554
- preferredBackupWindow: '02:00-03:00', // UTC
555
- }
556
- }
557
- ```
558
-
559
- ### Enhanced Monitoring
560
-
561
- ```javascript
562
- database: {
563
- postgres: {
564
- enable: true,
565
- enablePerformanceInsights: true,
566
- // Performance Insights retention: 7 days (default) or 731 days
567
- }
568
- }
569
- ```
570
-
571
- ### Custom Engine Version
572
-
573
- ```javascript
574
- database: {
575
- postgres: {
576
- enable: true,
577
- engineVersion: '14.6', // Default: 15.3
578
- }
579
- }
580
- ```
581
-
582
- ### Read Replicas (Not Supported Yet)
583
-
584
- Frigg currently provisions a single Aurora instance. For read replicas:
585
-
586
- 1. Manually add instances in AWS console
587
- 2. Or create custom CloudFormation resources in `backend/infrastructure.js`
588
-
589
- ---
590
-
591
- ## Reference
592
-
593
- ### Aurora Serverless v2 ACU Sizing
594
-
595
- | ACUs | RAM | Approx Monthly Cost | Use Case |
596
- |------|-------|---------------------|-----------------------------|
597
- | 0.5 | 1 GB | $43 | Development, low traffic |
598
- | 1.0 | 2 GB | $87 | Staging, moderate traffic |
599
- | 2.0 | 4 GB | $174 | Production, steady traffic |
600
- | 4.0 | 8 GB | $348 | Production, high traffic |
601
- | 8.0 | 16 GB | $696 | Production, very high traffic|
602
-
603
- **Note**: Costs as of 2024, us-east-1 region. Check current pricing at [AWS Pricing](https://aws.amazon.com/rds/aurora/pricing/).
604
-
605
- ### Supported PostgreSQL Versions
606
-
607
- - 15.3 (recommended, default)
608
- - 15.2
609
- - 14.6
610
- - 14.5
611
- - 13.9
612
-
613
- Check [Aurora PostgreSQL Releases](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraPostgreSQLReleaseNotes/AuroraPostgreSQL.Updates.html) for latest versions.
614
-
615
- ---
616
-
617
- ## Related Documentation
618
-
619
- - [VPC Configuration Guide](VPC-CONFIGURATION.md)
620
- - [Secrets Manager Integration](SECRETS-MANAGER.md)
621
- - [Database Migrations](../frigg-cli/DB-SETUP.md)
622
- - [AWS Discovery Troubleshooting](AWS-DISCOVERY-TROUBLESHOOTING.md)
623
-
624
- ---
625
-
626
- ## Support
627
-
628
- - **Issues**: [GitHub Issues](https://github.com/friggframework/frigg/issues)
629
- - **Documentation**: [Frigg Framework Docs](https://docs.friggframework.org)
630
- - **Community**: [Slack Channel](https://friggframework.org/#contact)