In this assignment, you will create and test the API Gateway and Routing REST to the Lambdas created in the previous assignment.PromptYou will create the API method to the Lambdas, use the stage...

1 answer below »

In this assignment, you will create and test the API Gateway and Routing REST to the Lambdas created in the previous assignment.




Prompt




You will create the API method to the Lambdas, use the stage editor

for deployment, and then use the API method test console to test your

API. Each area is critical because they are interdependent. Use the
CS 470 Module Four Assignment Two Guideto complete the tasks and produce your deliverables.




Specifically, you must address the following rubric criteria:





  • API Gateway

  • Method Testing

  • Deploy API




Guidelines for Submission




Produce and submit the following screenshots and URL for the steps in your assignment guide:





  • Screenshot of the GET method execution page

  • Screenshot of the GET test page

  • Screenshot of the browser running the URL

  • The invoke URL from your deployment
    AWS student environment login - https://awsacademy.instructure.com/login/canvas
    Username - [email protected]
    Password - QkG7bZCvswq4Y4G




CS 470 Module Four Assignment Two Guide CS 470 Module Four Assignment Two Guide Part One – Creating an API Using API Gateway 1. Navigate to the API Gateway in the AWS Console. It is located under the Networking & Content Delivery section. You can also search for it. 2. Select REST API by clicking the Build button in the REST API box. 3. Dismiss the dialog box shown below, and set Create New API to New API. 4. Set the API Name to “Echo” and give it a description of “My Echo Service”. 5. Leave the Endpoint Type as Regional. 6. Now click the blue Create API button in the lower-right corner. 7. You will now see a mostly blank screen with the “/Methods” title. 8. Believe it or not, you have now created an API. It will not do anything yet, but that is for the next part. Part Two – Adding a Method to Your API 1. Select the Actions drop-down menu and click Create Method. 2. A new blank drop-down box will be created under the forward slash (/). This is where you select the REST methods to process for your API. In this case, you will select GET to handle HTTP GET requests. The other options are direct mappings to HTTP methods. However, ANY is used to match all of the requests. It will match any request not explicitly handled by another method definition. 3. Click the check box next to the drop-down menu that just appeared. 4. Now we need to set up our method. Make sure the integration type is Lambda Function. 5. Make sure the Use Lambda Proxy Integration check box is checked. 6. Leave the region as “us-east-1”. 7. Type “EchoFunction” into the Lambda Function box. AWS will suggest it for you as you type. 8. Make sure Use Default Timeout is checked. 9. Click the blue Save button in the lower-right corner. 10. You will be asked if you want to Add Permission to Lambda Function. 11. Click OK. This is how you tell the API Gateway that the GET method has permission to execute your Lambda. 12. You will now see the fully populated Method Execution page. 13. Congratulations! You have now wired up your API to your Lambda. Part Three – Testing Your API to Lambda Method 1. Click the Test link above the lightning bolt. 2. Click the blue Test button. 3. The right side of the page will show you the Response Body, Response Headers, and API Gateway Logs. It should look something like this: 4. It worked! But, not really. We didn’t pass it a name to reply with, so it says “Hello unknown”. Let’s fix that. 5. Select the Method Execution link with the arrow pointing left, located in the upper right. 6. Select the Method Request box by clicking on its name. 7. Open the URL Query String Parameters section. 8. Click the Plus (+) Add Query string. 9. Enter “name” (without quotes) in the input box and click the grey check mark on the right side. 10. Select the Method Execution link in the upper right. 11. Click Test. 12. Now you can enter a query string for your test. Type “name=Nancy” (without quotes). 13. Click the Test button. 14. Success. You have now tested your API with a parameter calling your Lambda. Part Four – Deploying Your API 1. You have a shiny new API, but it is not yet callable from outside of AWS. We need to deploy it to allow that. To deploy your API, select Deploy API from the Actions drop-down menu. 2. Select New Stage in the Deployment stage drop-down menu. 3. Type “API” as your stage name. The two description fields are optional. 4. Click Deploy. 5. A few seconds later, your API will be deployed, and you will have your shiny new URL. 6. If you navigate to the URL, it will work in your browser. (Make sure you are using a browser other than Firefox, when you try this). 7. You can put in a query parameter to make the message more personalized. That’s it. You have created a Lambda, tested it, created an API, connected it to your Lambda, and tested it again. Finally, you deployed your API. Your project will build upon these functions to connect your Angular application to new Lambdas you will write, which will connect to the database we will learn about in the next module. Great work! 1
Answered 3 days AfterNov 15, 2022

Answer To: In this assignment, you will create and test the API Gateway and Routing REST to the Lambdas created...

Manikandan answered on Nov 18 2022
42 Votes
API Gateway Test With Lambda:
Part One – Creating an API Using API Gateway
1. Navigate to the API
Gateway in the AWS Console. It is located under the Networking & Content Delivery section. You can also search for it.
1. Select REST API by clicking the Build button in the REST API box.
3) Dismiss the dialog box shown below, and set Create New API to New API.
4) Set the API Name to “Echo” and give it a description of “My Echo Service”.
5) Leave the Endpoint Type as Regional.
6) Now click the blue Create API button in the lower-right corner.
7) You will now see a mostly blank screen with the “/Methods” title.
8) Believe it or not, you have now created an API. It will not do anything yet, but that is for the next part.
Part Two – Adding a Method to Your API
1. Select the Actions drop-down menu...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here