Collection of FaaS Python scripts to be used with AWS lambda to put/get/update items in DynamoDB
-
Data creation functions
- All scripts with filename postfix handler are for accessing information from the MySportsFeeds website and creating a data model more tenable to my data access patterns.
- These functions require you to have an active subscriptions to MySportsFeeds. You will need to set a Lambda environment variable "api_key": "YOUR-KEY-HERE"
- To create your own DynamoDB table and wire it up to work with these, create a table of your choice and change the tablename within the script of your choosing
- If you plan to use indexes for alternate access patterns, consult the AWS documentation on Global Secondary Indexes in DynamoDB to become more comfortable with them
- All data creation lambdas will need BatchWriteItem, PutItem, and UpdateItem permissions on the DynamoDB service
-
Data access functions
- All scripts pre-fixed with get are for accessing information within DynamoDB
- All data access lambdas will need Query permissions on the DynamoDB service
- Create an instance of the API Gateway service using either the AWS CLI or Console
- Create resources for the following suggested topics:
- player
- games
- team
- Create methods on those resources and for each:
- Specify the lambda functions to hook up
- Force the requried QueryString parameters and select whichever authorizer you plan to use for validation
- Create a mapping within the integration to map QueryString -> {name of event parameter(s) within the functions}
- Optionally secure your API by referencing the various methods found in the API Gateway documentation
- Publish your API and access using whichever requests library you prefer passing relevant QueryStrings and authorization information