Reference no: EM132779330
Assignment - AWS Lambda Exercise
Overview: In Assignment 2, students are expected to demonstrate their level of understanding and skill attained through practicing the workshops in week 6. The assignment has three parts (Part A: 15% 18%, Part B: 5%, and Part C: 5% 7%).
Environment Setup: You need to use the AWS Educate (student) account ‘Cloud Systems Development-NEW' created for you, along with Cloud9 as development environment. You will also need AWS Lambda and S3 to complete the programming tasks. You already should have completed the setup of the development environment (e.g., installing java, AWS SDK, maven etc.), following week 2 laboratory document on Cloud9 in You ‘Cloud Systems Development-NEW' account.
Part A - Create a Java app in Cloud9 to implement a handler for the intended Lambda function. Following this, create the Lambda function using the handler in AWS Lambda Console.
Tasks
• Handler App: Create a Java app using maven app in Cloud9 using appropriate commands shown in week 2 laboratory. The app should have the following characteristics:
o App/project name: yourSCUusernameA2HandlerApp (e.g., mine one would be
pchakrab15A2HandlerApp).
o The package name should be a2.handler.
o The class containing the main method should be named as HelloLambda.
o Include appropriate dependencies into the pom.xml so that it supports maven, Lambda etc.
• Handler: Write a Java program in the HelloLambda.java file created inside the maven app. Implement a handler method named yourSCUusernameLambdaHandler (e.g., mine one would be pchakrab15LambdaHandler) for AWS Lambda that accept S3 events as parameter type. The handler also should write a log message: ‘A S3 create event is triggered and the test is successful', which will appear in CloudWatch. Create a JAR file of your handler app.
• Lambda Function: Open AWS Lambda console and create a function named yourSCUusernameLambdaHandler (essentially the same as the name of the handler) using the JAR file of your handler app. Use the default role (shown in workshop) while creating this function.
• Trigger: Add a trigger for S3 events so that your Lambda function is triggered when a S3 ‘create event' takes place.
Part B - Create another Java app in Cloud9 that creates an S3 object to test the Lambda function you have created in Part A.
Tasks
• S3 Bucket: Create a S3 bucket named yourSCUusername-s3-bucket-lambda (mine one would be pchakrab15-s3-bucket-lambda). Complete the necessary bucket configuration (e.g., making public) using week 3 laboratory on S3.
• Tester App: Create a Java app using maven named yourSCUusernameA2TesterApp (e.g., mine one would be pchakrab15A2TesterApp). This app will create/write a new object (a text file)
with information including your name and student ID into the S3 bucket you just have created. Use a separate method to implement this functionality.
Part C - Identify and discuss whether and how you can add a DynamoDB trigger with ‘write' access to the default role used in the lambda function (~300 words).
Tasks
• Create a word file named as yourSCUusernameA2Report.docx.
• Check the details of the default role you used while creating the lambda function. Record the ‘Role ARN' into the report.
• Check the ‘Permission Policies' list and find out the ‘Access Level' for ‘DynamoDB' from that list. Record the access level you have found into your report.
• Discuss in detail with relevant screenshot of the console why and how you are able/unable to add a DynamoDB trigger with ‘write' access to your lambda function with the existing default role.
Submission Checklist: Following is the checklist, submit all in the list via Blackboard submission link. You can download the app from Cloud9 by right clicking on the app project folder it and then clicking download. You need to submit the full app folder. You need to use the classroom account for completing this assignment and share your username and password for this account with us. The marker will login to your classroom account and check your apps there. The marker will also check the command history to make sure that you have used the classroom account console to complete the apps. Your submission will not be marked if they do not comply these requirements.
• Zipped app folder for the handler app (Part A).
• Zipped app folder for the tester app (Part B).
• The report (word file), along with the complete assignment cover sheet.
• Include your username-password of AWS classroom account into the report for marking purpose. Failure to do so will result a Fail (F) grade to your assignment.
Attachment:- AWS Lambda Exercise.rar