The final Lambda function that you create for this tutorial creates an import job
in Amazon Pinpoint.
The import job imports the files in the processed folder of your Amazon S3
bucket. Although the processed folder might contain several files, the
import job creates a single segment that contains all of the endpoints within those
files.

This function uses a test to ensure that all of the files that were generated by the
previous Lambda functions are present before starting the import job. It also checks
to see
if you've created any import jobs that refer to the same folder, in order to prevent
the
creation of duplicate segments.

Step 6.1:
Create the Function

The process of creating the final Lambda function is much simpler than for the previous
two functions, because you don't need to import any external libraries.