@@ -2,8 +2,8 @@ let { join, basename, sep } = require('path')
2
2
let { existsSync } = require ( 'fs' )
3
3
4
4
/**
5
- * Initialize Lambdas with local environment variable settings
6
- * - e.g. if ARC_ENV=staging the Lambda env is populated by `@staging`, etc.
5
+ * Validate / print status of userland env vars
6
+ * e.g. if ARC_ENV=staging the Lambda env is populated by `@staging`, etc.
7
7
*/
8
8
module . exports = function validateUserEnv ( params , callback ) {
9
9
let { cwd, env : envOption , inventory, restart, update } = params
@@ -34,7 +34,7 @@ module.exports = function validateUserEnv (params, callback) {
34
34
// If useAWS is specified, force an AWS environment name
35
35
if ( prefs ?. sandbox ?. useAWS &&
36
36
! [ 'staging' , 'production' ] . includes ( process . env . ARC_ENV ) ) {
37
- process . env . ARC_ENV = 'staging'
37
+ process . env . ARC_ENV = environment = 'staging'
38
38
}
39
39
}
40
40
@@ -74,8 +74,10 @@ module.exports = function validateUserEnv (params, callback) {
74
74
}
75
75
if ( ! foundEnv ) varsNotFound ( environment )
76
76
77
- // Wrap it up
78
- if ( proj ?. preferences ?. sandbox ?. useAWS || process . env . ARC_LOCAL ) {
77
+ // Summarize live AWS resources
78
+ let useAWS = [ 'staging' , 'production' ] . includes ( process . env . ARC_ENV ) &&
79
+ process . env . ARC_LOCAL
80
+ if ( proj ?. preferences ?. sandbox ?. useAWS || useAWS ) {
79
81
let live = [
80
82
inv . tables ? '@tables' : '' ,
81
83
inv [ 'tables-indexes' ] ? '@tables-indexes' : '' ,
0 commit comments