Issue: resolving the environment variable still sends the request to AWS, because reconfiguring the endpoint is running async, and is not finished when the getParameter SSM is called, resulting in error:
aws: [1] { UnrecognizedClientException: The security token included in the request is invalid.
at Request.extractError (/path/ls-lambda/node_modules/aws-sdk/lib/protocol/json.js:52:27)
at Request.callListeners (/path/ls-lambda/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/path/ls-lambda/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
....
'Cannot resolve serverless.yml: Variables resolution errored with:\n - Cannot resolve variable at "provider.environment.LAMBDA_STAGE": The security token included in the request is invalid.',
This is triggered by the following configuration for LAMBDA_STAGE:
Issue: resolving the environment variable still sends the request to AWS, because reconfiguring the endpoint is running async, and is not finished when the
getParameter SSM
is called, resulting in error:This is triggered by the following configuration for
LAMBDA_STAGE
:It turns out, that in this case (for resolving the
environment
variable) the intercept-hookinterceptRequest
is triggeredinterceptRequest
is a patching aws.request, which is alreadyasync
.async interceptRequest
, and addingawait
for the aws-reconfiguration.init
hook that will also await the aws-reconfigurationchanged the default for
BUCKET_MARKER_LOCAL
to hot-reload