From the course: AWS Essential Training for Developers

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Solution: Lambda function

Solution: Lambda function

(bright rhythmic music) (bright rhythmic music ending) - [Instructor] The first thing I did was start a new line and try to write another print statement, similar to the one that was already writing the ContentType. The AI tools started to give me a few suggestions, but I didn't find that these worked for me. The next thing I did was an internet search for python s3.get_object, and it did lead me to the documentation for this Python library. I can see in the example output that in addition to ContentType, I can also call ContentLength, and this looks to be the size of the uploaded file. On my new line, I put print, and then in parentheses with double quotes, I put SIZE:, with a space. And then I did a plus sign to concatenate a string, and then I said response, and then open brackets, and it started to suggest for me ContentLength. Then I click to Deploy to save the changes to my function. You could also attempt this…

Contents