I am facing with a little issue using Serverless framework. I have a serverless.yml file with a region configured (eu-west-1). I am testing the lambda code (python 3.8) locally using
sls invoke local -f <service_name>. The lambda uses the boto3 library to access to the ssm service where I store some secrets (database credentials, for example). The problem is that the “invoke local” function doesn’t seem to use neither the region in the serverless.yaml nor the region in the ~/.aws/config file (boto3 uses this configuration file by default or an environment variable called AWS_DEFAULT_REGION). I know I can use the "invoke local -r " and it works properly but IMO it should use the region configured in the serverless.yml file or the region in the aws config file.
Is this a bug or is this the default behaviour? If this is the normal behaviour then, why??
Thanks a lot!