@friggframework/devtools 2.0.0--canary.461.ab0a628.0 → 2.0.0--canary.461.630a739.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.
|
@@ -59,6 +59,38 @@ class MigrationBuilder extends InfrastructureBuilder {
|
|
|
59
59
|
environment: {},
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
+
// Create S3 bucket for migration status tracking
|
|
63
|
+
result.resources.FriggMigrationStatusBucket = {
|
|
64
|
+
Type: 'AWS::S3::Bucket',
|
|
65
|
+
Properties: {
|
|
66
|
+
BucketName: '${self:service}-${self:provider.stage}-migration-status',
|
|
67
|
+
VersioningConfiguration: {
|
|
68
|
+
Status: 'Enabled', // Enable versioning for audit trail
|
|
69
|
+
},
|
|
70
|
+
LifecycleConfiguration: {
|
|
71
|
+
Rules: [
|
|
72
|
+
{
|
|
73
|
+
Id: 'DeleteOldMigrations',
|
|
74
|
+
Status: 'Enabled',
|
|
75
|
+
ExpirationInDays: 90, // Keep migration history for 90 days
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
PublicAccessBlockConfiguration: {
|
|
80
|
+
BlockPublicAcls: true,
|
|
81
|
+
BlockPublicPolicy: true,
|
|
82
|
+
IgnorePublicAcls: true,
|
|
83
|
+
RestrictPublicBuckets: true,
|
|
84
|
+
},
|
|
85
|
+
Tags: [
|
|
86
|
+
{ Key: 'ManagedBy', Value: 'Frigg' },
|
|
87
|
+
{ Key: 'Purpose', Value: 'MigrationStatusTracking' },
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
console.log(' ✓ Created FriggMigrationStatusBucket resource');
|
|
93
|
+
|
|
62
94
|
// Create SQS queue for migration jobs
|
|
63
95
|
result.resources.DbMigrationQueue = {
|
|
64
96
|
Type: 'AWS::SQS::Queue',
|
|
@@ -108,10 +140,9 @@ class MigrationBuilder extends InfrastructureBuilder {
|
|
|
108
140
|
'**/libquery_engine-darwin*',
|
|
109
141
|
'**/*-darwin-arm64*',
|
|
110
142
|
'**/*-darwin*',
|
|
111
|
-
//
|
|
112
|
-
// Only
|
|
143
|
+
// Note: Migration worker DOES need Prisma CLI WASM files (for migrate deploy)
|
|
144
|
+
// Only exclude runtime engine WASM (query engine internals)
|
|
113
145
|
'**/runtime/*.wasm',
|
|
114
|
-
'**/*.wasm*',
|
|
115
146
|
'src/**',
|
|
116
147
|
'test/**',
|
|
117
148
|
'layers/**',
|
|
@@ -176,6 +207,10 @@ class MigrationBuilder extends InfrastructureBuilder {
|
|
|
176
207
|
|
|
177
208
|
console.log(' ✓ Created dbMigrationRouter function');
|
|
178
209
|
|
|
210
|
+
// Add S3 bucket name to environment (for migration status tracking)
|
|
211
|
+
result.environment.S3_BUCKET_NAME = { Ref: 'FriggMigrationStatusBucket' };
|
|
212
|
+
result.environment.MIGRATION_STATUS_BUCKET = { Ref: 'FriggMigrationStatusBucket' };
|
|
213
|
+
|
|
179
214
|
// Add queue URL to environment
|
|
180
215
|
result.environment.DB_MIGRATION_QUEUE_URL = { Ref: 'DbMigrationQueue' };
|
|
181
216
|
|
|
@@ -183,7 +218,7 @@ class MigrationBuilder extends InfrastructureBuilder {
|
|
|
183
218
|
// Avoids Prisma needing to load app definition to determine database type
|
|
184
219
|
result.environment.DB_TYPE = 'postgresql';
|
|
185
220
|
|
|
186
|
-
console.log(' ✓ Added DB_MIGRATION_QUEUE_URL and DB_TYPE environment variables');
|
|
221
|
+
console.log(' ✓ Added S3_BUCKET_NAME, DB_MIGRATION_QUEUE_URL, and DB_TYPE environment variables');
|
|
187
222
|
|
|
188
223
|
// Add IAM permissions for SQS
|
|
189
224
|
result.iamStatements.push({
|
|
@@ -201,7 +236,6 @@ class MigrationBuilder extends InfrastructureBuilder {
|
|
|
201
236
|
// Add IAM permissions for S3 (migration status storage)
|
|
202
237
|
// Migration functions need to read/write migration status in S3
|
|
203
238
|
// to avoid chicken-and-egg dependency on User/Process tables
|
|
204
|
-
// Note: Uses wildcard for bucket as S3_BUCKET_NAME is set at runtime via environment
|
|
205
239
|
result.iamStatements.push({
|
|
206
240
|
Effect: 'Allow',
|
|
207
241
|
Action: [
|
|
@@ -209,7 +243,15 @@ class MigrationBuilder extends InfrastructureBuilder {
|
|
|
209
243
|
's3:GetObject',
|
|
210
244
|
's3:DeleteObject',
|
|
211
245
|
],
|
|
212
|
-
Resource:
|
|
246
|
+
Resource: {
|
|
247
|
+
'Fn::Join': [
|
|
248
|
+
'',
|
|
249
|
+
[
|
|
250
|
+
{ 'Fn::GetAtt': ['FriggMigrationStatusBucket', 'Arn'] },
|
|
251
|
+
'/migrations/*',
|
|
252
|
+
],
|
|
253
|
+
],
|
|
254
|
+
},
|
|
213
255
|
});
|
|
214
256
|
|
|
215
257
|
console.log(' ✓ Added S3 IAM permissions for migration status tracking');
|
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.630a739.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.630a739.0",
|
|
15
|
+
"@friggframework/test": "2.0.0--canary.461.630a739.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.630a739.0",
|
|
38
|
+
"@friggframework/prettier-config": "2.0.0--canary.461.630a739.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": "630a73931d2634f7e732ab37c28d762c89213822"
|
|
74
74
|
}
|