@friggframework/devtools 2.0.0-next.28 → 2.0.0-next.29

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 (34) hide show
  1. package/frigg-cli/build-command/index.js +4 -2
  2. package/frigg-cli/deploy-command/index.js +5 -2
  3. package/frigg-cli/generate-iam-command.js +115 -0
  4. package/frigg-cli/index.js +11 -1
  5. package/infrastructure/AWS-DISCOVERY-TROUBLESHOOTING.md +245 -0
  6. package/infrastructure/AWS-IAM-CREDENTIAL-NEEDS.md +596 -0
  7. package/infrastructure/DEPLOYMENT-INSTRUCTIONS.md +268 -0
  8. package/infrastructure/GENERATE-IAM-DOCS.md +253 -0
  9. package/infrastructure/IAM-POLICY-TEMPLATES.md +176 -0
  10. package/infrastructure/README-TESTING.md +332 -0
  11. package/infrastructure/README.md +421 -0
  12. package/infrastructure/WEBSOCKET-CONFIGURATION.md +105 -0
  13. package/infrastructure/__tests__/fixtures/mock-aws-resources.js +391 -0
  14. package/infrastructure/__tests__/helpers/test-utils.js +277 -0
  15. package/infrastructure/aws-discovery.js +568 -0
  16. package/infrastructure/aws-discovery.test.js +373 -0
  17. package/infrastructure/build-time-discovery.js +206 -0
  18. package/infrastructure/build-time-discovery.test.js +375 -0
  19. package/infrastructure/create-frigg-infrastructure.js +2 -2
  20. package/infrastructure/frigg-deployment-iam-stack.yaml +379 -0
  21. package/infrastructure/iam-generator.js +687 -0
  22. package/infrastructure/iam-generator.test.js +169 -0
  23. package/infrastructure/iam-policy-basic.json +212 -0
  24. package/infrastructure/iam-policy-full.json +282 -0
  25. package/infrastructure/integration.test.js +383 -0
  26. package/infrastructure/run-discovery.js +110 -0
  27. package/infrastructure/serverless-template.js +514 -167
  28. package/infrastructure/serverless-template.test.js +541 -0
  29. package/management-ui/dist/assets/FriggLogo-B7Xx8ZW1.svg +1 -0
  30. package/management-ui/dist/assets/index-BA21WgFa.js +1221 -0
  31. package/management-ui/dist/assets/index-CbM64Oba.js +1221 -0
  32. package/management-ui/dist/assets/index-CkvseXTC.css +1 -0
  33. package/management-ui/dist/index.html +14 -0
  34. package/package.json +9 -5
@@ -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
+ }