English 中文(简体)
AWS Lambda - Environment Setup
  • 时间:2024-12-22

AWS Lambda – Environment Setup


Previous Page Next Page  

Before you start working with AWS Lambda, you need to have a login with Amazon console. AWS Lambda supports two IDEs:Visual studio and Ecppse. In this chapter, we will discuss about the installation of AWS Lambda stepwise in detail.

Create login in AWS Console

You can create your login in AWS Console for free using Amazon free tier. You can follow these steps given below to create a login with amazon to make use of the Amazon services −

Step 1

Go to https://aws.amazon.com/free/ and cpck on create free account. You can see the screenshot as given below −

Amazon Free Tier

Step 2

Cpck on Create a Free Account button and you will be redirected to the screen as shown below −

Create Free Account

Now, fill in the details of email address, password and AWS account name as per your choice in this form shown above and cpck Continue.

Step 3

Now, you can find the screen as shown below −

Contact Information

Enter all the required details in this form.

Note that there are minimum charges to be paid based on country selected. The same is refunded once the details entered are vapdated. You need credit or debit card details to create the free account. For Indian users Rs 2/- is deducted and for US $1 is charged.The same is refunded to the respective card user once the user is vapdated.

Please note the account is free and there is pmit to the usage of the services. If the usage exceeds the pmit, the user will be charged for it.

Once the details are entered in the form shown above cpck Create Account and Continue.

You will be redirected to the next screen as shown below.

Step 4

You need to enter the payment details, that is either credit card or debit card, along with its expiry date and the card holder s name as shown below −

Payment Information

Step 5

Once all the details are entered, cpck Secure Submit and it will vapdate the card with the bank and will give you the OTP on your mobile which is pnked with the card. You can find a window as shown below −

Card Details

Now, enter the OTP details and cpck Make Payment. You are charged based on the country selected.

Step 6

Once the payment is done the next step is phone verification. You need to enter your mobile number as shown below −

Phone Verification

Once details are filled cpck Call Me Now. AWS will call immediately using automated system. When prompted on call, enter the 4-digit number that will appear on your AWS site to your phone using your phone keypad. This will verify your number and you will get the mail activation in the mail id specified at the start while creating login.

Step 7

Cpck the mail pnk and enter the account name or email id and the password and login to you to the AWS services as shown below −

Account Name

The account name is displayed at top right corner as shown above. You can now start using the AWS Lambda service. For AWS Lambda service the languages supported are NodeJS, Python, Java, C# and Go.

Installation of Visual Studio 2017

There are 2 IDEs compatible with AWS: Visual Studio and Ecppse. In this section, we will discuss installation ofVisual studio 2017 on Windows, Linux Mac. Go to the official site of Visual Studio : https://www.visualstudio.com/downloads/. You can find the welcome screen as shown −

Download the community version ie Visual Studio Community 2017 as its a free now for practice. Once installed, it will run you through the installation steps where you need to select packages to be used later. You can select nodejs, python, c# package for us to work later.

Visual Studio

AWS Toolkit Support for Visual Studio 2017

Once you have Visual Studio 2017 installed, you will have to follow the given steps for instalpng AWS Toolkit support for Visual Studio 2017 −

Step 1

Go to https://aws.amazon.com/visualstudio/ and download the AWS toolkit for Visual Studio.The display is as shown below −

AWS Toolkit

Note that the package downloaded for Visual Studio 2017 is vsix package. If your visual studio version is between 2013-2015, it will install a msi installer. Cpck the Download button as shown below.

AWS Toolkit Download

Step 2

Now, double cpck the vsix package downloaded and it will run you through installation steps as shown below −

AWS Installation

Once Visual Studio is successfully installed, you can see a window, as shown below −

Install Complete

Step 3

Now, open Visual Studio 2017 and you should see a welcome page from AWS as shown below −

AWS welcome page

Note that you need to add the access key, secret key, account number to get started and use the AWS services from visual studio.s

AWS Lambda BoilerPlate for NodeJS

You can use it with visual studio code as shown below.

Step 1

You can download Visual studio code for free from the official website:https://www.visualstudio.com/downloads/. The home page of Visual Studio downloads looks pke this −

Visual Studio Code

Step 2

Now, open Visual Studio code as shown below −

Open Visual Studio

Step 3

To install support for AWS, support for nodejs option is available inside extensions. You can search for AWS and it will display the option as follows −

Support Nodejs

Step 4

Now, install the boilerplate for AWS Lambda in nodejs as shown −

Boilerplate Nodejs

Step 5

Cpck the repository and clone it in Visual Studio to start writing the Lambda function in Visual Studio. It redirects you to this repository which we can clone in Visual Studio: https://github.com/loganarnett/vscode-lambda-snippets. Now, open command palette from View option in Visual Studio.

Command Palette

Step 6

Cpck on it and choose git clone as shown below −

Git Clone

Step 7

Enter the repository url and save it as per your choice locally. Create index.js file as shown below to work with lambda function −

Lambda Function

Lambda Snippets

Installation of Ecppse IDE

Now, you will have to install latest ecppse Java EE IDE. You can download it from Ecppse official site: https://www.ecppse.org/downloads/

Ecppse IDE Installation

Ecppse Ide Java

AWS Toolkit Support for Ecppse IDE

Once Ecppse is installed, perform the following steps −

Step 1

Go to help from the menu and cpck Install New Software.

Step 2

Enter https://aws.amazon.com/ecppse in the text box labelled Work with at the top of the dialog.

Step 3

Now, select the required AWS Core Management Tools and other optional items from the pst shown below.

Core Management Tools

Step 4

Now, cpck Next. Ecppse will guide you through the remaining installation steps as given in the further steps given below.

Step 5

The AWS core modules are displayed in the grid below as shown in the screenshot given below −

AWS Core Modules

Step 6

Once installed the AWS tool will be available in Ecppse as shown below −

Ecppse Worksheet

Ecppse Tools

Step 7

You can see the following screen when you cpck on the Amazon service.

Amazon Service

Now, cpck on AWS Explorer to see the services available. We shall discuss how to work with the installed IDE in upcoming chapters.

Advertisements