Skip to content

Commit

Permalink
Bug workaround
Browse files Browse the repository at this point in the history
urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2k-fips  26 Jan 2017'
  • Loading branch information
jonaraphael committed Oct 5, 2023
1 parent 786916f commit 9c3a109
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 12 additions & 4 deletions cerulean_cloud/lambda_sentinel1_subscription/handler.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
"""handler for SNS topic, to cloud function"""
import json
import os

import requests
from http.client import HTTPSConnection


def lambda_handler(event, context):
"""handle lambda"""
function_url = os.getenv("FUNCTION_URL")
domain, path = function_url.replace("https://", "").split("/", 1)
print(event)
res = requests.post(function_url, json=event)
return {"statusCode": res.status_code}
conn = HTTPSConnection(domain)
conn.request(
"POST",
"/" + path,
body=json.dumps(event),
headers={"Content-Type": "application/json"},
)
res = conn.getresponse()
return {"statusCode": res.status}
1 change: 0 additions & 1 deletion stack/sns_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"FUNCTION_URL": cloud_function_scene_relevancy.fxn.https_trigger_url
},
),
layers=["arn:aws:lambda:eu-central-1:770693421928:layer:Klayers-p38-requests:15"],
)
# Give SNS permissions to invoke the Lambda
lambda_permission = aws.lambda_.Permission(
Expand Down

0 comments on commit 9c3a109

Please sign in to comment.