First we created an html file with a simple code.

3

Then we uploaded the code to AWS Amplify, in order to start a Manual Deployment 2 1

This is the output of the code before any changes are made. Initial successful deployment. 4

Run Python code using the Python math library. First we create the function using Lambda. 5

Original source code with the Lambda handler highlighted, which is common to all lambda functions. 6

Create a test to determine whether the source code works. After saving and deploying the code, hit the dropdown menu next to test and configure the test event.

7

Success! The lambda code is working and you will know this due to the “statusCode” being 200 and the “result” being 8.0. 8

Creating an API and giving it permission to invoke the Lambda Function. 9

Enable C.O.R.S (Cross Origin Resource Sharing) 10

Once the CORS has been activated, we deploy the API. We would need to create a stage/monitor stage actions after validating the resources. 12 13

Incorporate a database into the site. Using DynamoDB (noSQL database). Give the lambda function permission to write to the database. 14

We specify permissions using JSON. Input the ARN code copied from the PowerOfMathDatabase (found under additional info) 15

Updated source code: in order to use the SDK (Boto.3), insert our math result into our table, and grabbing the current time. 16

The deploy and test is successful, the same as before but when we go to our DynamoDB table, we now have an output. 17

Update the source Index code; which includes aesthetic changes via the CSS code, the body heading and an input form, and the call API that would hook us up in the API gateway endpoint (using the URL) that would send the information for us to receive the full calculation. Once the file is updated and zipped, we will redeploy it using amplify.

18 19 20

The App is complete! Any number being input into fields will produce a calculated output! 21


<
Previous Post
Route 53 Navigation!
>
Next Post
RideShare for Unicorns!