@friggframework/devtools 2.0.0--canary.400.bed3308.0 → 2.0.0--canary.400.545e7a8.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 (167) hide show
  1. package/frigg-cli/build-command/index.js +2 -15
  2. package/frigg-cli/deploy-command/index.js +2 -15
  3. package/frigg-cli/index.js +4 -66
  4. package/frigg-cli/install-command/index.js +2 -15
  5. package/frigg-cli/start-command/index.js +2 -17
  6. package/infrastructure/AWS-IAM-CREDENTIAL-NEEDS.md +19 -43
  7. package/infrastructure/IAM-POLICY-TEMPLATES.md +1 -1
  8. package/infrastructure/frigg-deployment-iam-stack.yaml +2 -16
  9. package/infrastructure/iam-generator.js +6 -129
  10. package/infrastructure/iam-policy-basic.json +5 -29
  11. package/infrastructure/iam-policy-full.json +5 -28
  12. package/infrastructure/serverless-template.js +3 -190
  13. package/infrastructure/serverless-template.test.js +0 -12
  14. package/management-ui/dist/assets/index-CbM64Oba.js +1221 -0
  15. package/management-ui/dist/assets/index-CkvseXTC.css +1 -0
  16. package/management-ui/{index.html → dist/index.html} +2 -1
  17. package/package.json +5 -5
  18. package/frigg-cli/.eslintrc.js +0 -141
  19. package/frigg-cli/__tests__/jest.config.js +0 -102
  20. package/frigg-cli/__tests__/unit/commands/build.test.js +0 -483
  21. package/frigg-cli/__tests__/unit/commands/install.test.js +0 -418
  22. package/frigg-cli/__tests__/unit/commands/ui.test.js +0 -592
  23. package/frigg-cli/__tests__/utils/command-tester.js +0 -170
  24. package/frigg-cli/__tests__/utils/mock-factory.js +0 -270
  25. package/frigg-cli/__tests__/utils/test-fixtures.js +0 -463
  26. package/frigg-cli/__tests__/utils/test-setup.js +0 -286
  27. package/frigg-cli/generate-command/__tests__/generate-command.test.js +0 -312
  28. package/frigg-cli/generate-command/azure-generator.js +0 -43
  29. package/frigg-cli/generate-command/gcp-generator.js +0 -47
  30. package/frigg-cli/generate-command/index.js +0 -350
  31. package/frigg-cli/generate-command/terraform-generator.js +0 -555
  32. package/frigg-cli/package.json +0 -75
  33. package/frigg-cli/ui-command/index.js +0 -167
  34. package/frigg-cli/utils/app-resolver.js +0 -319
  35. package/frigg-cli/utils/backend-path.js +0 -38
  36. package/frigg-cli/utils/process-manager.js +0 -199
  37. package/frigg-cli/utils/repo-detection.js +0 -405
  38. package/management-ui/.eslintrc.js +0 -22
  39. package/management-ui/README.md +0 -203
  40. package/management-ui/components.json +0 -21
  41. package/management-ui/merge-conflict-cleaner.py +0 -371
  42. package/management-ui/package-lock.json +0 -10997
  43. package/management-ui/package.json +0 -76
  44. package/management-ui/postcss.config.js +0 -6
  45. package/management-ui/server/api/backend.js +0 -256
  46. package/management-ui/server/api/cli.js +0 -315
  47. package/management-ui/server/api/codegen.js +0 -663
  48. package/management-ui/server/api/connections.js +0 -857
  49. package/management-ui/server/api/discovery.js +0 -185
  50. package/management-ui/server/api/environment/index.js +0 -1
  51. package/management-ui/server/api/environment/router.js +0 -378
  52. package/management-ui/server/api/environment.js +0 -328
  53. package/management-ui/server/api/integrations.js +0 -479
  54. package/management-ui/server/api/logs.js +0 -248
  55. package/management-ui/server/api/monitoring.js +0 -282
  56. package/management-ui/server/api/open-ide.js +0 -31
  57. package/management-ui/server/api/project.js +0 -553
  58. package/management-ui/server/api/users/sessions.js +0 -371
  59. package/management-ui/server/api/users/simulation.js +0 -254
  60. package/management-ui/server/api/users.js +0 -362
  61. package/management-ui/server/api-contract.md +0 -275
  62. package/management-ui/server/index.js +0 -428
  63. package/management-ui/server/middleware/errorHandler.js +0 -70
  64. package/management-ui/server/middleware/security.js +0 -32
  65. package/management-ui/server/processManager.js +0 -296
  66. package/management-ui/server/server.js +0 -188
  67. package/management-ui/server/services/aws-monitor.js +0 -413
  68. package/management-ui/server/services/npm-registry.js +0 -347
  69. package/management-ui/server/services/template-engine.js +0 -538
  70. package/management-ui/server/utils/cliIntegration.js +0 -220
  71. package/management-ui/server/utils/environment/auditLogger.js +0 -471
  72. package/management-ui/server/utils/environment/awsParameterStore.js +0 -264
  73. package/management-ui/server/utils/environment/encryption.js +0 -278
  74. package/management-ui/server/utils/environment/envFileManager.js +0 -286
  75. package/management-ui/server/utils/import-commonjs.js +0 -28
  76. package/management-ui/server/utils/response.js +0 -83
  77. package/management-ui/server/websocket/handler.js +0 -325
  78. package/management-ui/src/App.jsx +0 -51
  79. package/management-ui/src/components/AppRouter.jsx +0 -65
  80. package/management-ui/src/components/Button.jsx +0 -2
  81. package/management-ui/src/components/Card.jsx +0 -9
  82. package/management-ui/src/components/EnvironmentCompare.jsx +0 -400
  83. package/management-ui/src/components/EnvironmentEditor.jsx +0 -372
  84. package/management-ui/src/components/EnvironmentImportExport.jsx +0 -469
  85. package/management-ui/src/components/EnvironmentSchema.jsx +0 -491
  86. package/management-ui/src/components/EnvironmentSecurity.jsx +0 -463
  87. package/management-ui/src/components/ErrorBoundary.jsx +0 -73
  88. package/management-ui/src/components/IntegrationCard.jsx +0 -199
  89. package/management-ui/src/components/IntegrationCardEnhanced.jsx +0 -490
  90. package/management-ui/src/components/IntegrationExplorer.jsx +0 -379
  91. package/management-ui/src/components/IntegrationStatus.jsx +0 -235
  92. package/management-ui/src/components/Layout.jsx +0 -250
  93. package/management-ui/src/components/LoadingSpinner.jsx +0 -45
  94. package/management-ui/src/components/RepositoryPicker.jsx +0 -248
  95. package/management-ui/src/components/SessionMonitor.jsx +0 -255
  96. package/management-ui/src/components/StatusBadge.jsx +0 -70
  97. package/management-ui/src/components/UserContextSwitcher.jsx +0 -154
  98. package/management-ui/src/components/UserSimulation.jsx +0 -299
  99. package/management-ui/src/components/Welcome.jsx +0 -434
  100. package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +0 -637
  101. package/management-ui/src/components/codegen/APIModuleSelector.jsx +0 -227
  102. package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +0 -247
  103. package/management-ui/src/components/codegen/CodePreviewEditor.jsx +0 -316
  104. package/management-ui/src/components/codegen/DynamicModuleForm.jsx +0 -271
  105. package/management-ui/src/components/codegen/FormBuilder.jsx +0 -737
  106. package/management-ui/src/components/codegen/IntegrationGenerator.jsx +0 -855
  107. package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +0 -797
  108. package/management-ui/src/components/codegen/SchemaBuilder.jsx +0 -303
  109. package/management-ui/src/components/codegen/TemplateSelector.jsx +0 -586
  110. package/management-ui/src/components/codegen/index.js +0 -10
  111. package/management-ui/src/components/connections/ConnectionConfigForm.jsx +0 -362
  112. package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +0 -182
  113. package/management-ui/src/components/connections/ConnectionTester.jsx +0 -200
  114. package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +0 -292
  115. package/management-ui/src/components/connections/OAuthFlow.jsx +0 -204
  116. package/management-ui/src/components/connections/index.js +0 -5
  117. package/management-ui/src/components/index.js +0 -21
  118. package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +0 -222
  119. package/management-ui/src/components/monitoring/LambdaMetrics.jsx +0 -169
  120. package/management-ui/src/components/monitoring/MetricsChart.jsx +0 -197
  121. package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +0 -393
  122. package/management-ui/src/components/monitoring/SQSMetrics.jsx +0 -246
  123. package/management-ui/src/components/monitoring/index.js +0 -6
  124. package/management-ui/src/components/monitoring/monitoring.css +0 -218
  125. package/management-ui/src/components/theme-provider.jsx +0 -52
  126. package/management-ui/src/components/theme-toggle.jsx +0 -39
  127. package/management-ui/src/components/ui/badge.tsx +0 -36
  128. package/management-ui/src/components/ui/button.test.jsx +0 -56
  129. package/management-ui/src/components/ui/button.tsx +0 -57
  130. package/management-ui/src/components/ui/card.tsx +0 -76
  131. package/management-ui/src/components/ui/dropdown-menu.tsx +0 -199
  132. package/management-ui/src/components/ui/select.tsx +0 -157
  133. package/management-ui/src/components/ui/skeleton.jsx +0 -15
  134. package/management-ui/src/hooks/useFrigg.jsx +0 -387
  135. package/management-ui/src/hooks/useSocket.jsx +0 -58
  136. package/management-ui/src/index.css +0 -194
  137. package/management-ui/src/lib/utils.ts +0 -6
  138. package/management-ui/src/main.jsx +0 -10
  139. package/management-ui/src/pages/CodeGeneration.jsx +0 -14
  140. package/management-ui/src/pages/Connections.jsx +0 -252
  141. package/management-ui/src/pages/ConnectionsEnhanced.jsx +0 -427
  142. package/management-ui/src/pages/Dashboard.jsx +0 -311
  143. package/management-ui/src/pages/Environment.jsx +0 -314
  144. package/management-ui/src/pages/IntegrationConfigure.jsx +0 -544
  145. package/management-ui/src/pages/IntegrationDiscovery.jsx +0 -479
  146. package/management-ui/src/pages/IntegrationTest.jsx +0 -494
  147. package/management-ui/src/pages/Integrations.jsx +0 -254
  148. package/management-ui/src/pages/Monitoring.jsx +0 -17
  149. package/management-ui/src/pages/Simulation.jsx +0 -155
  150. package/management-ui/src/pages/Users.jsx +0 -492
  151. package/management-ui/src/services/api.js +0 -41
  152. package/management-ui/src/services/apiModuleService.js +0 -193
  153. package/management-ui/src/services/websocket-handlers.js +0 -120
  154. package/management-ui/src/test/api/project.test.js +0 -273
  155. package/management-ui/src/test/components/Welcome.test.jsx +0 -378
  156. package/management-ui/src/test/mocks/server.js +0 -178
  157. package/management-ui/src/test/setup.js +0 -61
  158. package/management-ui/src/test/utils/test-utils.jsx +0 -134
  159. package/management-ui/src/utils/repository.js +0 -98
  160. package/management-ui/src/utils/repository.test.js +0 -118
  161. package/management-ui/src/workflows/phase2-integration-workflows.js +0 -884
  162. package/management-ui/tailwind.config.js +0 -63
  163. package/management-ui/tsconfig.json +0 -37
  164. package/management-ui/tsconfig.node.json +0 -10
  165. package/management-ui/vite.config.js +0 -26
  166. package/management-ui/vitest.config.js +0 -38
  167. /package/management-ui/{src/assets/FriggLogo.svg → dist/assets/FriggLogo-B7Xx8ZW1.svg} +0 -0
@@ -1,25 +1,12 @@
1
1
  const { spawnSync } = require('child_process');
2
2
  const path = require('path');
3
- const { AppResolver } = require('../utils/app-resolver');
4
3
 
5
4
  async function buildCommand(options) {
6
5
  console.log('Building the serverless application...');
7
-
6
+
8
7
  // AWS discovery is now handled directly in serverless-template.js
9
8
  console.log('📦 Packaging serverless application...');
10
-
11
- // Resolve app path using AppResolver
12
- const appResolver = new AppResolver();
13
- let backendPath;
14
- try {
15
- backendPath = await appResolver.resolveAppPath(options);
16
- if (options.verbose) {
17
- console.log('Resolved app path:', backendPath);
18
- }
19
- } catch (error) {
20
- console.error('Error:', error.message);
21
- process.exit(1);
22
- }
9
+ const backendPath = path.resolve(process.cwd());
23
10
  const infrastructurePath = 'infrastructure.js';
24
11
  const command = 'serverless';
25
12
  const serverlessArgs = [
@@ -1,25 +1,12 @@
1
1
  const { spawn, spawnSync } = require('child_process');
2
2
  const path = require('path');
3
- const { AppResolver } = require('../utils/app-resolver');
4
3
 
5
4
  async function deployCommand(options) {
6
5
  console.log('Deploying the serverless application...');
7
-
6
+
8
7
  // AWS discovery is now handled directly in serverless-template.js
9
8
  console.log('🚀 Deploying serverless application...');
10
-
11
- // Resolve app path using AppResolver
12
- const appResolver = new AppResolver();
13
- let backendPath;
14
- try {
15
- backendPath = await appResolver.resolveAppPath(options);
16
- if (options.verbose) {
17
- console.log('Resolved app path:', backendPath);
18
- }
19
- } catch (error) {
20
- console.error('Error:', error.message);
21
- process.exit(1);
22
- }
9
+ const backendPath = path.resolve(process.cwd());
23
10
  const infrastructurePath = 'infrastructure.js';
24
11
  const command = 'serverless';
25
12
  const serverlessArgs = [
@@ -1,42 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // Check if we're running the generate command without all options
4
- // If so, we need to restart with proper NODE_OPTIONS to suppress warnings
5
- const args = process.argv.slice(2);
6
- if (args[0] === 'generate' && (!args.includes('--provider') || !args.includes('--format'))) {
7
- // If NODE_OPTIONS isn't set, restart the process with it
8
- if (!process.env.NODE_OPTIONS || !process.env.NODE_OPTIONS.includes('--no-warnings')) {
9
- const { spawn } = require('child_process');
10
- const nodeOptions = process.env.NODE_OPTIONS ?
11
- `${process.env.NODE_OPTIONS} --no-deprecation --no-warnings` :
12
- '--no-deprecation --no-warnings';
13
- const child = spawn(process.execPath, process.argv.slice(1), {
14
- stdio: 'inherit',
15
- env: { ...process.env, NODE_OPTIONS: nodeOptions }
16
- });
17
-
18
- child.on('exit', (code) => {
19
- process.exit(code || 0);
20
- });
21
- return;
22
- }
23
- }
24
-
25
3
  const { Command } = require('commander');
26
4
  const { installCommand } = require('./install-command');
27
5
  const { startCommand } = require('./start-command'); // Assuming you have a startCommand module
28
6
  const { buildCommand } = require('./build-command');
29
7
  const { deployCommand } = require('./deploy-command');
30
- const generateCommand = require('./generate-command');
31
- const { uiCommand } = require('./ui-command');
8
+ const { generateIamCommand } = require('./generate-iam-command');
32
9
 
33
10
  const program = new Command();
34
11
  program
35
12
  .command('install [apiModuleName]')
36
13
  .description('Install an API module')
37
- .option('--app-path <path>', 'path to Frigg application directory')
38
- .option('--config <path>', 'path to Frigg configuration file')
39
- .option('--app <path>', 'alias for --app-path')
40
14
  .action(installCommand);
41
15
 
42
16
  program
@@ -44,9 +18,6 @@ program
44
18
  .description('Run the backend and optional frontend')
45
19
  .option('-s, --stage <stage>', 'deployment stage', 'dev')
46
20
  .option('-v, --verbose', 'enable verbose output')
47
- .option('--app-path <path>', 'path to Frigg application directory')
48
- .option('--config <path>', 'path to Frigg configuration file')
49
- .option('--app <path>', 'alias for --app-path')
50
21
  .action(startCommand);
51
22
 
52
23
  program
@@ -54,9 +25,6 @@ program
54
25
  .description('Build the serverless application')
55
26
  .option('-s, --stage <stage>', 'deployment stage', 'dev')
56
27
  .option('-v, --verbose', 'enable verbose output')
57
- .option('--app-path <path>', 'path to Frigg application directory')
58
- .option('--config <path>', 'path to Frigg configuration file')
59
- .option('--app <path>', 'alias for --app-path')
60
28
  .action(buildCommand);
61
29
 
62
30
  program
@@ -64,47 +32,17 @@ program
64
32
  .description('Deploy the serverless application')
65
33
  .option('-s, --stage <stage>', 'deployment stage', 'dev')
66
34
  .option('-v, --verbose', 'enable verbose output')
67
- .option('--app-path <path>', 'path to Frigg application directory')
68
- .option('--config <path>', 'path to Frigg configuration file')
69
- .option('--app <path>', 'alias for --app-path')
70
35
  .action(deployCommand);
71
36
 
72
- program
73
- .command('generate')
74
- .description('Generate deployment credentials for cloud providers')
75
- .option('-p, --provider <provider>', 'cloud provider (aws, azure, gcp)')
76
- .option('-f, --format <format>', 'output format (cloudformation, terraform, pulumi, arm, deployment-manager)')
77
- .option('-o, --output <path>', 'output directory', 'backend/infrastructure')
78
- .option('-u, --user <name>', 'deployment user name', 'frigg-deployment-user')
79
- .option('-s, --stack-name <name>', 'stack name (for CloudFormation)', 'frigg-deployment-iam')
80
- .option('-v, --verbose', 'enable verbose output')
81
- .action(generateCommand);
82
-
83
- // Legacy command for backward compatibility
84
37
  program
85
38
  .command('generate-iam')
86
- .description('[DEPRECATED] Use "generate" command instead')
39
+ .description('Generate IAM CloudFormation template based on app definition')
87
40
  .option('-o, --output <path>', 'output directory', 'backend/infrastructure')
88
41
  .option('-u, --user <name>', 'deployment user name', 'frigg-deployment-user')
89
42
  .option('-s, --stack-name <name>', 'CloudFormation stack name', 'frigg-deployment-iam')
90
43
  .option('-v, --verbose', 'enable verbose output')
91
- .action((options) => {
92
- console.log('⚠️ The generate-iam command is deprecated. Using "generate" with AWS CloudFormation...');
93
- generateCommand({ ...options, provider: 'aws', format: 'cloudformation' });
94
- });
95
-
96
- program
97
- .command('ui')
98
- .description('Start the Frigg Management UI')
99
- .option('-p, --port <number>', 'port number', '3001')
100
- .option('--no-open', 'do not open browser automatically')
101
- .option('-r, --repo <path>', 'path to Frigg repository')
102
- .option('--dev', 'run in development mode')
103
- .option('--app-path <path>', 'path to Frigg application directory')
104
- .option('--config <path>', 'path to Frigg configuration file')
105
- .option('--app <path>', 'alias for --app-path')
106
- .action(uiCommand);
44
+ .action(generateIamCommand);
107
45
 
108
46
  program.parse(process.argv);
109
47
 
110
- module.exports = { installCommand, startCommand, buildCommand, deployCommand, generateCommand, uiCommand };
48
+ module.exports = { installCommand, startCommand, buildCommand, deployCommand, generateIamCommand };
@@ -11,25 +11,12 @@ const {
11
11
  } = require('./validate-package');
12
12
  const { findNearestBackendPackageJson, validateBackendPath } = require('@friggframework/core');
13
13
 
14
- const installCommand = async (apiModuleName, options = {}) => {
14
+ const installCommand = async (apiModuleName) => {
15
15
  try {
16
16
  const packageNames = await searchAndSelectPackage(apiModuleName);
17
17
  if (!packageNames || packageNames.length === 0) return;
18
18
 
19
- // If app path options are provided, use AppResolver, otherwise fall back to existing logic
20
- let backendPath;
21
- if (options.appPath || options.config || options.app || process.env.FRIGG_APP_PATH) {
22
- const { AppResolver } = require('../utils/app-resolver');
23
- const appResolver = new AppResolver();
24
- try {
25
- backendPath = await appResolver.resolveAppPath(options);
26
- } catch (error) {
27
- logError(`Error resolving app path: ${error.message}`);
28
- process.exit(1);
29
- }
30
- } else {
31
- backendPath = findNearestBackendPackageJson();
32
- }
19
+ const backendPath = findNearestBackendPackageJson();
33
20
  validateBackendPath(backendPath);
34
21
 
35
22
  for (const packageName of packageNames) {
@@ -1,30 +1,15 @@
1
1
  const { spawn } = require('node:child_process');
2
2
  const path = require('node:path');
3
- const { AppResolver } = require('../utils/app-resolver');
4
3
 
5
- async function startCommand(options) {
4
+ function startCommand(options) {
6
5
  if (options.verbose) {
7
6
  console.log('Verbose mode enabled');
8
7
  console.log('Options:', options);
9
8
  }
10
9
  console.log('Starting backend and optional frontend...');
11
-
12
10
  // Suppress AWS SDK warning message about maintenance mode
13
11
  process.env.AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE = 1;
14
-
15
- // Resolve app path using AppResolver
16
- const appResolver = new AppResolver();
17
- let backendPath;
18
-
19
- try {
20
- backendPath = await appResolver.resolveAppPath(options);
21
- if (options.verbose) {
22
- console.log('Resolved app path:', backendPath);
23
- }
24
- } catch (error) {
25
- console.error('Error:', error.message);
26
- process.exit(1);
27
- }
12
+ const backendPath = path.resolve(process.cwd());
28
13
  console.log(`Starting backend in ${backendPath}...`);
29
14
  const infrastructurePath = 'infrastructure.js';
30
15
  const command = 'serverless';
@@ -4,14 +4,10 @@ This document outlines the minimum AWS IAM permissions required to build and dep
4
4
 
5
5
  ## Overview
6
6
 
7
- Frigg provides two IAM policy templates:
7
+ Frigg applications require two distinct sets of permissions:
8
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
9
+ 1. **Discovery-Time Permissions** - Used during the build process to discover default AWS resources
10
+ 2. **Deployment-Time Permissions** - Used during actual deployment to create CloudFormation resources
15
11
 
16
12
  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
13
 
@@ -90,29 +86,16 @@ Required for basic Frigg application deployment:
90
86
  "Effect": "Allow",
91
87
  "Action": [
92
88
  "s3:CreateBucket",
93
- "s3:DeleteBucket",
94
89
  "s3:PutObject",
95
90
  "s3:GetObject",
96
91
  "s3:DeleteObject",
97
92
  "s3:PutBucketPolicy",
98
- "s3:GetBucketPolicy",
99
- "s3:DeleteBucketPolicy",
100
93
  "s3:PutBucketVersioning",
101
- "s3:GetBucketVersioning",
102
94
  "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
95
  "s3:GetBucketLocation",
113
96
  "s3:ListBucket",
114
- "s3:GetBucketAcl",
115
- "s3:PutBucketAcl"
97
+ "s3:PutBucketTagging",
98
+ "s3:GetBucketTagging"
116
99
  ],
117
100
  "Resource": [
118
101
  "arn:aws:s3:::*serverless*",
@@ -281,7 +264,6 @@ Required for basic Frigg application deployment:
281
264
  - Managing event-driven architectures
282
265
  - Handling queue-based processing (e.g., HubSpot integration queues)
283
266
  - Cleaning up event source mappings during stack deletion
284
- - Tagging event source mappings for resource management and cost allocation
285
267
 
286
268
  ## Feature-Specific Permissions
287
269
 
@@ -294,7 +276,7 @@ Additional permissions needed when your app definition includes `vpc: { enable:
294
276
  "Version": "2012-10-17",
295
277
  "Statement": [
296
278
  {
297
- "Sid": "FriggVPCDeploymentPermissions",
279
+ "Sid": "FriggVPCEndpointManagement",
298
280
  "Effect": "Allow",
299
281
  "Action": [
300
282
  "ec2:CreateVpcEndpoint",
@@ -307,8 +289,6 @@ Additional permissions needed when your app definition includes `vpc: { enable:
307
289
  "ec2:AllocateAddress",
308
290
  "ec2:ReleaseAddress",
309
291
  "ec2:DescribeAddresses",
310
- "ec2:AssociateAddress",
311
- "ec2:DisassociateAddress",
312
292
  "ec2:CreateRouteTable",
313
293
  "ec2:DeleteRouteTable",
314
294
  "ec2:DescribeRouteTables",
@@ -321,23 +301,25 @@ Additional permissions needed when your app definition includes `vpc: { enable:
321
301
  "ec2:AuthorizeSecurityGroupEgress",
322
302
  "ec2:AuthorizeSecurityGroupIngress",
323
303
  "ec2:RevokeSecurityGroupEgress",
324
- "ec2:RevokeSecurityGroupIngress",
325
- "ec2:CreateTags",
326
- "ec2:DeleteTags",
327
- "ec2:DescribeTags"
304
+ "ec2:RevokeSecurityGroupIngress"
328
305
  ],
329
- "Resource": "*"
306
+ "Resource": "*",
307
+ "Condition": {
308
+ "StringLike": {
309
+ "ec2:CreateAction": [
310
+ "CreateVpcEndpoint",
311
+ "CreateNatGateway",
312
+ "CreateRouteTable",
313
+ "CreateRoute",
314
+ "CreateSecurityGroup"
315
+ ]
316
+ }
317
+ }
330
318
  }
331
319
  ]
332
320
  }
333
321
  ```
334
322
 
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
323
  **What this enables:**
342
324
  - Creates NAT Gateway for Lambda internet access to external APIs (Salesforce, HubSpot, etc.)
343
325
  - Creates VPC endpoints for AWS services (S3, DynamoDB, KMS, SSM) to reduce NAT Gateway costs
@@ -571,12 +553,6 @@ The discovery process sets these environment variables during build:
571
553
  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
554
  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
555
  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
556
 
581
557
  ### Fallback Behavior
582
558
 
@@ -137,7 +137,7 @@ Consider separate policies for different environments:
137
137
  4. **Lambda VPC errors** → Ensure VPC permissions are enabled
138
138
  5. **"lambda:DeleteEventSourceMapping" error** → Update to latest policy (includes EventSourceMapping permissions)
139
139
  6. **"ec2:DeleteVpcEndpoints" error** → Update IAM policy to use `ec2:DeleteVpcEndpoints` (plural) instead of `ec2:DeleteVpcEndpoint`
140
- 7. **S3 permission errors** (e.g., "s3:PutBucketTagging", "s3:DeleteBucket", "s3:GetBucketPolicy", "s3:PutBucketEncryption") → Update to latest policy (includes comprehensive S3 bucket management permissions)
140
+ 7. **"s3:PutBucketTagging" error** → Update to latest policy (includes S3 bucket tagging permissions)
141
141
 
142
142
  ### Validation
143
143
  Test your policy by deploying a simple Frigg app:
@@ -111,29 +111,16 @@ Resources:
111
111
  Effect: Allow
112
112
  Action:
113
113
  - 's3:CreateBucket'
114
- - 's3:DeleteBucket'
115
114
  - 's3:PutObject'
116
115
  - 's3:GetObject'
117
116
  - 's3:DeleteObject'
118
117
  - 's3:PutBucketPolicy'
119
- - 's3:GetBucketPolicy'
120
- - 's3:DeleteBucketPolicy'
121
118
  - 's3:PutBucketVersioning'
122
- - 's3:GetBucketVersioning'
123
119
  - 's3:PutBucketPublicAccessBlock'
124
- - 's3:GetBucketPublicAccessBlock'
125
- - 's3:PutBucketTagging'
126
- - 's3:GetBucketTagging'
127
- - 's3:DeleteBucketTagging'
128
- - 's3:PutBucketEncryption'
129
- - 's3:GetBucketEncryption'
130
- - 's3:PutEncryptionConfiguration'
131
- - 's3:PutBucketNotification'
132
- - 's3:GetBucketNotification'
133
120
  - 's3:GetBucketLocation'
134
121
  - 's3:ListBucket'
135
- - 's3:GetBucketAcl'
136
- - 's3:PutBucketAcl'
122
+ - 's3:PutBucketTagging'
123
+ - 's3:GetBucketTagging'
137
124
  Resource:
138
125
  - 'arn:aws:s3:::*serverless*'
139
126
  - 'arn:aws:s3:::*serverless*/*'
@@ -270,7 +257,6 @@ Resources:
270
257
  - 'arn:aws:apigateway:*::/restapis/*'
271
258
  - 'arn:aws:apigateway:*::/domainnames'
272
259
  - 'arn:aws:apigateway:*::/domainnames/*'
273
- - 'arn:aws:apigateway:*::/tags/*'
274
260
 
275
261
  # VPC-specific permissions
276
262
  FriggVPCPolicy: