aws-samples / aws-sam-terraform-examples

MIT No Attribution
45 stars 14 forks source link

Lambda broken due to: [ERROR] Runtime.ImportModuleError: Unable to import module 'index': urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with OpenSSL 1.0.2k-fips 26 Jan 2017. #8

Closed ElijahLynn closed 1 year ago

ElijahLynn commented 1 year ago

Currently getting this error in Cloudwatch Logs with a GET to /serverless_lambda_stage.

[ERROR] Runtime.ImportModuleError: Unable to import module 'index': urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with OpenSSL 1.0.2k-fips 26 Jan 2017. See: https://github.com/urllib3/urllib3/issues/2168

ElijahLynn commented 1 year ago

The fix to lock the dependency in https://github.com/lithops-cloud/lithops/issues/1104 works. If you are getting this error, apply my PR in #9 then do a terraform destroy if already deployed and then another terraform apply and then the Lambda will now accept a POST with the demo JSON body here: https://github.com/aws-samples/aws-sam-terraform-examples/blob/main/serverless_tf_sample/api-lambda-dynamodb-example/events/lambda-input.json

{
    "BookTitle": "My fave book",
    "ReviewScore": "8",
    "ReviewText": "Epic read! Definitely recommended!"
}