Question
Lambda/Chalice You will build a Lamba/Chalice application that allows the user to select a Polly voice and upload a png file; then your application will
Lambda/Chalice
You will build a Lamba/Chalice application that allows the user to select a Polly voice and upload a png file; then your application will get the labels in the image, and return an mp3 of the selected voice speaking the labels in the image.
You've already been given an app.py in the starter files. It sets up the route including CORS and accepting png, and jpg file. The route also takes a route parameter, voice, that is the voice. NOTE your route must be your (and your partner's) initials. So, for example, my local endpoint would be http://localhost:8000/pv. Finally in the provided code, imgbytes is pulled directly from the request sent by the voice-label.html page.
The voice-label.html file is already written for you. All you need to do is edit the top of the file where the API_ENDPOINT is assigned.
The html page you are given, voice-label.html, expects a JSON response like the following:
{voice: "Nicole", labels: "Human, People, Person, Team", url: "s3://url to the mp3 file"}
You must put the html, it's css and javascript in an S3 bucket configured as noted below regarding CloudFormation
Write a CloudFormation template, voice-label.yaml, that creates the bucket, and includes a bucket policy that allows only the web files (html, css, and javascript) to be publicly accessible. You may hardcode the bucket name in your template file, or for 5 points extra credit, you may parameterize it. NOTE: You only get the extra credit if your CloudFormation script is fully functional per the requirements.
Your CloudFormation template must have an output named WebsiteURL that contains the website URL for your bucket.
Your Python file, app.py, will contain the code for your Lambda/Chalice application. You are encouraged to use the SayIt example from class as the basis for your code.
Leave it running for grading, submit the static website endpoint (website URL) in a file name voice-label-ip.txt
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started