Create Lambda Funtions

Create two Lambda Functions

(1)Lambda Function name: csv_sloshingprediction1 (Same as the old csv_sloshingprediction)
This Lambda function is designed to process a CSV file retrieved from the S3 bucket inferencefilecsv1. The file contains data intended for sloshing prediction analysis
It forwards the necessary parameters to a primary Lambda function tasked with generating predictions, utilizing an AI model specifically trained for high-accuracy sloshing predictions
S3_18
Click on 함수 생성
S3_25
I am going to copy and paste the Lambda function which I created from scratch so I will select 새로 작성
The name of the function is csv_sloshingprediction1
I would set the Python runtime Python3.9, identical to the old lambda function csv_sloshingprediction
To use the role I already created in the IAM, I will select 기존 역할 사용
And on the bottom select S3ReadEventRole
Then click on 함수 생성
=> Now created S3 bucket and Lambda
Lambda1
Add a trigger by clicking on + 트리거 추가
Lambda2
Chose the source S3
Choose the bucket inferencefilecsv1, which contains the data intended for sloshing prediction analysis in a csv file format
Chose the Event type PUT
(Lambda will be triggered when we put inside the object)
Wouldn’t want to change anything from prefix or suffix
Checked on the warnings, stating that different S3 buckets are needed for inputs and outputs
Lambda3 Trigger successfully added to Lambda
Copy and paste the code from the old lambda function csv_sloshingprediction
Pressed Deploy, to deploy the Lambda Function
Reference:
https://www.youtube.com/watch?v=wk8Lk8R7Pck

(2)Lambda Function name: sloshing-service-dev-predict-sloshing1 (Same as the old sloshing-service-dev-predict-sloshing)
This function is responsible for making sloshing predictions using a pre-trained AI model. It operates based on parameters received from the csv_sloshingprediction1 Lambda function
The deployment of this Lambda function is managed through the Serverless Framework under the csv_sloshingprediction1 configuration