Let's go ahead and look at triggers and events here. In AWS Lambda in the console, you can notice that this API Gateway is triggered, but if I wanted to add a different kind of trigger, we want to add and selected, for example, an S3 trigger. We can go down here and find it. What it'll do is, it'll ask me to list the bucket, then also ask me to list what kind of event I'd want to monitor. Then I could do things like look for images, for example, and then invoke a Lambda function. What we're going to look at next here is an example of how to use something that does that kind of a trigger. In this particular repo, I have some code here and we can take a look at it. What it does is, it finds in particular the labels for an image that you put into an S3 bucket. We drop an image inside, it goes through and uses the AWS recognition, detect labels command, and then it goes through and prints out those labels. Then inside of this Lambda handler, what happens is that it listens for the event of an object being placed inside of the bucket. This is a great pattern here that can be used for many different kinds of applications. We can actually take a look at this in action by going over to this particular Lambda. Let's go ahead and scroll over here and find that particular Lambda. Here we go, S3 bucket label. What's great about this is, if I look through here, I can just see the same piece of code, and in particular, we can actually see where this S3 trigger is set up. If I go through here, notice that it says it's on object creation. Actually, the Lambda is called on the particular bucket, Lambda-trigger-demo-duke. Let's go ahead and find that out. What I can do is I can open up a new console window here, go to S3, and then find that particular bucket. Let's see here, I think it had the word duke in it, so let's go ahead and find this. Here we go, Lambda-trigger-demo-duke. We can see that there's already a couple of pictures in there where I've tested it earlier, so I'm going to go over to this picture of a tiger here and I'm going to go ahead and download this. We'll go ahead and download this picture here. Let's go ahead and do this. Go ahead and put that thing down. Great. Now, if I go over to this bucket and I go ahead and drop an image in there. Let's go ahead and say Upload. I can select from the downloads that I just added. Here we go. We can go to that Downloads directory. Here's the picture, and go ahead and say Upload. Perfect. It's uploading inside of this directory. Then the next thing that I can do is actually see how it actually was called. So if I go back to this Lambda, the way to verify what it did is to look on the monitor window and then say, View Logs in CloudWatch. Then this will allow us to see those print statements that show exactly what it did. Here we go. Look, here's the name of that file, pexels-flickr-145939. Notice that it said it found these labels, and these labels are exactly the labels I would expect. It's a tiger, its wildlife, and it's able to automatically do those actions. Now later, maybe you'd want to put this in some other location or put it into a database. But in general, that's how a bucket works. In fact, we can even look at this in action if I go to this diagram that I've got here, which is Serverless Image Label Trigger. This is really what's going on, is we have a bucket, I drop this image into the bucket. It goes, it sets up that trigger. We're able to use the recognition API. It goes through and then writes off that computer vision label to some other location. Again, it could be a database, it could be another S3 location. One final thing to show here is, if I go back to my Cloud9 environment, I can select AWS and I can find that trigger, which again is called s3-bucket-label. Let's just double-check that that's the one we want. Yes, s3-bucket-label, that's the one we want. If I right-click on this, I can say Import. Import is a pretty cool little command here. It will grab that external function and actually pull down the source code right inside of my local environment. Take a look at this. Inside here, we can see that I actually now have the capability to edit this. If I wanted to, even copy. If I had special test functions inside of there, it would put those inside of there. One of the great workflows is the ability to not only put things up into the Cloud with Cloud9, but also to test them like we just did, and also to pull back into Cloud9 and edit it.