@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,379 @@
|
|
|
1
|
+
AWSTemplateFormatVersion: '2010-09-09'
|
|
2
|
+
Description: 'IAM roles and policies for Frigg application deployment pipeline'
|
|
3
|
+
|
|
4
|
+
Parameters:
|
|
5
|
+
DeploymentUserName:
|
|
6
|
+
Type: String
|
|
7
|
+
Default: 'frigg-deployment-user'
|
|
8
|
+
Description: 'Name for the IAM user that will deploy Frigg applications'
|
|
9
|
+
|
|
10
|
+
EnableVPCSupport:
|
|
11
|
+
Type: String
|
|
12
|
+
Default: 'true'
|
|
13
|
+
AllowedValues: ['true', 'false']
|
|
14
|
+
Description: 'Enable VPC-related permissions for Frigg applications'
|
|
15
|
+
|
|
16
|
+
EnableKMSSupport:
|
|
17
|
+
Type: String
|
|
18
|
+
Default: 'true'
|
|
19
|
+
AllowedValues: ['true', 'false']
|
|
20
|
+
Description: 'Enable KMS encryption permissions for Frigg applications'
|
|
21
|
+
|
|
22
|
+
EnableSSMSupport:
|
|
23
|
+
Type: String
|
|
24
|
+
Default: 'true'
|
|
25
|
+
AllowedValues: ['true', 'false']
|
|
26
|
+
Description: 'Enable SSM Parameter Store permissions for Frigg applications'
|
|
27
|
+
|
|
28
|
+
Conditions:
|
|
29
|
+
CreateVPCPermissions: !Equals [!Ref EnableVPCSupport, 'true']
|
|
30
|
+
CreateKMSPermissions: !Equals [!Ref EnableKMSSupport, 'true']
|
|
31
|
+
CreateSSMPermissions: !Equals [!Ref EnableSSMSupport, 'true']
|
|
32
|
+
|
|
33
|
+
Resources:
|
|
34
|
+
# IAM User for deployment
|
|
35
|
+
FriggDeploymentUser:
|
|
36
|
+
Type: AWS::IAM::User
|
|
37
|
+
Properties:
|
|
38
|
+
UserName: !Ref DeploymentUserName
|
|
39
|
+
ManagedPolicyArns:
|
|
40
|
+
- !Ref FriggDiscoveryPolicy
|
|
41
|
+
- !Ref FriggCoreDeploymentPolicy
|
|
42
|
+
- !If [CreateVPCPermissions, !Ref FriggVPCPolicy, !Ref 'AWS::NoValue']
|
|
43
|
+
- !If [CreateKMSPermissions, !Ref FriggKMSPolicy, !Ref 'AWS::NoValue']
|
|
44
|
+
- !If [CreateSSMPermissions, !Ref FriggSSMPolicy, !Ref 'AWS::NoValue']
|
|
45
|
+
|
|
46
|
+
# Access key for the deployment user
|
|
47
|
+
FriggDeploymentAccessKey:
|
|
48
|
+
Type: AWS::IAM::AccessKey
|
|
49
|
+
Properties:
|
|
50
|
+
UserName: !Ref FriggDeploymentUser
|
|
51
|
+
|
|
52
|
+
# Discovery-time permissions (required for build process)
|
|
53
|
+
FriggDiscoveryPolicy:
|
|
54
|
+
Type: AWS::IAM::ManagedPolicy
|
|
55
|
+
Properties:
|
|
56
|
+
ManagedPolicyName: 'FriggDiscoveryPolicy'
|
|
57
|
+
Description: 'Permissions for AWS resource discovery during Frigg build process'
|
|
58
|
+
PolicyDocument:
|
|
59
|
+
Version: '2012-10-17'
|
|
60
|
+
Statement:
|
|
61
|
+
- Sid: 'AWSDiscoveryPermissions'
|
|
62
|
+
Effect: Allow
|
|
63
|
+
Action:
|
|
64
|
+
- 'sts:GetCallerIdentity'
|
|
65
|
+
- 'ec2:DescribeVpcs'
|
|
66
|
+
- 'ec2:DescribeSubnets'
|
|
67
|
+
- 'ec2:DescribeSecurityGroups'
|
|
68
|
+
- 'ec2:DescribeRouteTables'
|
|
69
|
+
- 'kms:ListKeys'
|
|
70
|
+
- 'kms:DescribeKey'
|
|
71
|
+
Resource: '*'
|
|
72
|
+
|
|
73
|
+
# Core deployment permissions
|
|
74
|
+
FriggCoreDeploymentPolicy:
|
|
75
|
+
Type: AWS::IAM::ManagedPolicy
|
|
76
|
+
Properties:
|
|
77
|
+
ManagedPolicyName: 'FriggCoreDeploymentPolicy'
|
|
78
|
+
Description: 'Core permissions for deploying Frigg applications'
|
|
79
|
+
PolicyDocument:
|
|
80
|
+
Version: '2012-10-17'
|
|
81
|
+
Statement:
|
|
82
|
+
# CloudFormation permissions
|
|
83
|
+
- Sid: 'CloudFormationFriggStacks'
|
|
84
|
+
Effect: Allow
|
|
85
|
+
Action:
|
|
86
|
+
- 'cloudformation:CreateStack'
|
|
87
|
+
- 'cloudformation:UpdateStack'
|
|
88
|
+
- 'cloudformation:DeleteStack'
|
|
89
|
+
- 'cloudformation:DescribeStacks'
|
|
90
|
+
- 'cloudformation:DescribeStackEvents'
|
|
91
|
+
- 'cloudformation:DescribeStackResources'
|
|
92
|
+
- 'cloudformation:DescribeStackResource'
|
|
93
|
+
- 'cloudformation:ListStackResources'
|
|
94
|
+
- 'cloudformation:GetTemplate'
|
|
95
|
+
- 'cloudformation:DescribeChangeSet'
|
|
96
|
+
- 'cloudformation:CreateChangeSet'
|
|
97
|
+
- 'cloudformation:DeleteChangeSet'
|
|
98
|
+
- 'cloudformation:ExecuteChangeSet'
|
|
99
|
+
Resource:
|
|
100
|
+
- !Sub 'arn:aws:cloudformation:*:${AWS::AccountId}:stack/*frigg*/*'
|
|
101
|
+
|
|
102
|
+
# ValidateTemplate needs to be allowed on all resources
|
|
103
|
+
- Sid: 'CloudFormationValidateTemplate'
|
|
104
|
+
Effect: Allow
|
|
105
|
+
Action:
|
|
106
|
+
- 'cloudformation:ValidateTemplate'
|
|
107
|
+
Resource: '*'
|
|
108
|
+
|
|
109
|
+
# S3 deployment bucket permissions
|
|
110
|
+
- Sid: 'S3DeploymentBucket'
|
|
111
|
+
Effect: Allow
|
|
112
|
+
Action:
|
|
113
|
+
- 's3:CreateBucket'
|
|
114
|
+
- 's3:PutObject'
|
|
115
|
+
- 's3:GetObject'
|
|
116
|
+
- 's3:DeleteObject'
|
|
117
|
+
- 's3:PutBucketPolicy'
|
|
118
|
+
- 's3:PutBucketVersioning'
|
|
119
|
+
- 's3:PutBucketPublicAccessBlock'
|
|
120
|
+
- 's3:GetBucketLocation'
|
|
121
|
+
- 's3:ListBucket'
|
|
122
|
+
- 's3:PutBucketTagging'
|
|
123
|
+
- 's3:GetBucketTagging'
|
|
124
|
+
Resource:
|
|
125
|
+
- 'arn:aws:s3:::*serverless*'
|
|
126
|
+
- 'arn:aws:s3:::*serverless*/*'
|
|
127
|
+
|
|
128
|
+
# Lambda function permissions
|
|
129
|
+
- Sid: 'LambdaFriggFunctions'
|
|
130
|
+
Effect: Allow
|
|
131
|
+
Action:
|
|
132
|
+
- 'lambda:CreateFunction'
|
|
133
|
+
- 'lambda:UpdateFunctionCode'
|
|
134
|
+
- 'lambda:UpdateFunctionConfiguration'
|
|
135
|
+
- 'lambda:DeleteFunction'
|
|
136
|
+
- 'lambda:GetFunction'
|
|
137
|
+
- 'lambda:ListFunctions'
|
|
138
|
+
- 'lambda:PublishVersion'
|
|
139
|
+
- 'lambda:CreateAlias'
|
|
140
|
+
- 'lambda:UpdateAlias'
|
|
141
|
+
- 'lambda:DeleteAlias'
|
|
142
|
+
- 'lambda:GetAlias'
|
|
143
|
+
- 'lambda:AddPermission'
|
|
144
|
+
- 'lambda:RemovePermission'
|
|
145
|
+
- 'lambda:GetPolicy'
|
|
146
|
+
- 'lambda:PutProvisionedConcurrencyConfig'
|
|
147
|
+
- 'lambda:DeleteProvisionedConcurrencyConfig'
|
|
148
|
+
- 'lambda:PutConcurrency'
|
|
149
|
+
- 'lambda:DeleteConcurrency'
|
|
150
|
+
- 'lambda:TagResource'
|
|
151
|
+
- 'lambda:UntagResource'
|
|
152
|
+
- 'lambda:ListVersionsByFunction'
|
|
153
|
+
Resource:
|
|
154
|
+
- !Sub 'arn:aws:lambda:*:${AWS::AccountId}:function:*frigg*'
|
|
155
|
+
|
|
156
|
+
# Lambda EventSourceMapping permissions
|
|
157
|
+
- Sid: 'FriggLambdaEventSourceMapping'
|
|
158
|
+
Effect: Allow
|
|
159
|
+
Action:
|
|
160
|
+
- 'lambda:CreateEventSourceMapping'
|
|
161
|
+
- 'lambda:DeleteEventSourceMapping'
|
|
162
|
+
- 'lambda:GetEventSourceMapping'
|
|
163
|
+
- 'lambda:UpdateEventSourceMapping'
|
|
164
|
+
- 'lambda:ListEventSourceMappings'
|
|
165
|
+
Resource:
|
|
166
|
+
- !Sub 'arn:aws:lambda:*:${AWS::AccountId}:event-source-mapping:*'
|
|
167
|
+
|
|
168
|
+
# IAM role permissions
|
|
169
|
+
- Sid: 'IAMRolesForFriggLambda'
|
|
170
|
+
Effect: Allow
|
|
171
|
+
Action:
|
|
172
|
+
- 'iam:CreateRole'
|
|
173
|
+
- 'iam:DeleteRole'
|
|
174
|
+
- 'iam:GetRole'
|
|
175
|
+
- 'iam:PassRole'
|
|
176
|
+
- 'iam:PutRolePolicy'
|
|
177
|
+
- 'iam:DeleteRolePolicy'
|
|
178
|
+
- 'iam:GetRolePolicy'
|
|
179
|
+
- 'iam:AttachRolePolicy'
|
|
180
|
+
- 'iam:DetachRolePolicy'
|
|
181
|
+
- 'iam:TagRole'
|
|
182
|
+
- 'iam:UntagRole'
|
|
183
|
+
Resource:
|
|
184
|
+
- !Sub 'arn:aws:iam::${AWS::AccountId}:role/*frigg*'
|
|
185
|
+
- !Sub 'arn:aws:iam::${AWS::AccountId}:role/*frigg*LambdaRole*'
|
|
186
|
+
|
|
187
|
+
# IAM policy permissions
|
|
188
|
+
- Sid: 'IAMPolicyVersionPermissions'
|
|
189
|
+
Effect: Allow
|
|
190
|
+
Action:
|
|
191
|
+
- 'iam:ListPolicyVersions'
|
|
192
|
+
Resource:
|
|
193
|
+
- !Sub 'arn:aws:iam::${AWS::AccountId}:policy/*'
|
|
194
|
+
|
|
195
|
+
# SQS permissions
|
|
196
|
+
- Sid: 'FriggMessagingServices'
|
|
197
|
+
Effect: Allow
|
|
198
|
+
Action:
|
|
199
|
+
- 'sqs:CreateQueue'
|
|
200
|
+
- 'sqs:DeleteQueue'
|
|
201
|
+
- 'sqs:GetQueueAttributes'
|
|
202
|
+
- 'sqs:SetQueueAttributes'
|
|
203
|
+
- 'sqs:GetQueueUrl'
|
|
204
|
+
- 'sqs:TagQueue'
|
|
205
|
+
- 'sqs:UntagQueue'
|
|
206
|
+
Resource:
|
|
207
|
+
- !Sub 'arn:aws:sqs:*:${AWS::AccountId}:*frigg*'
|
|
208
|
+
- !Sub 'arn:aws:sqs:*:${AWS::AccountId}:internal-error-queue-*'
|
|
209
|
+
|
|
210
|
+
# SNS permissions
|
|
211
|
+
- Sid: 'FriggSNSTopics'
|
|
212
|
+
Effect: Allow
|
|
213
|
+
Action:
|
|
214
|
+
- 'sns:CreateTopic'
|
|
215
|
+
- 'sns:DeleteTopic'
|
|
216
|
+
- 'sns:GetTopicAttributes'
|
|
217
|
+
- 'sns:SetTopicAttributes'
|
|
218
|
+
- 'sns:Subscribe'
|
|
219
|
+
- 'sns:Unsubscribe'
|
|
220
|
+
- 'sns:ListSubscriptionsByTopic'
|
|
221
|
+
- 'sns:TagResource'
|
|
222
|
+
- 'sns:UntagResource'
|
|
223
|
+
Resource:
|
|
224
|
+
- !Sub 'arn:aws:sns:*:${AWS::AccountId}:*frigg*'
|
|
225
|
+
|
|
226
|
+
# CloudWatch and Logs permissions
|
|
227
|
+
- Sid: 'FriggMonitoringAndLogs'
|
|
228
|
+
Effect: Allow
|
|
229
|
+
Action:
|
|
230
|
+
- 'cloudwatch:PutMetricAlarm'
|
|
231
|
+
- 'cloudwatch:DeleteAlarms'
|
|
232
|
+
- 'cloudwatch:DescribeAlarms'
|
|
233
|
+
- 'logs:CreateLogGroup'
|
|
234
|
+
- 'logs:CreateLogStream'
|
|
235
|
+
- 'logs:DeleteLogGroup'
|
|
236
|
+
- 'logs:DescribeLogGroups'
|
|
237
|
+
- 'logs:DescribeLogStreams'
|
|
238
|
+
- 'logs:FilterLogEvents'
|
|
239
|
+
- 'logs:PutLogEvents'
|
|
240
|
+
- 'logs:PutRetentionPolicy'
|
|
241
|
+
Resource:
|
|
242
|
+
- !Sub 'arn:aws:logs:*:${AWS::AccountId}:log-group:/aws/lambda/*frigg*'
|
|
243
|
+
- !Sub 'arn:aws:logs:*:${AWS::AccountId}:log-group:/aws/lambda/*frigg*:*'
|
|
244
|
+
- !Sub 'arn:aws:cloudwatch:*:${AWS::AccountId}:alarm:*frigg*'
|
|
245
|
+
|
|
246
|
+
# API Gateway permissions
|
|
247
|
+
- Sid: 'FriggAPIGateway'
|
|
248
|
+
Effect: Allow
|
|
249
|
+
Action:
|
|
250
|
+
- 'apigateway:POST'
|
|
251
|
+
- 'apigateway:PUT'
|
|
252
|
+
- 'apigateway:DELETE'
|
|
253
|
+
- 'apigateway:GET'
|
|
254
|
+
- 'apigateway:PATCH'
|
|
255
|
+
Resource:
|
|
256
|
+
- 'arn:aws:apigateway:*::/restapis'
|
|
257
|
+
- 'arn:aws:apigateway:*::/restapis/*'
|
|
258
|
+
- 'arn:aws:apigateway:*::/domainnames'
|
|
259
|
+
- 'arn:aws:apigateway:*::/domainnames/*'
|
|
260
|
+
|
|
261
|
+
# VPC-specific permissions
|
|
262
|
+
FriggVPCPolicy:
|
|
263
|
+
Type: AWS::IAM::ManagedPolicy
|
|
264
|
+
Condition: CreateVPCPermissions
|
|
265
|
+
Properties:
|
|
266
|
+
ManagedPolicyName: 'FriggVPCPolicy'
|
|
267
|
+
Description: 'VPC-related permissions for Frigg applications'
|
|
268
|
+
PolicyDocument:
|
|
269
|
+
Version: '2012-10-17'
|
|
270
|
+
Statement:
|
|
271
|
+
- Sid: 'FriggVPCEndpointManagement'
|
|
272
|
+
Effect: Allow
|
|
273
|
+
Action:
|
|
274
|
+
- 'ec2:CreateVpcEndpoint'
|
|
275
|
+
- 'ec2:DeleteVpcEndpoints'
|
|
276
|
+
- 'ec2:DescribeVpcEndpoints'
|
|
277
|
+
- 'ec2:ModifyVpcEndpoint'
|
|
278
|
+
- 'ec2:CreateNatGateway'
|
|
279
|
+
- 'ec2:DeleteNatGateway'
|
|
280
|
+
- 'ec2:DescribeNatGateways'
|
|
281
|
+
- 'ec2:AllocateAddress'
|
|
282
|
+
- 'ec2:ReleaseAddress'
|
|
283
|
+
- 'ec2:DescribeAddresses'
|
|
284
|
+
- 'ec2:CreateRouteTable'
|
|
285
|
+
- 'ec2:DeleteRouteTable'
|
|
286
|
+
- 'ec2:DescribeRouteTables'
|
|
287
|
+
- 'ec2:CreateRoute'
|
|
288
|
+
- 'ec2:DeleteRoute'
|
|
289
|
+
- 'ec2:AssociateRouteTable'
|
|
290
|
+
- 'ec2:DisassociateRouteTable'
|
|
291
|
+
- 'ec2:CreateSecurityGroup'
|
|
292
|
+
- 'ec2:DeleteSecurityGroup'
|
|
293
|
+
- 'ec2:AuthorizeSecurityGroupEgress'
|
|
294
|
+
- 'ec2:AuthorizeSecurityGroupIngress'
|
|
295
|
+
- 'ec2:RevokeSecurityGroupEgress'
|
|
296
|
+
- 'ec2:RevokeSecurityGroupIngress'
|
|
297
|
+
- 'ec2:CreateTags'
|
|
298
|
+
- 'ec2:DeleteTags'
|
|
299
|
+
- 'ec2:DescribeTags'
|
|
300
|
+
Resource: '*'
|
|
301
|
+
|
|
302
|
+
# KMS permissions
|
|
303
|
+
FriggKMSPolicy:
|
|
304
|
+
Type: AWS::IAM::ManagedPolicy
|
|
305
|
+
Condition: CreateKMSPermissions
|
|
306
|
+
Properties:
|
|
307
|
+
ManagedPolicyName: 'FriggKMSPolicy'
|
|
308
|
+
Description: 'KMS encryption permissions for Frigg applications'
|
|
309
|
+
PolicyDocument:
|
|
310
|
+
Version: '2012-10-17'
|
|
311
|
+
Statement:
|
|
312
|
+
- Sid: 'FriggKMSEncryptionRuntime'
|
|
313
|
+
Effect: Allow
|
|
314
|
+
Action:
|
|
315
|
+
- 'kms:GenerateDataKey'
|
|
316
|
+
- 'kms:Decrypt'
|
|
317
|
+
Resource:
|
|
318
|
+
- !Sub 'arn:aws:kms:*:${AWS::AccountId}:key/*'
|
|
319
|
+
Condition:
|
|
320
|
+
StringEquals:
|
|
321
|
+
'kms:ViaService':
|
|
322
|
+
- 'lambda.*.amazonaws.com'
|
|
323
|
+
- 's3.*.amazonaws.com'
|
|
324
|
+
|
|
325
|
+
# SSM Parameter Store permissions
|
|
326
|
+
FriggSSMPolicy:
|
|
327
|
+
Type: AWS::IAM::ManagedPolicy
|
|
328
|
+
Condition: CreateSSMPermissions
|
|
329
|
+
Properties:
|
|
330
|
+
ManagedPolicyName: 'FriggSSMPolicy'
|
|
331
|
+
Description: 'SSM Parameter Store permissions for Frigg applications'
|
|
332
|
+
PolicyDocument:
|
|
333
|
+
Version: '2012-10-17'
|
|
334
|
+
Statement:
|
|
335
|
+
- Sid: 'FriggSSMParameterAccess'
|
|
336
|
+
Effect: Allow
|
|
337
|
+
Action:
|
|
338
|
+
- 'ssm:GetParameter'
|
|
339
|
+
- 'ssm:GetParameters'
|
|
340
|
+
- 'ssm:GetParametersByPath'
|
|
341
|
+
Resource:
|
|
342
|
+
- !Sub 'arn:aws:ssm:*:${AWS::AccountId}:parameter/*frigg*'
|
|
343
|
+
- !Sub 'arn:aws:ssm:*:${AWS::AccountId}:parameter/*frigg*/*'
|
|
344
|
+
|
|
345
|
+
# Store access key in Secrets Manager
|
|
346
|
+
FriggDeploymentCredentials:
|
|
347
|
+
Type: AWS::SecretsManager::Secret
|
|
348
|
+
Properties:
|
|
349
|
+
Name: 'frigg-deployment-credentials'
|
|
350
|
+
Description: 'Access credentials for Frigg deployment user'
|
|
351
|
+
SecretString: !Sub |
|
|
352
|
+
{
|
|
353
|
+
"AccessKeyId": "${FriggDeploymentAccessKey}",
|
|
354
|
+
"SecretAccessKey": "${FriggDeploymentAccessKey.SecretAccessKey}"
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
Outputs:
|
|
358
|
+
DeploymentUserArn:
|
|
359
|
+
Description: 'ARN of the Frigg deployment user'
|
|
360
|
+
Value: !GetAtt FriggDeploymentUser.Arn
|
|
361
|
+
Export:
|
|
362
|
+
Name: !Sub '${AWS::StackName}-UserArn'
|
|
363
|
+
|
|
364
|
+
AccessKeyId:
|
|
365
|
+
Description: 'Access Key ID for the deployment user'
|
|
366
|
+
Value: !Ref FriggDeploymentAccessKey
|
|
367
|
+
Export:
|
|
368
|
+
Name: !Sub '${AWS::StackName}-AccessKeyId'
|
|
369
|
+
|
|
370
|
+
SecretAccessKeyCommand:
|
|
371
|
+
Description: 'Command to retrieve the secret access key'
|
|
372
|
+
Value: !Sub |
|
|
373
|
+
aws secretsmanager get-secret-value --secret-id frigg-deployment-credentials --query SecretString --output text | jq -r .SecretAccessKey
|
|
374
|
+
|
|
375
|
+
CredentialsSecretArn:
|
|
376
|
+
Description: 'ARN of the secret containing deployment credentials'
|
|
377
|
+
Value: !Ref FriggDeploymentCredentials
|
|
378
|
+
Export:
|
|
379
|
+
Name: !Sub '${AWS::StackName}-CredentialsSecretArn'
|