You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose you have configured plugins serverless-dynamodb-local, serverless-offline and serverless-dynamodb-client. Then, you execute commands
$ sls offline & [1] $ sls invoke local -f function --path input.json [2]
Result
The AWS dynamodb instance will be used, not the local one.
Explanation
The reason is that:
command [1] sets environment variable IS_OFFLINE not to the parent shell but to the sls offline process
when command [2] is executed, it inherits the environment of the shell, which has no IS_OFFLINE defined. So, when require('serverless-dynamodb-client') is called, isOffline() always returns false.
Workaround
Execute
$ export IS_OFFLINE=true
before command [2]
The text was updated successfully, but these errors were encountered:
Scenario
Suppose you have configured plugins
serverless-dynamodb-local
,serverless-offline
andserverless-dynamodb-client
. Then, you execute commandsResult
The AWS dynamodb instance will be used, not the local one.
Explanation
The reason is that:
IS_OFFLINE
not to the parent shell but to thesls offline
processIS_OFFLINE
defined. So, whenrequire('serverless-dynamodb-client')
is called,isOffline()
always returns false.Workaround
Execute
before command [2]
The text was updated successfully, but these errors were encountered: