This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A sample funtion to perform S3 select operation on a JSON file stored in S3 bucket | |
The bucket and file names are stored as environment variables | |
""" | |
import os | |
import boto3 | |
def get_data(): | |
""" | |
Using S3 select to query data from S3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A simple lambda function to mimic the behaviour of PDF generation | |
""" | |
import time | |
def lambda_handler(event, context): | |
# mocking the behavior of generating a PDF | |
time.sleep(2) | |
return "PDF successfully generated" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Lambda function to mimic the process of a movie ticket generation | |
""" | |
import boto3 | |
import requests | |
# just add these lines for active tracing of the data flow | |
from aws_xray_sdk.core import xray_recorder | |
from aws_xray_sdk.core import patch_all |