3. S3 Event Notification

EBS limit predictions should be generated off of the latest version of the historical_data.csv file that is uploaded to the input S3 bucket. Therefore, WeeklyForecastHandlerLambda needs to be made aware of any new version, so that it can process the data further in Forecast.

For this to happen, you need to create an S3 event notification with the WeeklyForecastHandlerLambda as the destination. This will ensure that whenever there is a new version of historical_data.csv uploaded to the S3 bucket via PUT, the lambda function will process the file in Amazon Forecast if it has been a week since the last prediction.

  1. Click on the Services dropdown at the very top of the AWS Management console
  2. Find the Lambda service and go to its page
  3. Click on WeeklyForecastHandlerLambda from the list of functions
  4. Click on Add trigger
    • Under the Trigger configuration dropdown, select S3
    • In the Bucket dropdown choose your input S3 bucket name (NOTE: Every S3 input bucket name is unique per account)
    • Under Event Type choose PUT
    • In the Suffix field type .csv
    • Leave the trigger enabled and click Add

Repeat steps 1-4 above for the EbsLimitIncreaseRequestorLambda as well, only change the S3 bucket name in step 4.b to the output bucket rather than the input. This way when Amazon Forecast PUT’s its export in the output S3 bucket, the lambda can process it further to make needed limit increase requests for EBS. You will see how this works later in the lab.