Welcome to the QA lab guide for our Hands-on Lab Build RESTful Microservices with AWS Lambda and API Gateway.
The most common concern we receive from students is on the step Following Best Practices for Versions, Aliases, and Stages. Here, students state that the invoke URL does not show the expected result.
However, this can be caused by either clicking 'cancel' instead of 'OK' for the permissions or not assigning the lambda_basic_execution when creatin the lambda function. To check this, you can look at both the lambda function and the API gateway configurations.
Below, you can find the steps to create the Lambda function:
1. Ensure that the lab environment has loaded 100% prior to starting:
2. Log into AWS using the provided credentials for the lab session.
3. Ensure that the previous steps were followed strictly to prevent any errors in the next steps.
Once on the step Following Best Practices for Versions, Aliases, and Stages:
1. In your API gateway, go to dev Stage Editor, click on the Stage Variables tab and click Add Stage Variable with the below details, then click save:
-
Name: lambdaAlias
-
Value: dev
2. Select the prod stage and create a lambdaAlias stage variable with the value of prod:
3. Go to resources and for both the /items GET method and the /items/{ID} GET method, modify the Integration Request Lambda Function to ItemsFunction:${stageVariables.lambdaAlias}. Click OK to the Add Permission to Lambda Function modals that popup.
Ensure you do this for both resources, you can just click "OK" on the warning that pops out.
4. Go to actions and make sure to redeploy both stages before proceeding to the next step.
5. Go to stages, then prod, and copy the invoke URL:
6. Once the URL is copied, paste it in a different browser (and append: /items to the end)
I hope you have found this guide helpful!
If any issue persists, please do not hesitate to email support@cloudacademy.com
Happy Training!
Comments
0 comments
Article is closed for comments.