@friggframework/devtools 2.0.0--canary.461.7c8f1c6.0 → 2.0.0--canary.461.4c872e7.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.
|
@@ -62,6 +62,8 @@ class MigrationBuilder extends InfrastructureBuilder {
|
|
|
62
62
|
// Create S3 bucket for migration status tracking
|
|
63
63
|
result.resources.FriggMigrationStatusBucket = {
|
|
64
64
|
Type: 'AWS::S3::Bucket',
|
|
65
|
+
DeletionPolicy: 'Retain', // Protect migration history during stack rollbacks/deletions
|
|
66
|
+
UpdateReplacePolicy: 'Retain', // Protect during stack updates that require replacement
|
|
65
67
|
Properties: {
|
|
66
68
|
BucketName: '${self:service}-${self:provider.stage}-migration-status',
|
|
67
69
|
VersioningConfiguration: {
|
|
@@ -318,6 +320,8 @@ class MigrationBuilder extends InfrastructureBuilder {
|
|
|
318
320
|
// Add IAM permissions for S3 (migration status storage)
|
|
319
321
|
// Migration functions need to read/write migration status in S3
|
|
320
322
|
// to avoid chicken-and-egg dependency on User/Process tables
|
|
323
|
+
|
|
324
|
+
// Object-level permissions (put, get, delete)
|
|
321
325
|
result.iamStatements.push({
|
|
322
326
|
Effect: 'Allow',
|
|
323
327
|
Action: [
|
|
@@ -336,6 +340,13 @@ class MigrationBuilder extends InfrastructureBuilder {
|
|
|
336
340
|
},
|
|
337
341
|
});
|
|
338
342
|
|
|
343
|
+
// Bucket-level permissions (list objects, needed to check if migration status exists)
|
|
344
|
+
result.iamStatements.push({
|
|
345
|
+
Effect: 'Allow',
|
|
346
|
+
Action: ['s3:ListBucket'],
|
|
347
|
+
Resource: { 'Fn::GetAtt': ['FriggMigrationStatusBucket', 'Arn'] },
|
|
348
|
+
});
|
|
349
|
+
|
|
339
350
|
console.log(' ✓ Added S3 IAM permissions for migration status tracking');
|
|
340
351
|
|
|
341
352
|
console.log(`[${this.name}] ✅ Migration infrastructure configuration completed`);
|
|
@@ -246,6 +246,42 @@ describe('MigrationBuilder', () => {
|
|
|
246
246
|
});
|
|
247
247
|
});
|
|
248
248
|
|
|
249
|
+
it('should add S3 IAM permissions including ListBucket', async () => {
|
|
250
|
+
const appDef = {
|
|
251
|
+
database: {
|
|
252
|
+
postgres: {
|
|
253
|
+
enable: true,
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
const result = await builder.build(appDef, {});
|
|
259
|
+
|
|
260
|
+
// Should have object-level permissions
|
|
261
|
+
expect(result.iamStatements).toContainEqual(
|
|
262
|
+
expect.objectContaining({
|
|
263
|
+
Effect: 'Allow',
|
|
264
|
+
Action: expect.arrayContaining([
|
|
265
|
+
's3:PutObject',
|
|
266
|
+
's3:GetObject',
|
|
267
|
+
's3:DeleteObject',
|
|
268
|
+
]),
|
|
269
|
+
Resource: expect.objectContaining({
|
|
270
|
+
'Fn::Join': expect.anything(),
|
|
271
|
+
}),
|
|
272
|
+
})
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
// Should have bucket-level ListBucket permission (needed to check if objects exist)
|
|
276
|
+
expect(result.iamStatements).toContainEqual(
|
|
277
|
+
expect.objectContaining({
|
|
278
|
+
Effect: 'Allow',
|
|
279
|
+
Action: ['s3:ListBucket'],
|
|
280
|
+
Resource: { 'Fn::GetAtt': ['FriggMigrationStatusBucket', 'Arn'] },
|
|
281
|
+
})
|
|
282
|
+
);
|
|
283
|
+
});
|
|
284
|
+
|
|
249
285
|
it('should only include Prisma layer in worker (router doesn\'t need database)', async () => {
|
|
250
286
|
const appDef = {
|
|
251
287
|
database: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/devtools",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.461.
|
|
4
|
+
"version": "2.0.0--canary.461.4c872e7.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-ec2": "^3.835.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.835.0",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"@babel/eslint-parser": "^7.18.9",
|
|
12
12
|
"@babel/parser": "^7.25.3",
|
|
13
13
|
"@babel/traverse": "^7.25.3",
|
|
14
|
-
"@friggframework/schemas": "2.0.0--canary.461.
|
|
15
|
-
"@friggframework/test": "2.0.0--canary.461.
|
|
14
|
+
"@friggframework/schemas": "2.0.0--canary.461.4c872e7.0",
|
|
15
|
+
"@friggframework/test": "2.0.0--canary.461.4c872e7.0",
|
|
16
16
|
"@hapi/boom": "^10.0.1",
|
|
17
17
|
"@inquirer/prompts": "^5.3.8",
|
|
18
18
|
"axios": "^1.7.2",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"serverless-http": "^2.7.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@friggframework/eslint-config": "2.0.0--canary.461.
|
|
38
|
-
"@friggframework/prettier-config": "2.0.0--canary.461.
|
|
37
|
+
"@friggframework/eslint-config": "2.0.0--canary.461.4c872e7.0",
|
|
38
|
+
"@friggframework/prettier-config": "2.0.0--canary.461.4c872e7.0",
|
|
39
39
|
"aws-sdk-client-mock": "^4.1.0",
|
|
40
40
|
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
41
41
|
"jest": "^30.1.3",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "4c872e770d1fddbd8689bf5ec2e26b6d21ae1d2f"
|
|
74
74
|
}
|