serverless-lambda-prune-plugin
serverless-lambda-prune-plugin copied to clipboard
ConfigError: Missing region in config
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) } } }
I'm having this same problem. It is not pulling credentials from the Serverless project, but instead just reading default AWS configs.
As a workaround you can specify the region using -r. Example sls function prune -r us-east-1
.