Search for and open S3.
Go to Buckets and search for lab. Click the name of the lab bucket.
Go to the Permissions tab and click Edit for Block public access.
Unselect Block all public access. Click Save changes.
Type and click Confirm.
Review public access then click Edit for the Bucket policy.
Copy the Bucket ARN.
Open our policy in a text editor and replace the placeholder with the Bucket ARN we copied.
Copy the edited content and paste it into our Bucket Policy. Scroll down and click Save changes.
Go to the Properties tab and scroll down to Static website hosting. Click Edit.
Select Enable then type index.html for the home page. Scroll down and click Save changes.
Scroll to the bottom and copy the Bucket website endpoint. Click the website endpoint link to test.
Review the components of the app.
Search for and go to API Gateway.
Click the API Name.
Go to Stages and click prod. Copy the Invoke URL.
Paste it into the app and add /vehicles. Click Load Backend Data then review the output below.
Return to the API console and select Resources. Click /vehicles then GET method.
Go to the Integration request tab and click Edit in the settings.
Select Lambda function and turn on Lambda proxy integration. choose the function that ends with all_vehicles. Scroll down and click Save.
Click Deploy API.
Select the prod Stage and click Deploy.
Return to the app and click Load Backend Data. Ensure that the Status 500 is returned.
Return to the console and go to CloudWatch.
Go to Log groups and click the API execution logs.
Scroll down to Log streams and click the most recent log.
Click the failed Lambda execution. Review the reason for failure.
Search for and go to Lambda.
Go to Functions then click the find all vehicles function.
Go to the Configuration tab and select Permissions. Click Edit for Execution role.
Select Create a new role and give it the name lab-find_all_vehicles_dynamodb-role. For Policy templates, type and select Simple microservice permissions. Click Save.
Return to the app and click Load Backend Data. Review both outputs including the mobile app.
Go to the API console and click Resources. Select id and click the GET method.
Go to the Integration request tab and click Edit in the settings.
Ensure that Lambda proxy integration is on and that the find_vehicles function is selected. Click Save.
Click Deploy API.
Select the prod Stage and click Deploy.
Go to the CloudWatch console and select Log groups. Click API execution logs.
Scroll down to Log streams and click the most recent log.
Click the failed Lambda execution. Review the reason for failure.
Return to the Lambda console. Go to Functions then click the find vehicle Name.
Go to the Configuration tab and select Permissions. Click Edit for Execution role.
Select Create a new role and give it the name lab-all_vehicles_dynamodb-role. For Policy templates, type and select Simple microservice permissions. Click Save.
Return to the app and click Load Backend Data. Then click Details for any item on the mobile app.
Ensure that we receive the relevant item details. Success!