@friggframework/devtools 2.0.0--canary.400.bed3308.0 → 2.0.0--canary.404.e9d4980.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/frigg-cli/build-command/index.js +3 -18
  2. package/frigg-cli/deploy-command/index.js +3 -19
  3. package/frigg-cli/index.js +1 -73
  4. package/frigg-cli/install-command/index.js +2 -15
  5. package/frigg-cli/start-command/index.js +2 -17
  6. package/infrastructure/create-frigg-infrastructure.js +2 -2
  7. package/infrastructure/serverless-template.js +79 -529
  8. package/package.json +5 -9
  9. package/frigg-cli/.eslintrc.js +0 -141
  10. package/frigg-cli/__tests__/jest.config.js +0 -102
  11. package/frigg-cli/__tests__/unit/commands/build.test.js +0 -483
  12. package/frigg-cli/__tests__/unit/commands/install.test.js +0 -418
  13. package/frigg-cli/__tests__/unit/commands/ui.test.js +0 -592
  14. package/frigg-cli/__tests__/utils/command-tester.js +0 -170
  15. package/frigg-cli/__tests__/utils/mock-factory.js +0 -270
  16. package/frigg-cli/__tests__/utils/test-fixtures.js +0 -463
  17. package/frigg-cli/__tests__/utils/test-setup.js +0 -286
  18. package/frigg-cli/generate-command/__tests__/generate-command.test.js +0 -312
  19. package/frigg-cli/generate-command/azure-generator.js +0 -43
  20. package/frigg-cli/generate-command/gcp-generator.js +0 -47
  21. package/frigg-cli/generate-command/index.js +0 -350
  22. package/frigg-cli/generate-command/terraform-generator.js +0 -555
  23. package/frigg-cli/generate-iam-command.js +0 -115
  24. package/frigg-cli/package.json +0 -75
  25. package/frigg-cli/ui-command/index.js +0 -167
  26. package/frigg-cli/utils/app-resolver.js +0 -319
  27. package/frigg-cli/utils/backend-path.js +0 -38
  28. package/frigg-cli/utils/process-manager.js +0 -199
  29. package/frigg-cli/utils/repo-detection.js +0 -405
  30. package/infrastructure/AWS-DISCOVERY-TROUBLESHOOTING.md +0 -245
  31. package/infrastructure/AWS-IAM-CREDENTIAL-NEEDS.md +0 -620
  32. package/infrastructure/DEPLOYMENT-INSTRUCTIONS.md +0 -268
  33. package/infrastructure/GENERATE-IAM-DOCS.md +0 -253
  34. package/infrastructure/IAM-POLICY-TEMPLATES.md +0 -176
  35. package/infrastructure/README-TESTING.md +0 -332
  36. package/infrastructure/README.md +0 -421
  37. package/infrastructure/WEBSOCKET-CONFIGURATION.md +0 -105
  38. package/infrastructure/__tests__/fixtures/mock-aws-resources.js +0 -391
  39. package/infrastructure/__tests__/helpers/test-utils.js +0 -277
  40. package/infrastructure/aws-discovery.js +0 -568
  41. package/infrastructure/aws-discovery.test.js +0 -373
  42. package/infrastructure/build-time-discovery.js +0 -206
  43. package/infrastructure/build-time-discovery.test.js +0 -375
  44. package/infrastructure/frigg-deployment-iam-stack.yaml +0 -393
  45. package/infrastructure/iam-generator.js +0 -810
  46. package/infrastructure/iam-generator.test.js +0 -169
  47. package/infrastructure/iam-policy-basic.json +0 -236
  48. package/infrastructure/iam-policy-full.json +0 -305
  49. package/infrastructure/integration.test.js +0 -383
  50. package/infrastructure/run-discovery.js +0 -110
  51. package/infrastructure/serverless-template.test.js +0 -553
  52. package/management-ui/.eslintrc.js +0 -22
  53. package/management-ui/README.md +0 -203
  54. package/management-ui/components.json +0 -21
  55. package/management-ui/index.html +0 -13
  56. package/management-ui/merge-conflict-cleaner.py +0 -371
  57. package/management-ui/package-lock.json +0 -10997
  58. package/management-ui/package.json +0 -76
  59. package/management-ui/postcss.config.js +0 -6
  60. package/management-ui/server/api/backend.js +0 -256
  61. package/management-ui/server/api/cli.js +0 -315
  62. package/management-ui/server/api/codegen.js +0 -663
  63. package/management-ui/server/api/connections.js +0 -857
  64. package/management-ui/server/api/discovery.js +0 -185
  65. package/management-ui/server/api/environment/index.js +0 -1
  66. package/management-ui/server/api/environment/router.js +0 -378
  67. package/management-ui/server/api/environment.js +0 -328
  68. package/management-ui/server/api/integrations.js +0 -479
  69. package/management-ui/server/api/logs.js +0 -248
  70. package/management-ui/server/api/monitoring.js +0 -282
  71. package/management-ui/server/api/open-ide.js +0 -31
  72. package/management-ui/server/api/project.js +0 -553
  73. package/management-ui/server/api/users/sessions.js +0 -371
  74. package/management-ui/server/api/users/simulation.js +0 -254
  75. package/management-ui/server/api/users.js +0 -362
  76. package/management-ui/server/api-contract.md +0 -275
  77. package/management-ui/server/index.js +0 -428
  78. package/management-ui/server/middleware/errorHandler.js +0 -70
  79. package/management-ui/server/middleware/security.js +0 -32
  80. package/management-ui/server/processManager.js +0 -296
  81. package/management-ui/server/server.js +0 -188
  82. package/management-ui/server/services/aws-monitor.js +0 -413
  83. package/management-ui/server/services/npm-registry.js +0 -347
  84. package/management-ui/server/services/template-engine.js +0 -538
  85. package/management-ui/server/utils/cliIntegration.js +0 -220
  86. package/management-ui/server/utils/environment/auditLogger.js +0 -471
  87. package/management-ui/server/utils/environment/awsParameterStore.js +0 -264
  88. package/management-ui/server/utils/environment/encryption.js +0 -278
  89. package/management-ui/server/utils/environment/envFileManager.js +0 -286
  90. package/management-ui/server/utils/import-commonjs.js +0 -28
  91. package/management-ui/server/utils/response.js +0 -83
  92. package/management-ui/server/websocket/handler.js +0 -325
  93. package/management-ui/src/App.jsx +0 -51
  94. package/management-ui/src/assets/FriggLogo.svg +0 -1
  95. package/management-ui/src/components/AppRouter.jsx +0 -65
  96. package/management-ui/src/components/Button.jsx +0 -2
  97. package/management-ui/src/components/Card.jsx +0 -9
  98. package/management-ui/src/components/EnvironmentCompare.jsx +0 -400
  99. package/management-ui/src/components/EnvironmentEditor.jsx +0 -372
  100. package/management-ui/src/components/EnvironmentImportExport.jsx +0 -469
  101. package/management-ui/src/components/EnvironmentSchema.jsx +0 -491
  102. package/management-ui/src/components/EnvironmentSecurity.jsx +0 -463
  103. package/management-ui/src/components/ErrorBoundary.jsx +0 -73
  104. package/management-ui/src/components/IntegrationCard.jsx +0 -199
  105. package/management-ui/src/components/IntegrationCardEnhanced.jsx +0 -490
  106. package/management-ui/src/components/IntegrationExplorer.jsx +0 -379
  107. package/management-ui/src/components/IntegrationStatus.jsx +0 -235
  108. package/management-ui/src/components/Layout.jsx +0 -250
  109. package/management-ui/src/components/LoadingSpinner.jsx +0 -45
  110. package/management-ui/src/components/RepositoryPicker.jsx +0 -248
  111. package/management-ui/src/components/SessionMonitor.jsx +0 -255
  112. package/management-ui/src/components/StatusBadge.jsx +0 -70
  113. package/management-ui/src/components/UserContextSwitcher.jsx +0 -154
  114. package/management-ui/src/components/UserSimulation.jsx +0 -299
  115. package/management-ui/src/components/Welcome.jsx +0 -434
  116. package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +0 -637
  117. package/management-ui/src/components/codegen/APIModuleSelector.jsx +0 -227
  118. package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +0 -247
  119. package/management-ui/src/components/codegen/CodePreviewEditor.jsx +0 -316
  120. package/management-ui/src/components/codegen/DynamicModuleForm.jsx +0 -271
  121. package/management-ui/src/components/codegen/FormBuilder.jsx +0 -737
  122. package/management-ui/src/components/codegen/IntegrationGenerator.jsx +0 -855
  123. package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +0 -797
  124. package/management-ui/src/components/codegen/SchemaBuilder.jsx +0 -303
  125. package/management-ui/src/components/codegen/TemplateSelector.jsx +0 -586
  126. package/management-ui/src/components/codegen/index.js +0 -10
  127. package/management-ui/src/components/connections/ConnectionConfigForm.jsx +0 -362
  128. package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +0 -182
  129. package/management-ui/src/components/connections/ConnectionTester.jsx +0 -200
  130. package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +0 -292
  131. package/management-ui/src/components/connections/OAuthFlow.jsx +0 -204
  132. package/management-ui/src/components/connections/index.js +0 -5
  133. package/management-ui/src/components/index.js +0 -21
  134. package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +0 -222
  135. package/management-ui/src/components/monitoring/LambdaMetrics.jsx +0 -169
  136. package/management-ui/src/components/monitoring/MetricsChart.jsx +0 -197
  137. package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +0 -393
  138. package/management-ui/src/components/monitoring/SQSMetrics.jsx +0 -246
  139. package/management-ui/src/components/monitoring/index.js +0 -6
  140. package/management-ui/src/components/monitoring/monitoring.css +0 -218
  141. package/management-ui/src/components/theme-provider.jsx +0 -52
  142. package/management-ui/src/components/theme-toggle.jsx +0 -39
  143. package/management-ui/src/components/ui/badge.tsx +0 -36
  144. package/management-ui/src/components/ui/button.test.jsx +0 -56
  145. package/management-ui/src/components/ui/button.tsx +0 -57
  146. package/management-ui/src/components/ui/card.tsx +0 -76
  147. package/management-ui/src/components/ui/dropdown-menu.tsx +0 -199
  148. package/management-ui/src/components/ui/select.tsx +0 -157
  149. package/management-ui/src/components/ui/skeleton.jsx +0 -15
  150. package/management-ui/src/hooks/useFrigg.jsx +0 -387
  151. package/management-ui/src/hooks/useSocket.jsx +0 -58
  152. package/management-ui/src/index.css +0 -194
  153. package/management-ui/src/lib/utils.ts +0 -6
  154. package/management-ui/src/main.jsx +0 -10
  155. package/management-ui/src/pages/CodeGeneration.jsx +0 -14
  156. package/management-ui/src/pages/Connections.jsx +0 -252
  157. package/management-ui/src/pages/ConnectionsEnhanced.jsx +0 -427
  158. package/management-ui/src/pages/Dashboard.jsx +0 -311
  159. package/management-ui/src/pages/Environment.jsx +0 -314
  160. package/management-ui/src/pages/IntegrationConfigure.jsx +0 -544
  161. package/management-ui/src/pages/IntegrationDiscovery.jsx +0 -479
  162. package/management-ui/src/pages/IntegrationTest.jsx +0 -494
  163. package/management-ui/src/pages/Integrations.jsx +0 -254
  164. package/management-ui/src/pages/Monitoring.jsx +0 -17
  165. package/management-ui/src/pages/Simulation.jsx +0 -155
  166. package/management-ui/src/pages/Users.jsx +0 -492
  167. package/management-ui/src/services/api.js +0 -41
  168. package/management-ui/src/services/apiModuleService.js +0 -193
  169. package/management-ui/src/services/websocket-handlers.js +0 -120
  170. package/management-ui/src/test/api/project.test.js +0 -273
  171. package/management-ui/src/test/components/Welcome.test.jsx +0 -378
  172. package/management-ui/src/test/mocks/server.js +0 -178
  173. package/management-ui/src/test/setup.js +0 -61
  174. package/management-ui/src/test/utils/test-utils.jsx +0 -134
  175. package/management-ui/src/utils/repository.js +0 -98
  176. package/management-ui/src/utils/repository.test.js +0 -118
  177. package/management-ui/src/workflows/phase2-integration-workflows.js +0 -884
  178. package/management-ui/tailwind.config.js +0 -63
  179. package/management-ui/tsconfig.json +0 -37
  180. package/management-ui/tsconfig.node.json +0 -10
  181. package/management-ui/vite.config.js +0 -26
  182. package/management-ui/vitest.config.js +0 -38
@@ -1,620 +0,0 @@
1
- # AWS IAM Credential Requirements for Frigg Applications
2
-
3
- This document outlines the minimum AWS IAM permissions required to build and deploy Frigg applications with VPC, KMS, and SSM support.
4
-
5
- ## Overview
6
-
7
- Frigg provides two IAM policy templates:
8
-
9
- 1. **Basic Policy** (`iam-policy-basic.json`) - Core Lambda/API Gateway functionality only (no VPC/KMS/SSM)
10
- 2. **Full Policy** (`iam-policy-full.json`) - Includes VPC, KMS, and SSM support for advanced deployments
11
-
12
- Choose the policy that matches your deployment needs:
13
- - Use **Basic** for simple serverless functions with public internet access
14
- - Use **Full** for VPC-enabled functions with encryption and parameter store support
15
-
16
- The AWS discovery process runs during the `before:package:initialize` serverless hook to automatically find your default VPC, subnets, security groups, and KMS keys, eliminating the need for manual resource ID lookup.
17
-
18
- ## Discovery-Time Permissions (Build Process)
19
-
20
- These permissions are required when `aws-discovery.js` runs during the build to find your default AWS resources:
21
-
22
- ```json
23
- {
24
- "Version": "2012-10-17",
25
- "Statement": [
26
- {
27
- "Sid": "AWSDiscoveryPermissions",
28
- "Effect": "Allow",
29
- "Action": [
30
- "sts:GetCallerIdentity",
31
- "ec2:DescribeVpcs",
32
- "ec2:DescribeSubnets",
33
- "ec2:DescribeSecurityGroups",
34
- "ec2:DescribeRouteTables",
35
- "ec2:DescribeNatGateways",
36
- "ec2:DescribeAddresses",
37
- "kms:ListKeys",
38
- "kms:DescribeKey"
39
- ],
40
- "Resource": "*"
41
- }
42
- ]
43
- }
44
- ```
45
-
46
- ### What Each Permission Does:
47
- - **`sts:GetCallerIdentity`** - Gets your AWS account ID for KMS key ARN construction
48
- - **`ec2:DescribeVpcs`** - Finds your default VPC or first available VPC
49
- - **`ec2:DescribeSubnets`** - Identifies private subnets within your VPC
50
- - **`ec2:DescribeSecurityGroups`** - Locates default security group or Frigg-specific security group
51
- - **`ec2:DescribeRouteTables`** - Determines which subnets are private (no direct internet gateway route)
52
- - **`ec2:DescribeNatGateways`** - Finds existing NAT Gateways to reuse (prevents duplicate resource creation)
53
- - **`ec2:DescribeAddresses`** - Finds available Elastic IPs to reuse (prevents allocation conflicts)
54
- - **`kms:ListKeys`** - Lists available KMS keys in your account
55
- - **`kms:DescribeKey`** - Gets details about KMS keys to find customer-managed keys
56
-
57
- ## Core Deployment Permissions
58
-
59
- Required for basic Frigg application deployment:
60
-
61
- ```json
62
- {
63
- "Version": "2012-10-17",
64
- "Statement": [
65
- {
66
- "Sid": "CloudFormationFriggStacks",
67
- "Effect": "Allow",
68
- "Action": [
69
- "cloudformation:CreateStack",
70
- "cloudformation:UpdateStack",
71
- "cloudformation:DeleteStack",
72
- "cloudformation:DescribeStacks",
73
- "cloudformation:DescribeStackEvents",
74
- "cloudformation:DescribeStackResources",
75
- "cloudformation:DescribeStackResource",
76
- "cloudformation:ListStackResources",
77
- "cloudformation:GetTemplate",
78
- "cloudformation:ValidateTemplate",
79
- "cloudformation:DescribeChangeSet",
80
- "cloudformation:CreateChangeSet",
81
- "cloudformation:DeleteChangeSet",
82
- "cloudformation:ExecuteChangeSet"
83
- ],
84
- "Resource": [
85
- "arn:aws:cloudformation:*:*:stack/*frigg*/*"
86
- ]
87
- },
88
- {
89
- "Sid": "S3DeploymentBucket",
90
- "Effect": "Allow",
91
- "Action": [
92
- "s3:CreateBucket",
93
- "s3:DeleteBucket",
94
- "s3:PutObject",
95
- "s3:GetObject",
96
- "s3:DeleteObject",
97
- "s3:PutBucketPolicy",
98
- "s3:GetBucketPolicy",
99
- "s3:DeleteBucketPolicy",
100
- "s3:PutBucketVersioning",
101
- "s3:GetBucketVersioning",
102
- "s3:PutBucketPublicAccessBlock",
103
- "s3:GetBucketPublicAccessBlock",
104
- "s3:PutBucketTagging",
105
- "s3:GetBucketTagging",
106
- "s3:DeleteBucketTagging",
107
- "s3:PutBucketEncryption",
108
- "s3:GetBucketEncryption",
109
- "s3:PutEncryptionConfiguration",
110
- "s3:PutBucketNotification",
111
- "s3:GetBucketNotification",
112
- "s3:GetBucketLocation",
113
- "s3:ListBucket",
114
- "s3:GetBucketAcl",
115
- "s3:PutBucketAcl"
116
- ],
117
- "Resource": [
118
- "arn:aws:s3:::*serverless*",
119
- "arn:aws:s3:::*serverless*/*"
120
- ]
121
- },
122
- {
123
- "Sid": "LambdaFriggFunctions",
124
- "Effect": "Allow",
125
- "Action": [
126
- "lambda:CreateFunction",
127
- "lambda:UpdateFunctionCode",
128
- "lambda:UpdateFunctionConfiguration",
129
- "lambda:DeleteFunction",
130
- "lambda:GetFunction",
131
- "lambda:ListFunctions",
132
- "lambda:PublishVersion",
133
- "lambda:CreateAlias",
134
- "lambda:UpdateAlias",
135
- "lambda:DeleteAlias",
136
- "lambda:GetAlias",
137
- "lambda:AddPermission",
138
- "lambda:RemovePermission",
139
- "lambda:GetPolicy",
140
- "lambda:PutProvisionedConcurrencyConfig",
141
- "lambda:DeleteProvisionedConcurrencyConfig",
142
- "lambda:PutConcurrency",
143
- "lambda:DeleteConcurrency",
144
- "lambda:TagResource",
145
- "lambda:UntagResource",
146
- "lambda:ListVersionsByFunction"
147
- ],
148
- "Resource": [
149
- "arn:aws:lambda:*:*:function:*frigg*"
150
- ]
151
- },
152
- {
153
- "Sid": "FriggLambdaEventSourceMapping",
154
- "Effect": "Allow",
155
- "Action": [
156
- "lambda:CreateEventSourceMapping",
157
- "lambda:DeleteEventSourceMapping",
158
- "lambda:GetEventSourceMapping",
159
- "lambda:UpdateEventSourceMapping",
160
- "lambda:ListEventSourceMappings"
161
- ],
162
- "Resource": [
163
- "arn:aws:lambda:*:*:event-source-mapping:*"
164
- ]
165
- },
166
- {
167
- "Sid": "IAMRolesForFriggLambda",
168
- "Effect": "Allow",
169
- "Action": [
170
- "iam:CreateRole",
171
- "iam:DeleteRole",
172
- "iam:GetRole",
173
- "iam:PassRole",
174
- "iam:PutRolePolicy",
175
- "iam:DeleteRolePolicy",
176
- "iam:GetRolePolicy",
177
- "iam:AttachRolePolicy",
178
- "iam:DetachRolePolicy",
179
- "iam:TagRole",
180
- "iam:UntagRole"
181
- ],
182
- "Resource": [
183
- "arn:aws:iam::*:role/*frigg*",
184
- "arn:aws:iam::*:role/*frigg*LambdaRole*"
185
- ]
186
- },
187
- {
188
- "Sid": "IAMPolicyVersionPermissions",
189
- "Effect": "Allow",
190
- "Action": [
191
- "iam:ListPolicyVersions"
192
- ],
193
- "Resource": [
194
- "arn:aws:iam::*:policy/*"
195
- ]
196
- },
197
- {
198
- "Sid": "FriggMessagingServices",
199
- "Effect": "Allow",
200
- "Action": [
201
- "sqs:CreateQueue",
202
- "sqs:DeleteQueue",
203
- "sqs:GetQueueAttributes",
204
- "sqs:SetQueueAttributes",
205
- "sqs:GetQueueUrl",
206
- "sqs:TagQueue",
207
- "sqs:UntagQueue"
208
- ],
209
- "Resource": [
210
- "arn:aws:sqs:*:*:*frigg*",
211
- "arn:aws:sqs:*:*:internal-error-queue-*"
212
- ]
213
- },
214
- {
215
- "Sid": "FriggSNSTopics",
216
- "Effect": "Allow",
217
- "Action": [
218
- "sns:CreateTopic",
219
- "sns:DeleteTopic",
220
- "sns:GetTopicAttributes",
221
- "sns:SetTopicAttributes",
222
- "sns:Subscribe",
223
- "sns:Unsubscribe",
224
- "sns:TagResource",
225
- "sns:UntagResource"
226
- ],
227
- "Resource": [
228
- "arn:aws:sns:*:*:*frigg*"
229
- ]
230
- },
231
- {
232
- "Sid": "FriggMonitoringAndLogs",
233
- "Effect": "Allow",
234
- "Action": [
235
- "cloudwatch:PutMetricAlarm",
236
- "cloudwatch:DeleteAlarms",
237
- "cloudwatch:DescribeAlarms",
238
- "logs:CreateLogGroup",
239
- "logs:CreateLogStream",
240
- "logs:DeleteLogGroup",
241
- "logs:DescribeLogGroups",
242
- "logs:DescribeLogStreams",
243
- "logs:FilterLogEvents",
244
- "logs:PutLogEvents",
245
- "logs:PutRetentionPolicy"
246
- ],
247
- "Resource": [
248
- "arn:aws:logs:*:*:log-group:/aws/lambda/*frigg*",
249
- "arn:aws:logs:*:*:log-group:/aws/lambda/*frigg*:*",
250
- "arn:aws:cloudwatch:*:*:alarm:*frigg*"
251
- ]
252
- },
253
- {
254
- "Sid": "FriggAPIGateway",
255
- "Effect": "Allow",
256
- "Action": [
257
- "apigateway:POST",
258
- "apigateway:PUT",
259
- "apigateway:DELETE",
260
- "apigateway:GET",
261
- "apigateway:PATCH"
262
- ],
263
- "Resource": [
264
- "arn:aws:apigateway:*::/restapis",
265
- "arn:aws:apigateway:*::/restapis/*",
266
- "arn:aws:apigateway:*::/domainnames",
267
- "arn:aws:apigateway:*::/domainnames/*"
268
- ]
269
- }
270
- ]
271
- }
272
- ```
273
-
274
- **What the Lambda permissions enable:**
275
- - **Function Management**: Create, update, delete, and configure Lambda functions
276
- - **Version & Alias Management**: Publish new versions and manage aliases for deployments
277
- - **Permission Management**: Add/remove function permissions for API Gateway and other services
278
- - **Concurrency Management**: Configure provisioned and reserved concurrency
279
- - **EventSourceMapping Management**: Connect Lambda functions to event sources like SQS, SNS, Kinesis, and DynamoDB streams. These permissions are crucial for:
280
- - Creating mappings between SQS queues and Lambda functions
281
- - Managing event-driven architectures
282
- - Handling queue-based processing (e.g., HubSpot integration queues)
283
- - Cleaning up event source mappings during stack deletion
284
- - Tagging event source mappings for resource management and cost allocation
285
-
286
- ## Feature-Specific Permissions
287
-
288
- ### VPC Support
289
-
290
- Additional permissions needed when your app definition includes `vpc: { enable: true }`:
291
-
292
- ```json
293
- {
294
- "Version": "2012-10-17",
295
- "Statement": [
296
- {
297
- "Sid": "FriggVPCDeploymentPermissions",
298
- "Effect": "Allow",
299
- "Action": [
300
- "ec2:CreateVpcEndpoint",
301
- "ec2:DeleteVpcEndpoint",
302
- "ec2:DescribeVpcEndpoints",
303
- "ec2:ModifyVpcEndpoint",
304
- "ec2:CreateNatGateway",
305
- "ec2:DeleteNatGateway",
306
- "ec2:DescribeNatGateways",
307
- "ec2:AllocateAddress",
308
- "ec2:ReleaseAddress",
309
- "ec2:DescribeAddresses",
310
- "ec2:AssociateAddress",
311
- "ec2:DisassociateAddress",
312
- "ec2:CreateRouteTable",
313
- "ec2:DeleteRouteTable",
314
- "ec2:DescribeRouteTables",
315
- "ec2:CreateRoute",
316
- "ec2:DeleteRoute",
317
- "ec2:AssociateRouteTable",
318
- "ec2:DisassociateRouteTable",
319
- "ec2:CreateSecurityGroup",
320
- "ec2:DeleteSecurityGroup",
321
- "ec2:AuthorizeSecurityGroupEgress",
322
- "ec2:AuthorizeSecurityGroupIngress",
323
- "ec2:RevokeSecurityGroupEgress",
324
- "ec2:RevokeSecurityGroupIngress",
325
- "ec2:CreateTags",
326
- "ec2:DeleteTags",
327
- "ec2:DescribeTags"
328
- ],
329
- "Resource": "*"
330
- }
331
- ]
332
- }
333
- ```
334
-
335
- **⚠️ Critical Note:** The `ec2:CreateTags`, `ec2:DeleteTags`, and `ec2:DescribeTags` permissions are **REQUIRED** for VPC deployments. Without these permissions, CloudFormation will fail with errors like:
336
-
337
- ```
338
- "User is not authorized to perform: ec2:CreateTags on resource: arn:aws:ec2:*:*:elastic-ip/*"
339
- ```
340
-
341
- **What this enables:**
342
- - Creates NAT Gateway for Lambda internet access to external APIs (Salesforce, HubSpot, etc.)
343
- - Creates VPC endpoints for AWS services (S3, DynamoDB, KMS, SSM) to reduce NAT Gateway costs
344
- - Creates route tables and subnet associations for proper Lambda networking
345
- - Automatically configures your Lambda functions to run in your default VPC with full internet access
346
-
347
- ### KMS Support
348
-
349
- Additional permissions needed when your app definition includes `encryption: { useDefaultKMSForFieldLevelEncryption: true }`:
350
-
351
- ```json
352
- {
353
- "Version": "2012-10-17",
354
- "Statement": [
355
- {
356
- "Sid": "FriggKMSEncryptionRuntime",
357
- "Effect": "Allow",
358
- "Action": [
359
- "kms:GenerateDataKey",
360
- "kms:Decrypt"
361
- ],
362
- "Resource": [
363
- "arn:aws:kms:*:*:key/*"
364
- ],
365
- "Condition": {
366
- "StringEquals": {
367
- "kms:ViaService": [
368
- "lambda.*.amazonaws.com",
369
- "s3.*.amazonaws.com"
370
- ]
371
- }
372
- }
373
- }
374
- ]
375
- }
376
- ```
377
-
378
- **What this enables:**
379
- - Lambda functions can encrypt and decrypt data using your default KMS key
380
- - Automatic discovery and configuration of customer-managed KMS keys
381
- - Fallback to AWS-managed keys if no customer keys are available
382
-
383
- ### SSM Parameter Store Support
384
-
385
- Additional permissions needed when your app definition includes `ssm: { enable: true }`:
386
-
387
- ```json
388
- {
389
- "Version": "2012-10-17",
390
- "Statement": [
391
- {
392
- "Sid": "FriggSSMParameterAccess",
393
- "Effect": "Allow",
394
- "Action": [
395
- "ssm:GetParameter",
396
- "ssm:GetParameters",
397
- "ssm:GetParametersByPath"
398
- ],
399
- "Resource": [
400
- "arn:aws:ssm:*:*:parameter/*frigg*",
401
- "arn:aws:ssm:*:*:parameter/*frigg*/*"
402
- ]
403
- }
404
- ]
405
- }
406
- ```
407
-
408
- **What this enables:**
409
- - Lambda functions can retrieve configuration from SSM Parameter Store
410
- - Automatic configuration of AWS Parameters and Secrets Lambda Extension layer
411
- - Secure environment variable management through SSM
412
-
413
- ## Complete Policy Template
414
-
415
- For convenience, here's a single IAM policy that includes all permissions needed for full Frigg functionality:
416
-
417
- ```json
418
- {
419
- "Version": "2012-10-17",
420
- "Statement": [
421
- {
422
- "Sid": "FriggCorePermissions",
423
- "Effect": "Allow",
424
- "Action": [
425
- "sts:GetCallerIdentity",
426
- "cloudformation:*",
427
- "lambda:*",
428
- "apigateway:*",
429
- "logs:*",
430
- "sqs:*",
431
- "sns:*",
432
- "cloudwatch:*",
433
- "ec2:Describe*",
434
- "ec2:CreateVpcEndpoint",
435
- "ec2:DeleteVpcEndpoint",
436
- "ec2:ModifyVpcEndpoint",
437
- "kms:ListKeys",
438
- "kms:DescribeKey",
439
- "kms:GenerateDataKey",
440
- "kms:Decrypt",
441
- "ssm:GetParameter*"
442
- ],
443
- "Resource": "*"
444
- },
445
- {
446
- "Sid": "S3DeploymentBuckets",
447
- "Effect": "Allow",
448
- "Action": [
449
- "s3:*"
450
- ],
451
- "Resource": [
452
- "arn:aws:s3:::*serverless*",
453
- "arn:aws:s3:::*serverless*/*"
454
- ]
455
- },
456
- {
457
- "Sid": "IAMRoleManagement",
458
- "Effect": "Allow",
459
- "Action": [
460
- "iam:CreateRole",
461
- "iam:DeleteRole",
462
- "iam:GetRole",
463
- "iam:PassRole",
464
- "iam:PutRolePolicy",
465
- "iam:DeleteRolePolicy",
466
- "iam:GetRolePolicy",
467
- "iam:AttachRolePolicy",
468
- "iam:DetachRolePolicy",
469
- "iam:TagRole",
470
- "iam:UntagRole",
471
- "iam:ListPolicyVersions"
472
- ],
473
- "Resource": "arn:aws:iam::*:role/*"
474
- }
475
- ]
476
- }
477
- ```
478
-
479
- ## Security Improvements (Updated)
480
-
481
- ### Scoped Resource Permissions
482
-
483
- This policy has been updated to follow the principle of least privilege by scoping permissions to Frigg-specific resources:
484
-
485
- **Before (Overly Broad):**
486
- ```json
487
- "Resource": "*" // ❌ Too permissive
488
- ```
489
-
490
- **After (Frigg-Specific):**
491
- ```json
492
- "Resource": [
493
- "arn:aws:lambda:*:*:function:*frigg*" // ✅ Only functions containing "frigg"
494
- ]
495
- ```
496
-
497
- ### Key Security Enhancements
498
-
499
- 1. **CloudFormation Stacks**: Limited to stacks containing "frigg" in the name
500
- 2. **Lambda Functions**: Scoped to functions containing "frigg" in the name
501
- 3. **IAM Roles**: Restricted to roles containing "frigg" (including Lambda execution roles)
502
- 4. **SQS/SNS**: Limited to queues and topics containing "frigg" in the name
503
- 5. **Logs & Monitoring**: Scoped to Lambda log groups for Frigg functions and CloudWatch alarms containing "frigg"
504
- 6. **KMS**: Added ViaService condition to restrict usage to Lambda and S3 services only
505
- 7. **SSM Parameters**: Limited to parameter paths containing "frigg" in the path structure
506
-
507
- ### Naming Convention Requirements
508
-
509
- For these permissions to work properly, ensure your Frigg applications follow the naming convention of including "frigg" in resource names:
510
-
511
- ✅ **Good Examples:**
512
- - `my-frigg-app-dev` (CloudFormation stack)
513
- - `integration-frigg-service-auth` (Lambda function)
514
- - `customer-frigg-platform-prod-auth` (Lambda function)
515
- - `/my-frigg-app/prod/database-url` (SSM parameter)
516
- - `internal-error-queue-dev` (SQS queue - special pattern for error queues)
517
-
518
- ❌ **Won't Match:**
519
- - `my-integration-app-dev` (no "frigg" in name)
520
- - `customer-platform-prod` (no "frigg" in name)
521
-
522
- **Note:** The `internal-error-queue-*` pattern is specifically allowed for error handling queues.
523
-
524
- ## Security Best Practices
525
-
526
- ### Principle of Least Privilege
527
-
528
- For production deployments, consider creating separate policies for different environments:
529
-
530
- 1. **Development Policy** - Includes all permissions for full feature testing
531
- 2. **Production Policy** - Only includes permissions for features actually used in production
532
- 3. **CI/CD Policy** - Includes discovery and deployment permissions but restricts sensitive operations
533
-
534
- ### Resource-Specific Restrictions
535
-
536
- You can further restrict permissions by:
537
-
538
- ```json
539
- {
540
- "Resource": [
541
- "arn:aws:cloudformation:us-east-1:YOUR-ACCOUNT-ID:stack/your-app-*/*",
542
- "arn:aws:lambda:us-east-1:YOUR-ACCOUNT-ID:function:your-app-*"
543
- ]
544
- }
545
- ```
546
-
547
- ### Environment Variables for Discovery
548
-
549
- The discovery process sets these environment variables during build:
550
-
551
- - `AWS_DISCOVERY_VPC_ID` - Your default VPC ID
552
- - `AWS_DISCOVERY_SECURITY_GROUP_ID` - Default security group ID
553
- - `AWS_DISCOVERY_SUBNET_ID_1` - First private subnet ID (for Lambda functions)
554
- - `AWS_DISCOVERY_SUBNET_ID_2` - Second private subnet ID (for Lambda functions, or same as first if only one exists)
555
- - `AWS_DISCOVERY_PUBLIC_SUBNET_ID` - Public subnet ID (for NAT Gateway placement)
556
- - `AWS_DISCOVERY_ROUTE_TABLE_ID` - Private route table ID for VPC endpoints
557
- - `AWS_DISCOVERY_KMS_KEY_ID` - Default KMS key ARN
558
- - `AWS_DISCOVERY_NAT_GATEWAY_ID` - Existing NAT Gateway ID (if found)
559
- - `AWS_DISCOVERY_ELASTIC_IP_ALLOCATION_ID` - Existing Elastic IP allocation ID (if found)
560
-
561
- ## Troubleshooting
562
-
563
- ### Common Permission Issues
564
-
565
- 1. **Discovery Fails** - Check that you have the discovery-time permissions
566
- 2. **VPC Endpoint Creation Fails** - Ensure you have `ec2:CreateVpcEndpoint` permission
567
- 3. **KMS Operations Fail** - Verify KMS key permissions and that the key exists
568
- 4. **SSM Parameter Access Fails** - Check SSM parameter path permissions
569
- 5. **IAM ListPolicyVersions Error** - If you see "User is not authorized to perform: iam:ListPolicyVersions", ensure your deployment user has this permission (added in recent versions)
570
- 6. **SQS SetQueueAttributes Error** - If you see errors for queues like "internal-error-queue-dev", ensure your IAM policy includes the pattern `arn:aws:sqs:*:*:internal-error-queue-*`
571
- 7. **CloudFormation ListStackResources Error** - If you see "User is not authorized to perform: cloudformation:ListStackResources", update your IAM stack with the latest template that includes this permission
572
- 8. **Elastic IP Already Associated Error** - If you see "Elastic IP address is already associated", the discovery process will now find and reuse existing NAT Gateways and EIPs to prevent conflicts
573
- 9. **Lambda EventSourceMapping Error** - If you see "User is not authorized to perform: lambda:DeleteEventSourceMapping", update your IAM stack with the latest template that includes EventSourceMapping permissions
574
- 10. **EC2 CreateTags Error** - If you see "User is not authorized to perform: ec2:CreateTags on resource: arn:aws:ec2:*:*:elastic-ip/*", you need the VPC deployment permissions that include `ec2:CreateTags`, `ec2:DeleteTags`, and `ec2:DescribeTags`. Use the **full policy** template or add the VPC permissions section to your existing policy.
575
- 11. **CloudWatch Logs TagResource Error** - If you see "User is not authorized to perform CreateLogGroup with Tags. An additional permission 'logs:TagResource' is required", ensure your IAM policy includes `logs:TagResource` and `logs:UntagResource` permissions. This is now included in both basic and full policy templates.
576
- 12. **Lambda PutFunctionConcurrency Error** - If you see "User is not authorized to perform: lambda:PutFunctionConcurrency", ensure your IAM policy includes the `lambda:PutFunctionConcurrency` permission. This is required when Lambda functions specify concurrency settings.
577
- 13. **EC2 DeleteVpcEndpoints Error** - If you see "User is not authorized to perform: ec2:DeleteVpcEndpoints", ensure your VPC policy includes both `ec2:DeleteVpcEndpoint` (singular) and `ec2:DeleteVpcEndpoints` (plural) permissions. AWS uses different permissions for single vs bulk operations.
578
- 14. **Lambda CreateEventSourceMapping Error** - If you see "User is not authorized to perform: lambda:CreateEventSourceMapping", this permission should already be included in both basic and full policy templates under the "FriggLambdaEventSourceMapping" section with the correct resource ARN `arn:aws:lambda:*:*:event-source-mapping:*`.
579
- 15. **Lambda TagResource Error on EventSourceMapping** - If you see "User is not authorized to perform: lambda:TagResource on resource: arn:aws:lambda:*:*:event-source-mapping:*", ensure your IAM policy includes `lambda:TagResource`, `lambda:UntagResource`, and `lambda:ListTags` permissions in the FriggLambdaEventSourceMapping section. These permissions are required when CloudFormation tags event source mappings during creation.
580
-
581
- ### Fallback Behavior
582
-
583
- If AWS discovery fails during build, the framework will:
584
- - Log a warning message
585
- - Set fallback environment variables
586
- - Continue with deployment using safe default values
587
- - Not fail the build process
588
-
589
- ### Regional Considerations
590
-
591
- Ensure your IAM policy includes permissions for the AWS region where you're deploying:
592
- - Discovery permissions work across all regions (use `*` in resource ARNs)
593
- - Deployment permissions should match your target region
594
- - Some services like IAM are global, others are region-specific
595
-
596
- ## Using with CI/CD
597
-
598
- For automated deployments, ensure your CI/CD system has:
599
-
600
- 1. **AWS Credentials** configured (access key or IAM role)
601
- 2. **Region** set via `AWS_REGION` environment variable
602
- 3. **This IAM policy** attached to the deployment user/role
603
- 4. **Proper build order** - discovery runs before packaging
604
-
605
- Example GitHub Actions configuration:
606
-
607
- ```yaml
608
- - name: Configure AWS credentials
609
- uses: aws-actions/configure-aws-credentials@v1
610
- with:
611
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
612
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
613
- aws-region: us-east-1
614
-
615
- - name: Deploy Frigg App
616
- run: |
617
- frigg deploy
618
- ```
619
-
620
- This policy ensures your Frigg application can successfully discover AWS resources during build time and deploy all necessary infrastructure components during deployment.