@friggframework/devtools 2.0.0--canary.461.5fd8136.0 → 2.0.0--canary.461.4860820.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.
@@ -470,31 +470,20 @@ exports.handler = async (event, context) => {
470
470
 
471
471
  console.log(' ✅ Using discovered Secrets Manager credentials');
472
472
  } else {
473
- // No secret and no auto-create - construct DATABASE_URL using environment variables at runtime
473
+ // No secret and no auto-create - set individual DB connection components
474
+ // The application will construct DATABASE_URL at runtime from these components + DATABASE_USER + DATABASE_PASSWORD
474
475
  const dbName = dbConfig.database || 'frigg';
475
476
 
476
- // Set individual environment variables for flexible credential management
477
477
  result.environment.DATABASE_HOST = discoveredResources.auroraClusterEndpoint;
478
478
  result.environment.DATABASE_PORT = String(discoveredResources.auroraPort || 5432);
479
479
  result.environment.DATABASE_NAME = dbName;
480
480
 
481
- // Build DATABASE_URL using CloudFormation intrinsic functions to reference
482
- // the environment variables at runtime (not build time)
483
- result.environment.DATABASE_URL = {
484
- 'Fn::Sub': [
485
- 'postgresql://${DatabaseUser}:${DatabasePassword}@${DatabaseHost}:${DatabasePort}/${DatabaseName}',
486
- {
487
- DatabaseUser: '${env:DATABASE_USER, "postgres"}',
488
- DatabasePassword: '${env:DATABASE_PASSWORD}',
489
- DatabaseHost: discoveredResources.auroraClusterEndpoint,
490
- DatabasePort: String(discoveredResources.auroraPort || 5432),
491
- DatabaseName: dbName,
492
- },
493
- ],
494
- };
481
+ // Note: DATABASE_URL is NOT set here to avoid Serverless variable resolution errors
482
+ // The application (Frigg Core) should construct it at runtime from:
483
+ // DATABASE_HOST, DATABASE_PORT, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD
495
484
 
496
- console.log(' ℹ️ No Secrets Manager secret found - DATABASE_URL will use DATABASE_USER and DATABASE_PASSWORD from environment');
497
- console.log(' ℹ️ Set DATABASE_USER and DATABASE_PASSWORD in Lambda environment or via serverless deploy --param');
485
+ console.log(' ℹ️ No Secrets Manager secret found - set DATABASE_USER and DATABASE_PASSWORD in Lambda environment');
486
+ console.log(' ℹ️ Application will construct DATABASE_URL at runtime from DATABASE_HOST, DATABASE_PORT, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD');
498
487
  console.log(' ℹ️ Or enable autoCreateCredentials=true to automatically create and rotate credentials');
499
488
  }
500
489
 
@@ -422,11 +422,17 @@ describe('AuroraBuilder', () => {
422
422
  expect(result.resources.FriggAuroraPasswordRotator).toBeUndefined();
423
423
  expect(result.resources.PasswordRotatorRole).toBeUndefined();
424
424
 
425
- // DATABASE_URL should use env variables
426
- expect(result.environment.DATABASE_URL).toBeDefined();
427
- expect(result.environment.DATABASE_URL['Fn::Sub']).toBeDefined();
428
- expect(result.environment.DATABASE_URL['Fn::Sub'][1].DatabaseUser).toContain('env:DATABASE_USER');
429
- expect(result.environment.DATABASE_URL['Fn::Sub'][1].DatabasePassword).toContain('env:DATABASE_PASSWORD');
425
+ // Should set individual environment variables for flexible credential management
426
+ expect(result.environment.DATABASE_HOST).toBe('cluster.abc.us-east-1.rds.amazonaws.com');
427
+ expect(result.environment.DATABASE_PORT).toBe('5432');
428
+ expect(result.environment.DATABASE_NAME).toBe('frigg');
429
+
430
+ // DATABASE_URL should NOT be set (to avoid Serverless variable resolution errors)
431
+ // The application should construct it at runtime from DATABASE_HOST, DATABASE_PORT, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD
432
+ expect(result.environment.DATABASE_URL).toBeUndefined();
433
+
434
+ // DATABASE_USER and DATABASE_PASSWORD should come from appDefinition.environment
435
+ // and will be set by the environment-builder, not here
430
436
  });
431
437
 
432
438
  it('should not create credentials when secret is already discovered', async () => {
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.5fd8136.0",
4
+ "version": "2.0.0--canary.461.4860820.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.5fd8136.0",
15
- "@friggframework/test": "2.0.0--canary.461.5fd8136.0",
14
+ "@friggframework/schemas": "2.0.0--canary.461.4860820.0",
15
+ "@friggframework/test": "2.0.0--canary.461.4860820.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.5fd8136.0",
38
- "@friggframework/prettier-config": "2.0.0--canary.461.5fd8136.0",
37
+ "@friggframework/eslint-config": "2.0.0--canary.461.4860820.0",
38
+ "@friggframework/prettier-config": "2.0.0--canary.461.4860820.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": "5fd8136c7179570f39ae5ebf4c6c195eb217caa5"
73
+ "gitHead": "486082018ba9bc219bf266048eb4c846bd9a45fb"
74
74
  }