Skip to content

Instantly share code, notes, and snippets.

@sakibguy
Forked from nktstudios/lambda_function.py
Created January 7, 2022 12:23
Show Gist options
  • Save sakibguy/b037feb8f55be13ed3653edb2c73ba13 to your computer and use it in GitHub Desktop.
Save sakibguy/b037feb8f55be13ed3653edb2c73ba13 to your computer and use it in GitHub Desktop.
AWS Lambda Deployment Package in Python
import json
import pandas as pd
import numpy as np
import requests
def lambda_handler(event, context):
pandas_version = pd.__version__
numpy_version = np.__version__
r = requests.get("https://www.google.com")
google_status_code = r.status_code
return_statement = 'Pandas Version: ', pandas_version, 'Numpy Version: ', numpy_version,\
'Google Status Code: ', google_status_code
return {
'statusCode': 200,
'body': json.dumps(return_statement)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment