serverless-lambda-prune-plugin icon indicating copy to clipboard operation
serverless-lambda-prune-plugin copied to clipboard

ConfigError: Missing region in config

Open stevecrozz opened this issue 9 years ago • 2 comments

Installed plugin in project root and updated s-project.json to reference the plugin. Then:

$ sls function prune 
{ [ConfigError: Missing region in config]
  cause: 
   { [ConfigError: Missing region in config]
     message: 'Missing region in config',
     code: 'ConfigError',
     time: Fri Jan 15 2016 13:02:32 GMT-0800 (PST) },
  isOperational: true,
  code: 'ConfigError',
  time: Fri Jan 15 2016 13:02:32 GMT-0800 (PST) }

I see that the region can be overridden with an AWS_REGION environment variable, but if I set that, there are more issues. It seems like there is an issue in referencing the correct configuration:

AWS_REGION=us-west-1 sls function prune 
{ [TimeoutError: Missing credentials in config]
  cause: 
   { [TimeoutError: Missing credentials in config]
     message: 'Missing credentials in config',
     code: 'CredentialsError',
     time: Fri Jan 15 2016 13:05:15 GMT-0800 (PST),
     originalError: 
      { message: 'Could not load credentials from any providers',
        code: 'CredentialsError',
        time: Fri Jan 15 2016 13:05:15 GMT-0800 (PST),
        originalError: [Object] } },
  isOperational: true,
  code: 'CredentialsError',
  time: Fri Jan 15 2016 13:05:15 GMT-0800 (PST),
  originalError: 
   { message: 'Could not load credentials from any providers',
     code: 'CredentialsError',
     time: Fri Jan 15 2016 13:05:15 GMT-0800 (PST),
     originalError: 
      { message: 'Connection timed out after 1000ms',
        code: 'TimeoutError',
        time: Fri Jan 15 2016 13:05:15 GMT-0800 (PST) } } }

stevecrozz avatar Jan 15 '16 21:01 stevecrozz

I'm having this same problem. It is not pulling credentials from the Serverless project, but instead just reading default AWS configs.

jeremydaly avatar Jan 31 '16 21:01 jeremydaly

As a workaround you can specify the region using -r. Example sls function prune -r us-east-1.

jordanmack avatar Mar 13 '16 07:03 jordanmack