Create Lambda Serverless Function

 Create Lambda Serverless Function


==================================================

To configure the serverless function for this prototype:

1. From the AWS Management Console, select the Lambda product link to get the Lambda Management Console.

2. Select Functions on the left menu.

3. Click the Create Function button.

.....a. Choose the Author From Scratch tile.

.....b. Under Basic Information, enter function name (i.e., pFunction).

.....c. From the Runtime drop-down list, select Python 3.8 or later.

.....d. Under Permissions, choose Use Existing Role.

.....e. For Existing Role, select the role created under IAM (i.e., appLambdaRole).

.....f. For the function created, go to the Configuration tab:

..........1. Choose the VPC selected for the database earlier.

..........2. Choose all Subnets associated with the database created earlier.

..........3. For Security Groups, choose the security group used for the database.

.....g. Click the Save button.

=====================================================================

To load and configure the prototype Lambda function:

1. Select Functions on the left menu.

2. Select the function just created.

3. Select Upload a Zip File under the Actions drop-down button.

.....a. Click the Upload button.

.....b. Find the zip file downloaded for the Lambda function in your file system (protolambda.zip).

.....c. Click the Save button.

4. Click the test button at the top.

5. Choose Create New Test Event.

.....a. Enter an Event Name (i.e., pTest).

.....b. There is no need to configure test parameters as the prototype application relies on URL query parameters.

.....c. Click on the Create button.

.....d. Under Runtime Settings, update the handler to show the starting point for your application (i.e. appAdminService.lambda_handler).

.....e. Select the Test Event and run a test. It will have errors saying no query string. This is OK since the function is designed to run from the API Gateway.

Comments