@friggframework/devtools 2.0.0-next.3 → 2.0.0-next.30
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.
- package/frigg-cli/.eslintrc.js +141 -0
- package/frigg-cli/__tests__/jest.config.js +102 -0
- package/frigg-cli/__tests__/unit/commands/build.test.js +483 -0
- package/frigg-cli/__tests__/unit/commands/install.test.js +418 -0
- package/frigg-cli/__tests__/unit/commands/ui.test.js +592 -0
- package/frigg-cli/__tests__/utils/command-tester.js +170 -0
- package/frigg-cli/__tests__/utils/mock-factory.js +270 -0
- package/frigg-cli/__tests__/utils/test-fixtures.js +463 -0
- package/frigg-cli/__tests__/utils/test-setup.js +286 -0
- package/frigg-cli/build-command/index.js +54 -0
- package/frigg-cli/deploy-command/index.js +36 -0
- package/frigg-cli/generate-command/__tests__/generate-command.test.js +312 -0
- package/frigg-cli/generate-command/azure-generator.js +43 -0
- package/frigg-cli/generate-command/gcp-generator.js +47 -0
- package/frigg-cli/generate-command/index.js +332 -0
- package/frigg-cli/generate-command/terraform-generator.js +555 -0
- package/frigg-cli/generate-iam-command.js +115 -0
- package/frigg-cli/index.js +47 -1
- package/frigg-cli/index.test.js +1 -4
- package/frigg-cli/init-command/backend-first-handler.js +756 -0
- package/frigg-cli/init-command/index.js +93 -0
- package/frigg-cli/init-command/template-handler.js +143 -0
- package/frigg-cli/install-command/index.js +1 -4
- package/frigg-cli/package.json +51 -0
- package/frigg-cli/start-command/index.js +24 -4
- package/frigg-cli/test/init-command.test.js +180 -0
- package/frigg-cli/test/npm-registry.test.js +319 -0
- package/frigg-cli/ui-command/index.js +154 -0
- package/frigg-cli/utils/app-resolver.js +319 -0
- package/frigg-cli/utils/backend-path.js +16 -17
- package/frigg-cli/utils/npm-registry.js +167 -0
- package/frigg-cli/utils/process-manager.js +199 -0
- package/frigg-cli/utils/repo-detection.js +405 -0
- package/infrastructure/AWS-DISCOVERY-TROUBLESHOOTING.md +245 -0
- package/infrastructure/AWS-IAM-CREDENTIAL-NEEDS.md +596 -0
- package/infrastructure/DEPLOYMENT-INSTRUCTIONS.md +268 -0
- package/infrastructure/GENERATE-IAM-DOCS.md +253 -0
- package/infrastructure/IAM-POLICY-TEMPLATES.md +176 -0
- package/infrastructure/README-TESTING.md +332 -0
- package/infrastructure/README.md +421 -0
- package/infrastructure/WEBSOCKET-CONFIGURATION.md +105 -0
- package/infrastructure/__tests__/fixtures/mock-aws-resources.js +391 -0
- package/infrastructure/__tests__/helpers/test-utils.js +277 -0
- package/infrastructure/aws-discovery.js +568 -0
- package/infrastructure/aws-discovery.test.js +373 -0
- package/infrastructure/build-time-discovery.js +206 -0
- package/infrastructure/build-time-discovery.test.js +375 -0
- package/infrastructure/create-frigg-infrastructure.js +3 -5
- package/infrastructure/frigg-deployment-iam-stack.yaml +379 -0
- package/infrastructure/iam-generator.js +687 -0
- package/infrastructure/iam-generator.test.js +169 -0
- package/infrastructure/iam-policy-basic.json +212 -0
- package/infrastructure/iam-policy-full.json +282 -0
- package/infrastructure/integration.test.js +383 -0
- package/infrastructure/run-discovery.js +110 -0
- package/infrastructure/serverless-template.js +923 -113
- package/infrastructure/serverless-template.test.js +541 -0
- package/management-ui/.eslintrc.js +22 -0
- package/management-ui/README.md +203 -0
- package/management-ui/components.json +21 -0
- package/management-ui/docs/phase2-integration-guide.md +320 -0
- package/management-ui/index.html +13 -0
- package/management-ui/package-lock.json +16517 -0
- package/management-ui/package.json +76 -0
- package/management-ui/packages/devtools/frigg-cli/ui-command/index.js +302 -0
- package/management-ui/postcss.config.js +6 -0
- package/management-ui/server/api/backend.js +256 -0
- package/management-ui/server/api/cli.js +315 -0
- package/management-ui/server/api/codegen.js +663 -0
- package/management-ui/server/api/connections.js +857 -0
- package/management-ui/server/api/discovery.js +185 -0
- package/management-ui/server/api/environment/index.js +1 -0
- package/management-ui/server/api/environment/router.js +378 -0
- package/management-ui/server/api/environment.js +328 -0
- package/management-ui/server/api/integrations.js +876 -0
- package/management-ui/server/api/logs.js +248 -0
- package/management-ui/server/api/monitoring.js +282 -0
- package/management-ui/server/api/open-ide.js +31 -0
- package/management-ui/server/api/project.js +1029 -0
- package/management-ui/server/api/users/sessions.js +371 -0
- package/management-ui/server/api/users/simulation.js +254 -0
- package/management-ui/server/api/users.js +362 -0
- package/management-ui/server/api-contract.md +275 -0
- package/management-ui/server/index.js +873 -0
- package/management-ui/server/middleware/errorHandler.js +93 -0
- package/management-ui/server/middleware/security.js +32 -0
- package/management-ui/server/processManager.js +296 -0
- package/management-ui/server/server.js +346 -0
- package/management-ui/server/services/aws-monitor.js +413 -0
- package/management-ui/server/services/npm-registry.js +347 -0
- package/management-ui/server/services/template-engine.js +538 -0
- package/management-ui/server/utils/cliIntegration.js +220 -0
- package/management-ui/server/utils/environment/auditLogger.js +471 -0
- package/management-ui/server/utils/environment/awsParameterStore.js +264 -0
- package/management-ui/server/utils/environment/encryption.js +278 -0
- package/management-ui/server/utils/environment/envFileManager.js +286 -0
- package/management-ui/server/utils/import-commonjs.js +28 -0
- package/management-ui/server/utils/response.js +83 -0
- package/management-ui/server/websocket/handler.js +325 -0
- package/management-ui/src/App.jsx +109 -0
- package/management-ui/src/assets/FriggLogo.svg +1 -0
- package/management-ui/src/components/AppRouter.jsx +65 -0
- package/management-ui/src/components/Button.jsx +70 -0
- package/management-ui/src/components/Card.jsx +97 -0
- package/management-ui/src/components/EnvironmentCompare.jsx +400 -0
- package/management-ui/src/components/EnvironmentEditor.jsx +372 -0
- package/management-ui/src/components/EnvironmentImportExport.jsx +469 -0
- package/management-ui/src/components/EnvironmentSchema.jsx +491 -0
- package/management-ui/src/components/EnvironmentSecurity.jsx +463 -0
- package/management-ui/src/components/ErrorBoundary.jsx +73 -0
- package/management-ui/src/components/IntegrationCard.jsx +481 -0
- package/management-ui/src/components/IntegrationCardEnhanced.jsx +770 -0
- package/management-ui/src/components/IntegrationExplorer.jsx +379 -0
- package/management-ui/src/components/IntegrationStatus.jsx +336 -0
- package/management-ui/src/components/Layout.jsx +716 -0
- package/management-ui/src/components/LoadingSpinner.jsx +113 -0
- package/management-ui/src/components/RepositoryPicker.jsx +248 -0
- package/management-ui/src/components/SessionMonitor.jsx +350 -0
- package/management-ui/src/components/StatusBadge.jsx +208 -0
- package/management-ui/src/components/UserContextSwitcher.jsx +212 -0
- package/management-ui/src/components/UserSimulation.jsx +327 -0
- package/management-ui/src/components/Welcome.jsx +434 -0
- package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +637 -0
- package/management-ui/src/components/codegen/APIModuleSelector.jsx +227 -0
- package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +247 -0
- package/management-ui/src/components/codegen/CodePreviewEditor.jsx +316 -0
- package/management-ui/src/components/codegen/DynamicModuleForm.jsx +271 -0
- package/management-ui/src/components/codegen/FormBuilder.jsx +737 -0
- package/management-ui/src/components/codegen/IntegrationGenerator.jsx +855 -0
- package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +797 -0
- package/management-ui/src/components/codegen/SchemaBuilder.jsx +303 -0
- package/management-ui/src/components/codegen/TemplateSelector.jsx +586 -0
- package/management-ui/src/components/codegen/index.js +10 -0
- package/management-ui/src/components/connections/ConnectionConfigForm.jsx +362 -0
- package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +182 -0
- package/management-ui/src/components/connections/ConnectionTester.jsx +200 -0
- package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +292 -0
- package/management-ui/src/components/connections/OAuthFlow.jsx +204 -0
- package/management-ui/src/components/connections/index.js +5 -0
- package/management-ui/src/components/index.js +21 -0
- package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +222 -0
- package/management-ui/src/components/monitoring/LambdaMetrics.jsx +169 -0
- package/management-ui/src/components/monitoring/MetricsChart.jsx +197 -0
- package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +393 -0
- package/management-ui/src/components/monitoring/SQSMetrics.jsx +246 -0
- package/management-ui/src/components/monitoring/index.js +6 -0
- package/management-ui/src/components/monitoring/monitoring.css +218 -0
- package/management-ui/src/components/theme-provider.jsx +52 -0
- package/management-ui/src/components/theme-toggle.jsx +39 -0
- package/management-ui/src/components/ui/badge.tsx +36 -0
- package/management-ui/src/components/ui/button.test.jsx +56 -0
- package/management-ui/src/components/ui/button.tsx +57 -0
- package/management-ui/src/components/ui/card.tsx +76 -0
- package/management-ui/src/components/ui/dropdown-menu.tsx +199 -0
- package/management-ui/src/components/ui/select.tsx +157 -0
- package/management-ui/src/components/ui/skeleton.jsx +15 -0
- package/management-ui/src/hooks/useFrigg.jsx +601 -0
- package/management-ui/src/hooks/useSocket.jsx +58 -0
- package/management-ui/src/index.css +193 -0
- package/management-ui/src/lib/utils.ts +6 -0
- package/management-ui/src/main.jsx +10 -0
- package/management-ui/src/pages/CodeGeneration.jsx +14 -0
- package/management-ui/src/pages/Connections.jsx +252 -0
- package/management-ui/src/pages/ConnectionsEnhanced.jsx +633 -0
- package/management-ui/src/pages/Dashboard.jsx +311 -0
- package/management-ui/src/pages/Environment.jsx +314 -0
- package/management-ui/src/pages/IntegrationConfigure.jsx +669 -0
- package/management-ui/src/pages/IntegrationDiscovery.jsx +567 -0
- package/management-ui/src/pages/IntegrationTest.jsx +742 -0
- package/management-ui/src/pages/Integrations.jsx +253 -0
- package/management-ui/src/pages/Monitoring.jsx +17 -0
- package/management-ui/src/pages/Simulation.jsx +155 -0
- package/management-ui/src/pages/Users.jsx +492 -0
- package/management-ui/src/services/api.js +41 -0
- package/management-ui/src/services/apiModuleService.js +193 -0
- package/management-ui/src/services/websocket-handlers.js +120 -0
- package/management-ui/src/test/api/project.test.js +273 -0
- package/management-ui/src/test/components/Welcome.test.jsx +378 -0
- package/management-ui/src/test/mocks/server.js +178 -0
- package/management-ui/src/test/setup.js +61 -0
- package/management-ui/src/test/utils/test-utils.jsx +134 -0
- package/management-ui/src/utils/repository.js +98 -0
- package/management-ui/src/utils/repository.test.js +118 -0
- package/management-ui/src/workflows/phase2-integration-workflows.js +884 -0
- package/management-ui/tailwind.config.js +63 -0
- package/management-ui/tsconfig.json +37 -0
- package/management-ui/tsconfig.node.json +10 -0
- package/management-ui/vite.config.js +26 -0
- package/management-ui/vitest.config.js +38 -0
- package/package.json +16 -9
- package/infrastructure/app-handler-helpers.js +0 -57
- package/infrastructure/backend-utils.js +0 -90
- package/infrastructure/routers/auth.js +0 -26
- package/infrastructure/routers/integration-defined-routers.js +0 -37
- package/infrastructure/routers/middleware/loadUser.js +0 -15
- package/infrastructure/routers/middleware/requireLoggedInUser.js +0 -12
- package/infrastructure/routers/user.js +0 -41
- package/infrastructure/routers/websocket.js +0 -55
- package/infrastructure/workers/integration-defined-workers.js +0 -24
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
const { generateIAMCloudFormation, getFeatureSummary } = require('./iam-generator');
|
|
2
|
+
|
|
3
|
+
describe('IAM Generator', () => {
|
|
4
|
+
describe('getFeatureSummary', () => {
|
|
5
|
+
it('should detect all features when enabled', () => {
|
|
6
|
+
const appDefinition = {
|
|
7
|
+
name: 'test-app',
|
|
8
|
+
integrations: ['Integration1', 'Integration2'],
|
|
9
|
+
vpc: { enable: true },
|
|
10
|
+
encryption: { useDefaultKMSForFieldLevelEncryption: true },
|
|
11
|
+
ssm: { enable: true },
|
|
12
|
+
websockets: { enable: true }
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const summary = getFeatureSummary(appDefinition);
|
|
16
|
+
|
|
17
|
+
expect(summary.appName).toBe('test-app');
|
|
18
|
+
expect(summary.integrationCount).toBe(2);
|
|
19
|
+
expect(summary.features.core).toBe(true);
|
|
20
|
+
expect(summary.features.vpc).toBe(true);
|
|
21
|
+
expect(summary.features.kms).toBe(true);
|
|
22
|
+
expect(summary.features.ssm).toBe(true);
|
|
23
|
+
expect(summary.features.websockets).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('should detect minimal features when disabled', () => {
|
|
27
|
+
const appDefinition = {
|
|
28
|
+
integrations: []
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const summary = getFeatureSummary(appDefinition);
|
|
32
|
+
|
|
33
|
+
expect(summary.appName).toBe('Unnamed Frigg App');
|
|
34
|
+
expect(summary.integrationCount).toBe(0);
|
|
35
|
+
expect(summary.features.core).toBe(true);
|
|
36
|
+
expect(summary.features.vpc).toBe(false);
|
|
37
|
+
expect(summary.features.kms).toBe(false);
|
|
38
|
+
expect(summary.features.ssm).toBe(false);
|
|
39
|
+
expect(summary.features.websockets).toBe(false);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe('generateIAMCloudFormation', () => {
|
|
44
|
+
it('should generate valid CloudFormation YAML', () => {
|
|
45
|
+
const appDefinition = {
|
|
46
|
+
name: 'test-app',
|
|
47
|
+
integrations: [],
|
|
48
|
+
vpc: { enable: false },
|
|
49
|
+
encryption: { useDefaultKMSForFieldLevelEncryption: false },
|
|
50
|
+
ssm: { enable: false },
|
|
51
|
+
websockets: { enable: false }
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const yaml = generateIAMCloudFormation(appDefinition);
|
|
55
|
+
|
|
56
|
+
expect(yaml).toContain('AWSTemplateFormatVersion');
|
|
57
|
+
expect(yaml).toContain('FriggDeploymentUser');
|
|
58
|
+
expect(yaml).toContain('FriggCoreDeploymentPolicy');
|
|
59
|
+
expect(yaml).toContain('FriggDiscoveryPolicy');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should include VPC policy when VPC is enabled', () => {
|
|
63
|
+
const appDefinition = {
|
|
64
|
+
name: 'test-app',
|
|
65
|
+
integrations: [],
|
|
66
|
+
vpc: { enable: true }
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const yaml = generateIAMCloudFormation(appDefinition);
|
|
70
|
+
|
|
71
|
+
expect(yaml).toContain('FriggVPCPolicy');
|
|
72
|
+
expect(yaml).toContain('CreateVPCPermissions');
|
|
73
|
+
expect(yaml).toContain('EnableVPCSupport');
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('should include KMS policy when encryption is enabled', () => {
|
|
77
|
+
const appDefinition = {
|
|
78
|
+
name: 'test-app',
|
|
79
|
+
integrations: [],
|
|
80
|
+
encryption: { useDefaultKMSForFieldLevelEncryption: true }
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const yaml = generateIAMCloudFormation(appDefinition);
|
|
84
|
+
|
|
85
|
+
expect(yaml).toContain('FriggKMSPolicy');
|
|
86
|
+
expect(yaml).toContain('CreateKMSPermissions');
|
|
87
|
+
expect(yaml).toContain('EnableKMSSupport');
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('should include SSM policy when SSM is enabled', () => {
|
|
91
|
+
const appDefinition = {
|
|
92
|
+
name: 'test-app',
|
|
93
|
+
integrations: [],
|
|
94
|
+
ssm: { enable: true }
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const yaml = generateIAMCloudFormation(appDefinition);
|
|
98
|
+
|
|
99
|
+
expect(yaml).toContain('FriggSSMPolicy');
|
|
100
|
+
expect(yaml).toContain('CreateSSMPermissions');
|
|
101
|
+
expect(yaml).toContain('EnableSSMSupport');
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('should set correct default parameter values based on features', () => {
|
|
105
|
+
const appDefinition = {
|
|
106
|
+
name: 'test-app',
|
|
107
|
+
integrations: [],
|
|
108
|
+
vpc: { enable: true },
|
|
109
|
+
encryption: { useDefaultKMSForFieldLevelEncryption: false },
|
|
110
|
+
ssm: { enable: true }
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const yaml = generateIAMCloudFormation(appDefinition);
|
|
114
|
+
|
|
115
|
+
// Check parameter defaults match the enabled features
|
|
116
|
+
expect(yaml).toContain('Default: true'); // VPC enabled
|
|
117
|
+
expect(yaml).toContain('Default: false'); // KMS disabled
|
|
118
|
+
// SSM should be true
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('should include all core permissions', () => {
|
|
122
|
+
const appDefinition = {
|
|
123
|
+
name: 'test-app',
|
|
124
|
+
integrations: []
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const yaml = generateIAMCloudFormation(appDefinition);
|
|
128
|
+
|
|
129
|
+
// Check for core permissions
|
|
130
|
+
expect(yaml).toContain('cloudformation:CreateStack');
|
|
131
|
+
expect(yaml).toContain('cloudformation:ListStackResources');
|
|
132
|
+
expect(yaml).toContain('lambda:CreateFunction');
|
|
133
|
+
expect(yaml).toContain('iam:CreateRole');
|
|
134
|
+
expect(yaml).toContain('s3:CreateBucket');
|
|
135
|
+
expect(yaml).toContain('sqs:CreateQueue');
|
|
136
|
+
expect(yaml).toContain('sns:CreateTopic');
|
|
137
|
+
expect(yaml).toContain('logs:CreateLogGroup');
|
|
138
|
+
expect(yaml).toContain('apigateway:POST');
|
|
139
|
+
expect(yaml).toContain('lambda:ListVersionsByFunction');
|
|
140
|
+
expect(yaml).toContain('iam:ListPolicyVersions');
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it('should include internal-error-queue pattern in SQS resources', () => {
|
|
144
|
+
const appDefinition = {
|
|
145
|
+
name: 'test-app',
|
|
146
|
+
integrations: []
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const yaml = generateIAMCloudFormation(appDefinition);
|
|
150
|
+
|
|
151
|
+
expect(yaml).toContain('internal-error-queue-*');
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('should generate outputs section', () => {
|
|
155
|
+
const appDefinition = {
|
|
156
|
+
name: 'test-app',
|
|
157
|
+
integrations: []
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const yaml = generateIAMCloudFormation(appDefinition);
|
|
161
|
+
|
|
162
|
+
expect(yaml).toContain('Outputs:');
|
|
163
|
+
expect(yaml).toContain('DeploymentUserArn:');
|
|
164
|
+
expect(yaml).toContain('AccessKeyId:');
|
|
165
|
+
expect(yaml).toContain('SecretAccessKeyCommand:');
|
|
166
|
+
expect(yaml).toContain('CredentialsSecretArn:');
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
});
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Version": "2012-10-17",
|
|
3
|
+
"Statement": [
|
|
4
|
+
{
|
|
5
|
+
"Sid": "AWSDiscoveryPermissions",
|
|
6
|
+
"Effect": "Allow",
|
|
7
|
+
"Action": [
|
|
8
|
+
"sts:GetCallerIdentity",
|
|
9
|
+
"ec2:DescribeVpcs",
|
|
10
|
+
"ec2:DescribeSubnets",
|
|
11
|
+
"ec2:DescribeSecurityGroups",
|
|
12
|
+
"ec2:DescribeRouteTables",
|
|
13
|
+
"kms:ListKeys",
|
|
14
|
+
"kms:DescribeKey"
|
|
15
|
+
],
|
|
16
|
+
"Resource": "*"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"Sid": "CloudFormationFriggStacks",
|
|
20
|
+
"Effect": "Allow",
|
|
21
|
+
"Action": [
|
|
22
|
+
"cloudformation:CreateStack",
|
|
23
|
+
"cloudformation:UpdateStack",
|
|
24
|
+
"cloudformation:DeleteStack",
|
|
25
|
+
"cloudformation:DescribeStacks",
|
|
26
|
+
"cloudformation:DescribeStackEvents",
|
|
27
|
+
"cloudformation:DescribeStackResources",
|
|
28
|
+
"cloudformation:DescribeStackResource",
|
|
29
|
+
"cloudformation:ListStackResources",
|
|
30
|
+
"cloudformation:GetTemplate",
|
|
31
|
+
"cloudformation:ValidateTemplate",
|
|
32
|
+
"cloudformation:DescribeChangeSet",
|
|
33
|
+
"cloudformation:CreateChangeSet",
|
|
34
|
+
"cloudformation:DeleteChangeSet",
|
|
35
|
+
"cloudformation:ExecuteChangeSet"
|
|
36
|
+
],
|
|
37
|
+
"Resource": [
|
|
38
|
+
"arn:aws:cloudformation:*:*:stack/*frigg*/*"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"Sid": "S3DeploymentBucket",
|
|
43
|
+
"Effect": "Allow",
|
|
44
|
+
"Action": [
|
|
45
|
+
"s3:CreateBucket",
|
|
46
|
+
"s3:PutObject",
|
|
47
|
+
"s3:GetObject",
|
|
48
|
+
"s3:DeleteObject",
|
|
49
|
+
"s3:PutBucketPolicy",
|
|
50
|
+
"s3:PutBucketVersioning",
|
|
51
|
+
"s3:PutBucketPublicAccessBlock",
|
|
52
|
+
"s3:GetBucketLocation",
|
|
53
|
+
"s3:ListBucket",
|
|
54
|
+
"s3:PutBucketTagging",
|
|
55
|
+
"s3:GetBucketTagging"
|
|
56
|
+
],
|
|
57
|
+
"Resource": [
|
|
58
|
+
"arn:aws:s3:::*serverless*",
|
|
59
|
+
"arn:aws:s3:::*serverless*/*"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"Sid": "LambdaFriggFunctions",
|
|
64
|
+
"Effect": "Allow",
|
|
65
|
+
"Action": [
|
|
66
|
+
"lambda:CreateFunction",
|
|
67
|
+
"lambda:UpdateFunctionCode",
|
|
68
|
+
"lambda:UpdateFunctionConfiguration",
|
|
69
|
+
"lambda:DeleteFunction",
|
|
70
|
+
"lambda:GetFunction",
|
|
71
|
+
"lambda:ListFunctions",
|
|
72
|
+
"lambda:PublishVersion",
|
|
73
|
+
"lambda:CreateAlias",
|
|
74
|
+
"lambda:UpdateAlias",
|
|
75
|
+
"lambda:DeleteAlias",
|
|
76
|
+
"lambda:GetAlias",
|
|
77
|
+
"lambda:AddPermission",
|
|
78
|
+
"lambda:RemovePermission",
|
|
79
|
+
"lambda:GetPolicy",
|
|
80
|
+
"lambda:PutProvisionedConcurrencyConfig",
|
|
81
|
+
"lambda:DeleteProvisionedConcurrencyConfig",
|
|
82
|
+
"lambda:PutConcurrency",
|
|
83
|
+
"lambda:DeleteConcurrency",
|
|
84
|
+
"lambda:TagResource",
|
|
85
|
+
"lambda:UntagResource",
|
|
86
|
+
"lambda:ListVersionsByFunction"
|
|
87
|
+
],
|
|
88
|
+
"Resource": [
|
|
89
|
+
"arn:aws:lambda:*:*:function:*frigg*"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"Sid": "FriggLambdaEventSourceMapping",
|
|
94
|
+
"Effect": "Allow",
|
|
95
|
+
"Action": [
|
|
96
|
+
"lambda:CreateEventSourceMapping",
|
|
97
|
+
"lambda:DeleteEventSourceMapping",
|
|
98
|
+
"lambda:GetEventSourceMapping",
|
|
99
|
+
"lambda:UpdateEventSourceMapping",
|
|
100
|
+
"lambda:ListEventSourceMappings"
|
|
101
|
+
],
|
|
102
|
+
"Resource": [
|
|
103
|
+
"arn:aws:lambda:*:*:event-source-mapping:*"
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"Sid": "IAMRolesForFriggLambda",
|
|
108
|
+
"Effect": "Allow",
|
|
109
|
+
"Action": [
|
|
110
|
+
"iam:CreateRole",
|
|
111
|
+
"iam:DeleteRole",
|
|
112
|
+
"iam:GetRole",
|
|
113
|
+
"iam:PassRole",
|
|
114
|
+
"iam:PutRolePolicy",
|
|
115
|
+
"iam:DeleteRolePolicy",
|
|
116
|
+
"iam:GetRolePolicy",
|
|
117
|
+
"iam:AttachRolePolicy",
|
|
118
|
+
"iam:DetachRolePolicy",
|
|
119
|
+
"iam:TagRole",
|
|
120
|
+
"iam:UntagRole"
|
|
121
|
+
],
|
|
122
|
+
"Resource": [
|
|
123
|
+
"arn:aws:iam::*:role/*frigg*",
|
|
124
|
+
"arn:aws:iam::*:role/*frigg*LambdaRole*"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"Sid": "IAMPolicyVersionPermissions",
|
|
129
|
+
"Effect": "Allow",
|
|
130
|
+
"Action": [
|
|
131
|
+
"iam:ListPolicyVersions"
|
|
132
|
+
],
|
|
133
|
+
"Resource": [
|
|
134
|
+
"arn:aws:iam::*:policy/*"
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"Sid": "FriggMessagingServices",
|
|
139
|
+
"Effect": "Allow",
|
|
140
|
+
"Action": [
|
|
141
|
+
"sqs:CreateQueue",
|
|
142
|
+
"sqs:DeleteQueue",
|
|
143
|
+
"sqs:GetQueueAttributes",
|
|
144
|
+
"sqs:SetQueueAttributes",
|
|
145
|
+
"sqs:GetQueueUrl",
|
|
146
|
+
"sqs:TagQueue",
|
|
147
|
+
"sqs:UntagQueue"
|
|
148
|
+
],
|
|
149
|
+
"Resource": [
|
|
150
|
+
"arn:aws:sqs:*:*:*frigg*",
|
|
151
|
+
"arn:aws:sqs:*:*:internal-error-queue-*"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"Sid": "FriggSNSTopics",
|
|
156
|
+
"Effect": "Allow",
|
|
157
|
+
"Action": [
|
|
158
|
+
"sns:CreateTopic",
|
|
159
|
+
"sns:DeleteTopic",
|
|
160
|
+
"sns:GetTopicAttributes",
|
|
161
|
+
"sns:SetTopicAttributes",
|
|
162
|
+
"sns:Subscribe",
|
|
163
|
+
"sns:Unsubscribe",
|
|
164
|
+
"sns:ListSubscriptionsByTopic",
|
|
165
|
+
"sns:TagResource",
|
|
166
|
+
"sns:UntagResource"
|
|
167
|
+
],
|
|
168
|
+
"Resource": [
|
|
169
|
+
"arn:aws:sns:*:*:*frigg*"
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"Sid": "FriggMonitoringAndLogs",
|
|
174
|
+
"Effect": "Allow",
|
|
175
|
+
"Action": [
|
|
176
|
+
"cloudwatch:PutMetricAlarm",
|
|
177
|
+
"cloudwatch:DeleteAlarms",
|
|
178
|
+
"cloudwatch:DescribeAlarms",
|
|
179
|
+
"logs:CreateLogGroup",
|
|
180
|
+
"logs:CreateLogStream",
|
|
181
|
+
"logs:DeleteLogGroup",
|
|
182
|
+
"logs:DescribeLogGroups",
|
|
183
|
+
"logs:DescribeLogStreams",
|
|
184
|
+
"logs:FilterLogEvents",
|
|
185
|
+
"logs:PutLogEvents",
|
|
186
|
+
"logs:PutRetentionPolicy"
|
|
187
|
+
],
|
|
188
|
+
"Resource": [
|
|
189
|
+
"arn:aws:logs:*:*:log-group:/aws/lambda/*frigg*",
|
|
190
|
+
"arn:aws:logs:*:*:log-group:/aws/lambda/*frigg*:*",
|
|
191
|
+
"arn:aws:cloudwatch:*:*:alarm:*frigg*"
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"Sid": "FriggAPIGateway",
|
|
196
|
+
"Effect": "Allow",
|
|
197
|
+
"Action": [
|
|
198
|
+
"apigateway:POST",
|
|
199
|
+
"apigateway:PUT",
|
|
200
|
+
"apigateway:DELETE",
|
|
201
|
+
"apigateway:GET",
|
|
202
|
+
"apigateway:PATCH"
|
|
203
|
+
],
|
|
204
|
+
"Resource": [
|
|
205
|
+
"arn:aws:apigateway:*::/restapis",
|
|
206
|
+
"arn:aws:apigateway:*::/restapis/*",
|
|
207
|
+
"arn:aws:apigateway:*::/domainnames",
|
|
208
|
+
"arn:aws:apigateway:*::/domainnames/*"
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Version": "2012-10-17",
|
|
3
|
+
"Statement": [
|
|
4
|
+
{
|
|
5
|
+
"Sid": "AWSDiscoveryPermissions",
|
|
6
|
+
"Effect": "Allow",
|
|
7
|
+
"Action": [
|
|
8
|
+
"sts:GetCallerIdentity",
|
|
9
|
+
"ec2:DescribeVpcs",
|
|
10
|
+
"ec2:DescribeSubnets",
|
|
11
|
+
"ec2:DescribeSecurityGroups",
|
|
12
|
+
"ec2:DescribeRouteTables",
|
|
13
|
+
"kms:ListKeys",
|
|
14
|
+
"kms:DescribeKey"
|
|
15
|
+
],
|
|
16
|
+
"Resource": "*"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"Sid": "CloudFormationFriggStacks",
|
|
20
|
+
"Effect": "Allow",
|
|
21
|
+
"Action": [
|
|
22
|
+
"cloudformation:CreateStack",
|
|
23
|
+
"cloudformation:UpdateStack",
|
|
24
|
+
"cloudformation:DeleteStack",
|
|
25
|
+
"cloudformation:DescribeStacks",
|
|
26
|
+
"cloudformation:DescribeStackEvents",
|
|
27
|
+
"cloudformation:DescribeStackResources",
|
|
28
|
+
"cloudformation:DescribeStackResource",
|
|
29
|
+
"cloudformation:ListStackResources",
|
|
30
|
+
"cloudformation:GetTemplate",
|
|
31
|
+
"cloudformation:ValidateTemplate",
|
|
32
|
+
"cloudformation:DescribeChangeSet",
|
|
33
|
+
"cloudformation:CreateChangeSet",
|
|
34
|
+
"cloudformation:DeleteChangeSet",
|
|
35
|
+
"cloudformation:ExecuteChangeSet"
|
|
36
|
+
],
|
|
37
|
+
"Resource": [
|
|
38
|
+
"arn:aws:cloudformation:*:*:stack/*frigg*/*"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"Sid": "S3DeploymentBucket",
|
|
43
|
+
"Effect": "Allow",
|
|
44
|
+
"Action": [
|
|
45
|
+
"s3:CreateBucket",
|
|
46
|
+
"s3:PutObject",
|
|
47
|
+
"s3:GetObject",
|
|
48
|
+
"s3:DeleteObject",
|
|
49
|
+
"s3:PutBucketPolicy",
|
|
50
|
+
"s3:PutBucketVersioning",
|
|
51
|
+
"s3:PutBucketPublicAccessBlock",
|
|
52
|
+
"s3:GetBucketLocation",
|
|
53
|
+
"s3:ListBucket",
|
|
54
|
+
"s3:PutBucketTagging",
|
|
55
|
+
"s3:GetBucketTagging"
|
|
56
|
+
],
|
|
57
|
+
"Resource": [
|
|
58
|
+
"arn:aws:s3:::*serverless*",
|
|
59
|
+
"arn:aws:s3:::*serverless*/*"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"Sid": "LambdaFriggFunctions",
|
|
64
|
+
"Effect": "Allow",
|
|
65
|
+
"Action": [
|
|
66
|
+
"lambda:CreateFunction",
|
|
67
|
+
"lambda:UpdateFunctionCode",
|
|
68
|
+
"lambda:UpdateFunctionConfiguration",
|
|
69
|
+
"lambda:DeleteFunction",
|
|
70
|
+
"lambda:GetFunction",
|
|
71
|
+
"lambda:ListFunctions",
|
|
72
|
+
"lambda:PublishVersion",
|
|
73
|
+
"lambda:CreateAlias",
|
|
74
|
+
"lambda:UpdateAlias",
|
|
75
|
+
"lambda:DeleteAlias",
|
|
76
|
+
"lambda:GetAlias",
|
|
77
|
+
"lambda:AddPermission",
|
|
78
|
+
"lambda:RemovePermission",
|
|
79
|
+
"lambda:GetPolicy",
|
|
80
|
+
"lambda:PutProvisionedConcurrencyConfig",
|
|
81
|
+
"lambda:DeleteProvisionedConcurrencyConfig",
|
|
82
|
+
"lambda:PutConcurrency",
|
|
83
|
+
"lambda:DeleteConcurrency",
|
|
84
|
+
"lambda:TagResource",
|
|
85
|
+
"lambda:UntagResource",
|
|
86
|
+
"lambda:ListVersionsByFunction"
|
|
87
|
+
],
|
|
88
|
+
"Resource": [
|
|
89
|
+
"arn:aws:lambda:*:*:function:*frigg*"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"Sid": "FriggLambdaEventSourceMapping",
|
|
94
|
+
"Effect": "Allow",
|
|
95
|
+
"Action": [
|
|
96
|
+
"lambda:CreateEventSourceMapping",
|
|
97
|
+
"lambda:DeleteEventSourceMapping",
|
|
98
|
+
"lambda:GetEventSourceMapping",
|
|
99
|
+
"lambda:UpdateEventSourceMapping",
|
|
100
|
+
"lambda:ListEventSourceMappings"
|
|
101
|
+
],
|
|
102
|
+
"Resource": [
|
|
103
|
+
"arn:aws:lambda:*:*:event-source-mapping:*"
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"Sid": "IAMRolesForFriggLambda",
|
|
108
|
+
"Effect": "Allow",
|
|
109
|
+
"Action": [
|
|
110
|
+
"iam:CreateRole",
|
|
111
|
+
"iam:DeleteRole",
|
|
112
|
+
"iam:GetRole",
|
|
113
|
+
"iam:PassRole",
|
|
114
|
+
"iam:PutRolePolicy",
|
|
115
|
+
"iam:DeleteRolePolicy",
|
|
116
|
+
"iam:GetRolePolicy",
|
|
117
|
+
"iam:AttachRolePolicy",
|
|
118
|
+
"iam:DetachRolePolicy",
|
|
119
|
+
"iam:TagRole",
|
|
120
|
+
"iam:UntagRole"
|
|
121
|
+
],
|
|
122
|
+
"Resource": [
|
|
123
|
+
"arn:aws:iam::*:role/*frigg*",
|
|
124
|
+
"arn:aws:iam::*:role/*frigg*LambdaRole*"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"Sid": "IAMPolicyVersionPermissions",
|
|
129
|
+
"Effect": "Allow",
|
|
130
|
+
"Action": [
|
|
131
|
+
"iam:ListPolicyVersions"
|
|
132
|
+
],
|
|
133
|
+
"Resource": [
|
|
134
|
+
"arn:aws:iam::*:policy/*"
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"Sid": "FriggMessagingServices",
|
|
139
|
+
"Effect": "Allow",
|
|
140
|
+
"Action": [
|
|
141
|
+
"sqs:CreateQueue",
|
|
142
|
+
"sqs:DeleteQueue",
|
|
143
|
+
"sqs:GetQueueAttributes",
|
|
144
|
+
"sqs:SetQueueAttributes",
|
|
145
|
+
"sqs:GetQueueUrl",
|
|
146
|
+
"sqs:TagQueue",
|
|
147
|
+
"sqs:UntagQueue"
|
|
148
|
+
],
|
|
149
|
+
"Resource": [
|
|
150
|
+
"arn:aws:sqs:*:*:*frigg*",
|
|
151
|
+
"arn:aws:sqs:*:*:internal-error-queue-*"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"Sid": "FriggSNSTopics",
|
|
156
|
+
"Effect": "Allow",
|
|
157
|
+
"Action": [
|
|
158
|
+
"sns:CreateTopic",
|
|
159
|
+
"sns:DeleteTopic",
|
|
160
|
+
"sns:GetTopicAttributes",
|
|
161
|
+
"sns:SetTopicAttributes",
|
|
162
|
+
"sns:Subscribe",
|
|
163
|
+
"sns:Unsubscribe",
|
|
164
|
+
"sns:ListSubscriptionsByTopic",
|
|
165
|
+
"sns:TagResource",
|
|
166
|
+
"sns:UntagResource"
|
|
167
|
+
],
|
|
168
|
+
"Resource": [
|
|
169
|
+
"arn:aws:sns:*:*:*frigg*"
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"Sid": "FriggMonitoringAndLogs",
|
|
174
|
+
"Effect": "Allow",
|
|
175
|
+
"Action": [
|
|
176
|
+
"cloudwatch:PutMetricAlarm",
|
|
177
|
+
"cloudwatch:DeleteAlarms",
|
|
178
|
+
"cloudwatch:DescribeAlarms",
|
|
179
|
+
"logs:CreateLogGroup",
|
|
180
|
+
"logs:CreateLogStream",
|
|
181
|
+
"logs:DeleteLogGroup",
|
|
182
|
+
"logs:DescribeLogGroups",
|
|
183
|
+
"logs:DescribeLogStreams",
|
|
184
|
+
"logs:FilterLogEvents",
|
|
185
|
+
"logs:PutLogEvents",
|
|
186
|
+
"logs:PutRetentionPolicy"
|
|
187
|
+
],
|
|
188
|
+
"Resource": [
|
|
189
|
+
"arn:aws:logs:*:*:log-group:/aws/lambda/*frigg*",
|
|
190
|
+
"arn:aws:logs:*:*:log-group:/aws/lambda/*frigg*:*",
|
|
191
|
+
"arn:aws:cloudwatch:*:*:alarm:*frigg*"
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"Sid": "FriggAPIGateway",
|
|
196
|
+
"Effect": "Allow",
|
|
197
|
+
"Action": [
|
|
198
|
+
"apigateway:POST",
|
|
199
|
+
"apigateway:PUT",
|
|
200
|
+
"apigateway:DELETE",
|
|
201
|
+
"apigateway:GET",
|
|
202
|
+
"apigateway:PATCH"
|
|
203
|
+
],
|
|
204
|
+
"Resource": [
|
|
205
|
+
"arn:aws:apigateway:*::/restapis",
|
|
206
|
+
"arn:aws:apigateway:*::/restapis/*",
|
|
207
|
+
"arn:aws:apigateway:*::/domainnames",
|
|
208
|
+
"arn:aws:apigateway:*::/domainnames/*"
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"Sid": "FriggVPCDeploymentPermissions",
|
|
213
|
+
"Effect": "Allow",
|
|
214
|
+
"Action": [
|
|
215
|
+
"ec2:CreateVpcEndpoint",
|
|
216
|
+
"ec2:DeleteVpcEndpoint",
|
|
217
|
+
"ec2:DescribeVpcEndpoints",
|
|
218
|
+
"ec2:ModifyVpcEndpoint",
|
|
219
|
+
"ec2:CreateNatGateway",
|
|
220
|
+
"ec2:DeleteNatGateway",
|
|
221
|
+
"ec2:DescribeNatGateways",
|
|
222
|
+
"ec2:AllocateAddress",
|
|
223
|
+
"ec2:ReleaseAddress",
|
|
224
|
+
"ec2:DescribeAddresses",
|
|
225
|
+
"ec2:CreateRouteTable",
|
|
226
|
+
"ec2:DeleteRouteTable",
|
|
227
|
+
"ec2:DescribeRouteTables",
|
|
228
|
+
"ec2:CreateRoute",
|
|
229
|
+
"ec2:DeleteRoute",
|
|
230
|
+
"ec2:AssociateRouteTable",
|
|
231
|
+
"ec2:DisassociateRouteTable",
|
|
232
|
+
"ec2:CreateSecurityGroup",
|
|
233
|
+
"ec2:DeleteSecurityGroup",
|
|
234
|
+
"ec2:AuthorizeSecurityGroupEgress",
|
|
235
|
+
"ec2:AuthorizeSecurityGroupIngress",
|
|
236
|
+
"ec2:RevokeSecurityGroupEgress",
|
|
237
|
+
"ec2:RevokeSecurityGroupIngress",
|
|
238
|
+
"ec2:CreateTags",
|
|
239
|
+
"ec2:DeleteTags",
|
|
240
|
+
"ec2:DescribeTags"
|
|
241
|
+
],
|
|
242
|
+
"Resource": "*",
|
|
243
|
+
"Condition": {
|
|
244
|
+
"StringLike": {
|
|
245
|
+
"aws:RequestTag/Name": "*frigg*"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"Sid": "FriggKMSEncryptionPermissions",
|
|
251
|
+
"Effect": "Allow",
|
|
252
|
+
"Action": [
|
|
253
|
+
"kms:GenerateDataKey",
|
|
254
|
+
"kms:Decrypt"
|
|
255
|
+
],
|
|
256
|
+
"Resource": [
|
|
257
|
+
"arn:aws:kms:*:*:key/*"
|
|
258
|
+
],
|
|
259
|
+
"Condition": {
|
|
260
|
+
"StringEquals": {
|
|
261
|
+
"kms:ViaService": [
|
|
262
|
+
"lambda.*.amazonaws.com",
|
|
263
|
+
"s3.*.amazonaws.com"
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"Sid": "FriggSSMParameterAccess",
|
|
270
|
+
"Effect": "Allow",
|
|
271
|
+
"Action": [
|
|
272
|
+
"ssm:GetParameter",
|
|
273
|
+
"ssm:GetParameters",
|
|
274
|
+
"ssm:GetParametersByPath"
|
|
275
|
+
],
|
|
276
|
+
"Resource": [
|
|
277
|
+
"arn:aws:ssm:*:*:parameter/*frigg*",
|
|
278
|
+
"arn:aws:ssm:*:*:parameter/*frigg*/*"
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
]
|
|
282
|
+
}
|