@friggframework/devtools 2.0.0--canary.414.e55499d.0 → 2.0.0--canary.414.70cdf1e.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.
@@ -49,13 +49,19 @@ async function deployCommand(options) {
49
49
  );
50
50
  }
51
51
 
52
- // Pass essential system variables + app-defined environment variables
52
+ // Pass essential system variables + AWS credentials + app-defined environment variables
53
53
  integrationEnvironmentVariables = {
54
54
  // Essential system variables needed to run serverless
55
55
  PATH: process.env.PATH,
56
56
  HOME: process.env.HOME,
57
57
  USER: process.env.USER,
58
58
 
59
+ // AWS credentials and configuration (all AWS_ prefixed variables)
60
+ ...Object.fromEntries(
61
+ Object.entries(process.env)
62
+ .filter(([key]) => key.startsWith('AWS_'))
63
+ ),
64
+
59
65
  // App-defined environment variables
60
66
  ...Object.fromEntries(
61
67
  envVars
@@ -80,13 +86,19 @@ async function deployCommand(options) {
80
86
  );
81
87
  }
82
88
 
83
- // Pass essential system variables + app-defined environment variables
89
+ // Pass essential system variables + AWS credentials + app-defined environment variables
84
90
  integrationEnvironmentVariables = {
85
91
  // Essential system variables needed to run serverless
86
92
  PATH: process.env.PATH,
87
93
  HOME: process.env.HOME,
88
94
  USER: process.env.USER,
89
95
 
96
+ // AWS credentials and configuration (all AWS_ prefixed variables)
97
+ ...Object.fromEntries(
98
+ Object.entries(process.env)
99
+ .filter(([key]) => key.startsWith('AWS_'))
100
+ ),
101
+
90
102
  // App-defined environment variables
91
103
  ...Object.fromEntries(
92
104
  envVars
@@ -107,6 +119,8 @@ async function deployCommand(options) {
107
119
 
108
120
  // AWS discovery is now handled directly in serverless-template.js
109
121
  console.log('🚀 Deploying serverless application...');
122
+ console.log('📋 Final environment variables being passed to serverless:');
123
+ console.log(' ', Object.keys(integrationEnvironmentVariables).sort().join(', '));
110
124
  const backendPath = path.resolve(process.cwd());
111
125
  const infrastructurePath = 'infrastructure.js';
112
126
  const command = 'serverless';
@@ -21,20 +21,47 @@ const shouldRunDiscovery = (AppDefinition) => {
21
21
  const getAppEnvironmentVars = (AppDefinition) => {
22
22
  const envVars = {};
23
23
 
24
+ // AWS Lambda reserved environment variables that cannot be set (from official AWS docs)
25
+ const reservedVars = new Set([
26
+ '_HANDLER',
27
+ '_X_AMZN_TRACE_ID',
28
+ 'AWS_DEFAULT_REGION',
29
+ 'AWS_EXECUTION_ENV',
30
+ 'AWS_REGION',
31
+ 'AWS_LAMBDA_FUNCTION_NAME',
32
+ 'AWS_LAMBDA_FUNCTION_MEMORY_SIZE',
33
+ 'AWS_LAMBDA_FUNCTION_VERSION',
34
+ 'AWS_LAMBDA_INITIALIZATION_TYPE',
35
+ 'AWS_LAMBDA_LOG_GROUP_NAME',
36
+ 'AWS_LAMBDA_LOG_STREAM_NAME',
37
+ 'AWS_ACCESS_KEY',
38
+ 'AWS_ACCESS_KEY_ID',
39
+ 'AWS_SECRET_ACCESS_KEY',
40
+ 'AWS_SESSION_TOKEN'
41
+ ]);
42
+
24
43
  if (AppDefinition.environment) {
25
44
  console.log('📋 Loading environment variables from appDefinition...');
26
45
  const envKeys = [];
46
+ const skippedKeys = [];
27
47
 
28
48
  for (const [key, value] of Object.entries(AppDefinition.environment)) {
29
49
  if (value === true) {
30
- envVars[key] = `\${env:${key}, ''}`;
31
- envKeys.push(key);
50
+ if (reservedVars.has(key)) {
51
+ skippedKeys.push(key);
52
+ } else {
53
+ envVars[key] = `\${env:${key}, ''}`;
54
+ envKeys.push(key);
55
+ }
32
56
  }
33
57
  }
34
58
 
35
59
  if (envKeys.length > 0) {
36
60
  console.log(` Found ${envKeys.length} environment variables: ${envKeys.join(', ')}`);
37
61
  }
62
+ if (skippedKeys.length > 0) {
63
+ console.log(` ⚠️ Skipped ${skippedKeys.length} reserved AWS Lambda variables: ${skippedKeys.join(', ')}`);
64
+ }
38
65
  }
39
66
 
40
67
  return envVars;
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.414.e55499d.0",
4
+ "version": "2.0.0--canary.414.70cdf1e.0",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-ec2": "^3.835.0",
7
7
  "@aws-sdk/client-kms": "^3.835.0",
@@ -9,8 +9,8 @@
9
9
  "@babel/eslint-parser": "^7.18.9",
10
10
  "@babel/parser": "^7.25.3",
11
11
  "@babel/traverse": "^7.25.3",
12
- "@friggframework/schemas": "2.0.0--canary.414.e55499d.0",
13
- "@friggframework/test": "2.0.0--canary.414.e55499d.0",
12
+ "@friggframework/schemas": "2.0.0--canary.414.70cdf1e.0",
13
+ "@friggframework/test": "2.0.0--canary.414.70cdf1e.0",
14
14
  "@hapi/boom": "^10.0.1",
15
15
  "@inquirer/prompts": "^5.3.8",
16
16
  "axios": "^1.7.2",
@@ -32,8 +32,8 @@
32
32
  "serverless-http": "^2.7.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@friggframework/eslint-config": "2.0.0--canary.414.e55499d.0",
36
- "@friggframework/prettier-config": "2.0.0--canary.414.e55499d.0",
35
+ "@friggframework/eslint-config": "2.0.0--canary.414.70cdf1e.0",
36
+ "@friggframework/prettier-config": "2.0.0--canary.414.70cdf1e.0",
37
37
  "prettier": "^2.7.1",
38
38
  "serverless": "3.39.0",
39
39
  "serverless-dotenv-plugin": "^6.0.0",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "e55499d6104d712aff851c67611367f89784daff"
68
+ "gitHead": "70cdf1e0a8efa2fd64dd87b5285323820d455b80"
69
69
  }