Design and implementation of a serverless application

Assignment Help Other Subject
Reference no: EM133888556

Part 1: Design and implementation of a serverless application using Google Cloud Platform (GCP)

Objective:
Design and implementation of a serverless application using Google Cloud Platform (GCP) that create a basic serverless web application to handles HTTP requests using Google Cloud Functions and stores data in Firestore (a NoSQL database). Hire Online Assignment help service for completing assignment!

Overview of the Application:
The serverless application will have the following functionalities:
An HTTP endpoint using Google Cloud Functions.
Data storage and retrieval using Firestore.

Step 1: Set Up Your Google Cloud Project

Create a Google Cloud Project:
Go to the [Google Cloud Console] and create a new project.
Provide a project name and note down the project ID.


Enable Required APIs:
In the Google Cloud Console, go to `APIs & Services > Library`.
Enable the following APIs:
o Cloud Functions API o
Firestore API

Set Up Billing:
Ensure that billing is enabled for your project (required to use certain GCP services).

Step 2: Install the Google Cloud SDK

Install Google Cloud SDK:
Follow the [installation instructions] for your operating system. (You can skip this part if you already have installed SDK before).


Initialize the SDK:
Run the following command and follow the prompts:

Authenticate and Set Project:
Set your project using:

Step 3: Implement the Cloud Function
Create the Cloud Function Code:
Create a directory for your function:

Create a `main.py` file with the following content:

In this function:
We handle both `POST` and `GET` requests.
For `POST`, the function adds a user's name to Firestore.
For `GET`, the function retrieves and returns the list of users from Firestore.


Create a `requirements.txt` File:
List the required Python packages:

Step 4: Deploy the Cloud Function

Deploy the Function:
Run the following command to deploy your function:

In this command:
`--runtime python310`: Specifies the Python runtime.
`--trigger-http`: Deploys the function as an HTTP endpoint.
`--allow-unauthenticated`: Allows public access to the function (remove this flag if you want restricted access).


Wait for Deployment:
Once deployed, the command line will display a URL for your function, such as:

You can use this URL to make HTTP requests to your serverless application.

Step 5: Test the Serverless Application

Test the GET Request:


You should see a list of users (if any are stored in Firestore).


Test the POST Request:
Use `curl` or a tool like Postman to send a POST request:


This will add a user named "John Doe" to Firestore.

Step 6: View the Data in Firestore

Go to Firestore in Google Cloud Console:
Navigate to `Firestore` in the Google Cloud Console.
You should see a collection named `users` containing the data you added via the POST request.

Step 7: Clean Up Resources

To avoid incurring unnecessary charges, delete the deployed function when you're done:

Conclusion:
This guide demonstrates how to design and implement a serverless application using Google Cloud Functions and Firestore. The application is scalable, easy to deploy, and fully serverless, meaning you don't have to worry about managing infrastructure. This is a basic implementation that you can expand by adding more features, security layers, and integration with other Google Cloud services.

Part 2: Create an AWS Elastic Beanstalk Application Objectives:
In this lab session we are going to create an AWS elastic Beanstalk application.

Overview of the Application:
To run and manage web apps.
Running a web application without having to worry about provisioning the underlying infrastructure layer

Step 1: Create an IAM instance profile for your Amazon EC2 instances
Sign in to the AWS Management Console and open the IAM console at
In the IAM console, in the navigation pane, choose Policies, and then choose Create policy.
On the Specify permissions page, choose JSON.
Remove the example JSON code.

Choose Next.
On the Review and create page, in the Policy name box, type AWS-S3-EC2-Permissions.

(Optional) For Description, type a description for the policy.
Choose Create policy.
In the navigation pane, choose Roles, and then choose Create role.
Under Use case, choose the EC2 use case.
Choose Next.
In the list of policies, select the check box next to the policy you just created (AWS-S3- EC2Permissions). If necessary, use the search box to find the policy.
Choose Next.
On the Name, review, and create page, in Role name, enter a name for the service role (for example, AWS-S3-EC2-Instance-Profile), and then choose Create role. You can also enter a description for this service role in Role description.

Step 2: Set Up Your Elastic Beanstalk Application
Create a Project:
Go to the AWS Management console.
Navigate over Elastic Beanstalk

Select Run and Manage Web Apps

Click Create application

Configure environment:

Select Web server environment.
Application Information:
Provide an application name, which automatically set your Environment Name
Application name and then the environment name are set.
Choose ‘Python' as your Platform.
Keep default settings for the rest.
Click Next

Chose the Service Role:
Select Create and use new service role
Go to EC2 instance profile, and from the drop-down menu, select the IAM Instance Profile you have created in STEP 1

Create Key Pair:

Select the key pair from the drop-down menu.
Click Next
Choose your VPC:
Select your default VPC from the drop-down menu
Go to Instance subnet
Check the Activate option for the Public IP Address
Select a couple of Availability Zones as Instance Subnets

Keep rest of the options as default
Click Next
Configure instance traffic and scaling
Select your Security Group
Choose t2.micro as Instance Type
Keep rest of the parameter as default
Click Next
Configure updates, monitoring, and logging
Choose the System Basic
Uncheck the Activated under the Managed Update
Keep rest of the parameter as default
Click Next
Reviewing Configuration


Review your setting of Elastic Beanstalk application Click Submit
Launching your website
Wait a couple of minutes so that the environment successfully launched

Click the link under Domain to launch your web application.


Connecting to the EC2 Instance
Move on to EC2 instance
Select your instance
Click Connect button on top
Click Connect
You should see the following output, which confirms that your elastic Beanstalk application is running on the EC2 instance:

Reference no: EM133888556

Questions Cloud

Why do you think we do not rely more heavily on the method y : Why do you think we do not rely more heavily on the method you have chosen? What evidence do you have to support that punishment is effective?
Advise the chief as to the officers weingarten rights : Advise the chief as to the officers Weingarten Rights and explain what those are and how a police internal affairs investigator can violate them
Can they work in tandem or are any mutually exclusive : Varied policing strategies in use today: intelligence led, community oriented, predictive, and problem oriented policing along with COMPSTAT
New content on an important emerging issue : New content on an important emerging issue along with your conclusion. At least three additional sources should be included on your reference page
Design and implementation of a serverless application : Design and implementation of a serverless application using Google Cloud Platform (GCP) that create a basic serverless web application to handles HTTP requests
Describe the problems faced by children in the tenements : Culture studies activity and innovation to sociology number one describing Jacob R I ES was concerned. Describe the problems faced by children in the tenements.
Identify the theorist with whom they are associated : In your responses, you should use at least two of the following terms. Define the terms and identify the theorist with whom they are associated.
Which leads to increasing division and hostility : This term suggests that our current media landscape gives people so much opportunity to customize the media. Which leads to increasing division and hostility.
What is your motivation for attending college : What is your motivation for attending college? Why do you think it is important to understand your motivation in college?

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd