AWS Certificate Exam Replacement Assignment Serverless Resume and Visitor Counter

Deadline: Thursday, December 12, @23:59 pm Scenario Overview

You are tasked with creating a serverless architecture on AWS. Host a professional resume website on AWS and add a real-time visitor counter that updates with each page load. You can use S3 to host a static website, AWS Lambda to update the number of visitors in a DynamoDB table, and API Gateway to expose the Lambda function as an endpoint.

AWS Services Involved:

  1. S3: Static website hosting.
  2. Lambda: Serverless function to update the visitor count.
  3. DynamoDB: Persistent storage for visitor counts.
  4. API Gateway: Expose Lambda as a REST API.

General Requirements:

  1. Design and Analysis:
    1. Provide a high-level design diagram with key components like S3, Lambda, DynamoDB, and API Gateway using draw.io (or a similar tool) and analyze the components of the serverless architecture. o Estimate the cost of your serverless architecture and compare it to the cost of a traditional server-based infrastructure.
  2. Resume Webpage:
    1. Use the provided HTML template to create your personal resume webpage.
    1. The webpage should display:
      1. Your Name (make sure to replace the placeholder with your name).
      1. Optional: A brief objective, experience, education, skills (feel free to add sections as needed).
      1. JavaScript Integration: Modify the <script> section of the HTML to replace the placeholder URL (https://<your-api-id>.executeapi.<region>.amazonaws.com/prod/count) with the actual URL of your API Gateway endpoint.
  3. Visitor Counter:
    1. Implement a visitor counter on your webpage using AWS Lambda to track the number of visitors.
    1. The count should be stored in DynamoDB and displayed dynamically on the webpage using JavaScript.

Implementation: Two codes snippets are provided to you: one for the resume HTML and one for the Lambda function. You just need to replace some placeholders, understand what is happening in the code in general and do tweaks if needed. You need to:

  1. Resume Template:
    1. Customize the HTML to reflect your personal details (e.g., your name, objective, skills).
    1. Ensure the JavaScript section includes the correct API Gateway URL for your Lambda function to fetch the visitor count.
  2. Lambda Function:
    1. The provided Lambda function code will update the visitor count in DynamoDB.
    1. Ensure your DynamoDB table is named VisitorCounter and follows this structure: o Partition Key: VisitorId (use “visit_count” as a fixed value to uniquely identify the visitor count item).

o Attribute: count (stores the number of visitors). The value will be incremented with each page load.

Ensure that the Lambda function is configured to trigger through API Gateway and returns the visitor count correctly.

Evaluation Criteria:

  • Design Analysis: Clear and accurate diagram of the serverless architecture, including the components used (S3, Lambda, API Gateway, DynamoDB).
  • Webpage Implementation: Correct implementation of the webpage with personal information (Name) and dynamic visitor count integration.  o             The webpage must be hosted on S3 
  • Visitor Counter Integration: Proper configuration of Lambda to update the visitor count in DynamoDB and the correct display of the count on the webpage.
  • API Gateway: Correct integration of API Gateway Deliverables: 
  • Report and Documentation:
    • Analysis of the components used and comparison of serverless vs.

traditional server-based structures.

  • Explanation of any design decisions and challenges faced.
    • Estimated billing cost of your AWS architecture.
  • URL: Provide the URL of your resume page if it is successfully deployed and accessible online.

Rubric

Key pointsGrade (%)
Technical Analysis (Components and infrastructure analysis and design)40
Deployment40
Documentation and Content (Clarity and quality of the documentation, format, etc.)10
Creativity10

Good Luck!

Resume HTML Template: (The html file, index.txt is also uploaded for you. You can use that directly to edit and then convert it to .html)

<!DOCTYPE html>

<html lang=”en”>

<head>

    <meta charset=”UTF-8″>

    <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>

    <title>Your Name – Resume</title>

    <style>         body {             font-family: Arial, sans-serif;             line-height: 1.6;             margin: 0;             padding: 0;             background-color: #f4f4f4;             color: #333;         }

        .container {             max-width: 800px;             margin: 20px auto;             background-color: #fff;             padding: 20px;             border-radius: 8px;             box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

        }         h1 {             text-align: center;             color: #4CAF50;

        }         h2 {

            color: #333;

        }         p {             font-size: 1.1em;

        }         .section {

            margin-bottom: 20px;

        }

    </style>

</head>

<body>

    <div class=”container”>

        <h1>Your Name</h1>

        <p><strong>Contact Information:</strong> Email | Phone | LinkedIn</p>         

        <div class=”section”>

            <h2>Objective</h2>

            <p>Brief objective about your career goals and aspirations.</p>

        </div>

        <div class=”section”>

            <h2>Experience</h2>

            <p><strong>Job Title – Company Name</strong> (Year – Year)</p>

            <ul>

                <li>Responsibility/achievement 1</li>

                <li>Responsibility/achievement 2</li>

            </ul>

        </div>

        <div class=”section”>

            <h2>Education</h2>

            <p><strong>Degree – University Name</strong> (Year – Year)</p>

        </div>

        <div class=”section”>

            <h2>Skills</h2>

            <p>List your key skills, such as programming languages, tools, etc.</p>

        </div>

        <div class=”section”>

            <h2>Projects</h2>

            <p>Highlight relevant personal or professional projects.</p>

        </div>

        <div class=”section”>

            <h2>Visitor Count</h2>

            <p><strong>Visitors:</strong> <span id=”visitorcount”>Loading…</span></p>

        </div>

    </div>

    <script>

        async function updateVisitorCount() {             try {

                // Fetch data from the API

                const response = await fetch(‘https://yqpbsv9z7j.execute-api.useast-1.amazonaws.com/prod/count’);

                // Ensure the response is OK                 if (!response.ok) {                     throw new Error(`HTTP error! status: ${response.status}`);                 }

                // Parse JSON response                 const jsonResponse = await response.json(); 

                // Access the count value from the response body                 const count = jsonResponse.body.count;

                // Update the webpage if count exists                 if (count !== undefined) {                     document.getElementById(‘visitor-count’).textContent = count;

                } else {                     throw new Error(‘Count not found in response body’);

                }

            } catch (error) {                 console.error(‘Error fetching visitor count:’, error);                 document.getElementById(‘visitor-count’).textContent = ‘Error:

Invalid response.’;

            }

        }

        // Call the function when the page loads         updateVisitorCount();

    </script>

</body>

</html> 

Lambda Function: (The file is also provided to you, named lambda.txt)

import json import boto3 from decimal import Decimal

 dynamodb = boto3.resource(‘dynamodb’) table = dynamodb.Table(‘VisitorCounter’)

 def lambda_handler(event, context):     # Increment the visit count in DynamoDB     response = table.update_item(

        Key={‘VisitorId’: ‘visit_count’},

        UpdateExpression=’ADD #count :increment’,

        ExpressionAttributeNames={‘#count’: ‘count’},

        ExpressionAttributeValues={‘:increment’: Decimal(1)},

        ReturnValues=’UPDATED_NEW’

    )     count = response[‘Attributes’][‘count’]

    # Return the response as a JSON object, NOT as a string     return {

        “statusCode”: 200,

        “headers”: {

            “Content-Type”: “application/json”,

            “Access-Control-Allow-Origin”: “*”

        },

        “body”: {“count”: int(count)}  # Do NOT serialize this with json.dumps()

    } 

Stressed over that homework?

Essay deadline breathing down your neck?

Let’s cut to the chase: Why struggle when you can ace it with zero hassle?

Whether it’s essays, research papers, or assignments — we’ve got you covered.

✅ Expert writers
✅ 100% original work
✅ No AI tools, just real pros

Stressed about your essay or homework? Get a top-quality custom essay NOW!!! Stop worrying. Start succeeding.

GradeEssays.com
We are GradeEssays.com, the best college essay writing service. We offer educational and research assistance to assist our customers in managing their academic work. At GradeEssays.com, we promise quality and 100% original essays written from scratch.
Contact Us

Enjoy 24/7 customer support for any queries or concerns you have.

Phone: +1 213 3772458

Email: support@gradeessays.com

© 2024 - GradeEssays.com. All rights reserved.

WE HAVE A GIFT FOR YOU!

15% OFF 🎁

Get 15% OFF on your order with us

Scroll to Top