- All right, so let's run through a use case
of image processing with AWS Lambda.
In this scenario, we're going to have
our mobile application users upload images,
and have those images be processed
into various size thumbnails.
Now, I think we all know that the Internet loves cats.
In this case, we have an application
dedicated to uploading pictures of cats.
The first thing that we need to do
is enable our mobile application
to have direct access to an Amazon service,
such as the Amazon Simple Storage Service.
Now, by doing this, by uploading directly
to an Amazon service,
that enables us to bypass our backend API
and it can help reduce the load on that API.
The first thing that we're going to do
is leverage the Amazon Cognito service,
which, in turn, can interact with major login providers
like Facebook and Twitter
in order to have our user login with those services.
By leveraging Amazon Cognito,
we don't have to worry about the details of logging in
with Facebook versus Twitter versus Google and so on.
All we do is ask Amazon Cognito to handle that stuff for us.
The first step is that the user will log in
with Facebook or Twitter,
Amazon Cognito handles the details
and returns temporary credentials, as we've talked about,
back to our mobile application.
Now, again, those temporary credentials
will only live for perhaps 15 minutes, so once they expire,
we don't have to worry about rotating them,
we don't have to worry about embedding credentials
into our application.
Once our application has those temporary credentials,
we can then upload directly
to an Amazon Simple Storage Service bucket.
From there, once the image lands in that bucket,
an event will be fired that we can tie
into a Lambda function,
and the Lambda function can be invoked by that event.
Details about that image will be delivered to the function.
The function can then download the image
from that S3 bucket,
process it into various size thumbnails
for different size devices,
and then store the processed images
in yet another Simple Storage Service bucket.
From there, this particular bucket would be used
as what we call a distribution origin
for the Amazon CloudFront service,
Amazon CloudFront being our content delivery network.
From there, those images will be served from edge locations
out to the other millions of devices
out there on the Internet
that are viewing these pictures of cats.
You can see here, by doing this,
we don't have any infrastructure to maintain.
We don't have EC2 instances that we need
to launch and manage and create.
We don't have, really, even an API
that we have to worry about.
In this particular example,
we're leveraging services that are already
inherently highly available and fall tolerant.
For application developers, leveraging services like this
can really ease development and speed our time to market.
Now, as we go forward,
we will see some of these use cases in demos
that are introducing services
that we haven't yet talked about,
but the point here is to spur your imagination.
I want you to start thinking of the possibilities
of things that can be done within Amazon Web Services.
I want you to start to see
just how flexible all of these services are
and how they can interact and play with each other
to achieve just about anything you can imagine.
Again, this is image processing
with leveraging Amazon Simple Storage Service,
Amazon CloudFront, and AWS Lambda.