Skip to content

Commit

Permalink
Initial working code
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmbanda24 committed May 28, 2022
1 parent 05194ea commit 9ba117d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lambda_function.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import json

def lambda_handler(event, context):
# TODO implement

data=event["Records"]
bucket=(data[0]["s3"]["bucket"]["name"])
file=(data[0]["s3"]["object"]["key"])
ip_address=(data[0]["requestParameters"]["sourceIPAddress"])
arn=(data[0]["s3"]["bucket"]["arn"])
print(f"bucket_name is {bucket} & file_name is {file} & IP is {ip_address} & arn is {arn}")
return {
'statusCode': 200,
'body': json.dumps('Hello from Lambda!')
}

0 comments on commit 9ba117d

Please sign in to comment.