index
Objects
BaseInput
@dataclass
class BaseInput()
Input for running the main lambda handler.
Attributes:
prefixstr - object path in which to find the files.batchint, optional - size of a single batch. This will generate aList[List]with every outer List of the same length asbatch. The last list in theListwill contain the leftovers and can be of a different length.bucketstr, optional - the bucket to search in. Defaults to SOURCE_BUCKET.excludeList[str], optional - an array of string patterns to exclude from the files inprefix.s3_payloadbool, optional - switch to send the data as S3 payloads to the payload bucket. Defaults to False.
Functions
lambda_handler
@tracer.capture_lambda_handler
@logger.inject_lambda_context()
def lambda_handler(event: dict, context: dict) -> list
Retrieves contents of s3 bucket. Used in a step function to prep for a batcher.
Arguments:
eventdict - should fit the BaseInput.contextdict - lambda context object.
Raises:
e- raised when listing fails for some reason.
Returns:
list- a list of strings | objects | list as an iterable. Withs3_payload=Truethis will be a list of payload jsons.
Examples:
{
"prefix": "some/object/path/",
"batch": 10,
"bucket": "some-bucket",
"exclude": ["*.tif.aux", "Thumbs"],
"s3_payload": true
}