At the command prompt, run the following Lambda AWS CLI
create-function command using the
adminuser as the
--profile. You need to update the command by providing the .zip file
path and the execution role ARN. For the runtime parameter, choose between
nodejs6.10, nodejs4.3, python3.6, python2.7
or java8, depending on the code sample you when you created your deployment package.

Optionally, you can upload the .zip file to an
Amazon S3 bucket in the same AWS region, and then specify the bucket and
object name in the preceding command. You need to replace the
--zip-file parameter by the --code
parameter, as shown following:

Copy

--code S3Bucket=bucket-name,S3Key=zip-file-object-key

Write down the function ARN. You will need this in the next
section when you add notification configuration to your Amazon S3 bucket.

(Optional) The preceding command specifies a 10-second timeout
value as the function configuration. Depending on the size of
objects you upload, you might need to increase the timeout value
using the following AWS CLI command.

Run the following Lambda CLI invoke command to invoke
the function. Note that the command requests asynchronous execution. You can
optionally invoke it synchronously by specifying
RequestResponse as the invocation-type parameter
value.

You are able to invoke this function because you are using
your own credentials to invoke your own function. In the next
section, you configure Amazon S3 to invoke this function on your
behalf, which requires you to add permissions to the access
policy associated with your Lambda function to grant Amazon S3
permissions to invoke your function.

Verify that the thumbnail was created in the target bucket and monitor the activity
of your Lambda function in the
AWS Lambda console as follows:

The AWS Lambda console shows a graphical
representation of some of the CloudWatch metrics in
the Cloudwatch Metrics at a
glance section for your
function.

For each graph, you can also click the
logs link to view the
CloudWatch Logs directly.