-
Notifications
You must be signed in to change notification settings - Fork 171
Description
Summary
After upgrading @aws-lambda-powertools/logger
from version 2.24.1 to 2.25.0, my local tests fail with the following error:
Environment variable AWS_REGION is required
Previously, I could run tests locally without setting AWS_REGION, since all AWS calls are mocked and my tests only verify log output. Requiring AWS_REGION for local/unit tests feels unnecessary and makes testing more cumbersome.
Is this an intentional change? If so, could there be a way to relax this requirement for local/test environments?
Thanks for your help!
Why is this needed?
This will make local & unit testing easier and fixes an issue that was created between version 2.24.1
and 2.25.0
. It enhances backwards compatibility.
Which area does this relate to?
No response
Solution
I believe the fix could be to add a defaultValue: ''
for AWS_REGION when reading the environment variable, similar to how other environment variables are handled.
Acknowledgment
- This request meets Powertools for AWS Lambda (TypeScript) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with 👍 and your use case to help us understand customer demand.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status