Cannot use Requests-Module on AWS Lambda - Stack Overflow If you're working with Python on AWS Lambda, and need to use requests, you better use urllib3, it is currently supported on AWS Lambda and you can import it directly, check the example on urllib3 site
Is there a way to perform if in pythons lambda? [duplicate] An easy way to perform an if in lambda is by using list comprehension You can't raise an exception in lambda, but this is a way in Python 3 x to do something close to your example: