Search for and open DynamoDB.
Click Create table.
Give it the name locations and Partition as id (String). Scroll down and click Create table.
Wait until the status becomes Active.
Search for and open Lambda.
Click Functions and Create function.
Give it the name labFunction and select Python as the language.
Change default execution role to Use an existing role and select lab_function_role. Click Create function.
Delete the default code in Code source and paste the sample.py code. Click Deploy. Scroll down and copy lines 104-110. Click Test.
Give it the name Location and change the Event JSON code to what was copied. Click Format JSON then Save.
Click Test and review the results.
Go back to DynamoDB. Click Tables then locations.
Click Explore table items.
Ensure that the Items returned are accurate.
Search for and open API Gateway. Scroll down to REST API and select Build (not private). Create New API and give it the name DIY-API. Click Create API.
Go back to DynamoDB and create a new table. Give it the name vehicles, Partition as id (String). Scroll down and click Create table. Wait until the status becomes Active.
Search for and open Lambda. Select labFunction and go to Code source and change the table_name to vehicles.
*Due to technical errors in reloading the lab, the remainder of this project will not include accompanying images.
Click the Actions dropdown and select Create Resource.
Give it the name vehicles and click Create Resource.
Click the Actions dropdown and select Create Method.
Select GET and then click the check mark.
Select Use Lambda Proxy integration and labFunction.
Click Save and OK in the pop up.
Click Test then scroll down and click Test.
Click the Actions dropdown and select Create Resource.
Give it the name ID with curly brackets and click Create Resource.
Click the Actions dropdown and select Create Method.
Select POST and then click the check mark. Select Use Lambda Proxy integration and labFunction.
Click Save and OK in the pop up.
Click Test, type 1 for the Path id and scroll down and click Test.
Review the Response Body and ensure that the correct id and name is displayed.
Go to the Actions dropdown and select Deploy API.
Select New Stage, and give it the name lab and description Vehicles API then Rental Vehicles deployment. Click Deploy.
Copy provided Invoke URL.
In a new tab or window, paste the copied URL and add /vehicles to the end of the URL. Review the response.
Success!