Objectives
- Create & manage DynamoDB tables
- Create Lambda functions
- Create an API using API Gateway
Supporting Files
Project Overview
You have a successful big-data startup (focused on baseball) and customers are asking for access to your data. Your plan is to provide access through an API created in API Gateway. Initially, the plan is to provide read access as well as allowing users to add new records to your dataset. You have a customer that is willing to pay for access as long as you can provide a working proof-of-concept based on their JavaScript front-end.
Project Details
DynamoDB
- Create a DynamoDB table named
BaseballStatswith a primary key ofTeamIDand a sort key ofSK. You can do this from the graphical interface within the AWS console or by using the AWS CLI. - Seed the BaseballStats table with data from these 3 files:
games.json,teams.json,players.json.
Lambda
- Create a Lambda function named
allStatsthat returns a collection of all items in the BaseballStats table. - Create a Lambda function named
newTeamthat takes a team record as an incoming parameter and inserts it into the BaseballStats table. The team record will look like the following:{ TeamID: "TEAMINFO_LAA", SK: "LAA", TeamName: "Los Angeles Angels" } - Take screenshots of each Lambda function that include all of the source code.
API Gateway
- Create a REST API within API Gateway named
BaseballStats-API. - Within your BaseballStats-API, create a
GETmethod connected to theallStatsLambda function. - Within your BaseballStats-API, create a
POSTmethod connected to thenewTeamLambda function. - Enable CORS for your BaseballStats-API.
- Deploy your BaseballStats-API to a new stage named
baseballStats. - Take screenshots of your API Gateway that include the resources and methods you created.
- Include the endpoint URL for your deployed API in your project submission.
Tests and Verification
- Does my test application render all of the teams?
- Does my test application render all of the players?
- Am I able to add new teams using the test application?
- When I add a new team, is the data persistent?
Grading Rubric (Total: 50 points)
DynamoDB Setup (10 points)
- Create BaseballStats table: 5 points — correct table name, primary key (TeamID) and sort key (SK)
- Seed data from 3 files: 5 points — successfully load games.json, teams.json, players.json; all records inserted
Lambda Functions (12 points)
- allStats function: 5 points — named correctly, returns all items, proper error handling
- newTeam function: 5 points — named correctly, accepts team record, inserts record into DynamoDB
- Screenshots of Lambda code: 2 points — both functions visible with full source code
API Gateway Configuration (18 points)
- Create REST API: 2 points — API named “BaseballStats-API”
- GET method (allStats): 4 points — created and connected to allStats Lambda with proper integration
- POST method (newTeam): 4 points — created and connected to newTeam Lambda with proper integration
- CORS enabled: 3 points — CORS properly configured on all resources
- API deployment: 3 points — deployed to stage “baseballStats”, endpoint URL included
- Screenshots & documentation: 2 points — API Gateway resources and methods visible
Testing & Verification (10 points)
- Teams rendered: 2.5 points — test application displays all teams correctly
- Players rendered: 2.5 points — test application displays all players correctly
- Add new teams: 2.5 points — ability to add new teams with no errors
- Data persistence: 2.5 points — new teams persist in DynamoDB and are visible on subsequent queries
What did I learn?
- Creating and managing DynamoDB tables
- Accessing DynamoDB data from Lambda
- Providing access to Lambda through API Gateway