‫So there is another use case for EFS three access points
‫and it's called S3 Object Lambda.
‫So the idea is that you have an S3 bucket,
‫but you want to modify the object
‫just before it is being retrieved by a color application.
‫And instead of, for example
‫duplicating our buckets to have different versions
‫of each object, we can use S3 Object Lambda instead.
‫And for this, we need the S3 access points that we just saw.
‫So how does that work?
‫Say we have the cloud and we have an S3 bucket in it.
‫So an E-commerce application maybe owns the data
‫in this S3 bucket
‫and so they're able to access directly the S3 buckets
‫and put and get the original object out of it.
‫But then an analytics application may want to
‫only have access to the redacted object.
‫That means that some data has been deleted from the object.
‫And so instead of creating a new S3 bucket for this
‫what we can do is that we create an S3 access point
‫on top of a S3 bucket and is connected to a Lambda function.
‫Now, we haven't seen Lambda in depth,
‫but a Lambda function allows you to run a bit of code
‫in the cloud very easily.
‫And so this Lambda function is going to redact the object
‫as it is being retrieved.
‫And on top of this Lambda function,
‫we're going to create an S3 object Lambda access point.
‫And, this is how the analytics application is
‫going to access our S3 buckets.
‫So to summarize
‫the analytics application accesses our S3 Object
‫Lambda access points, which invokes our Lambda function.
‫Our Lambda function is going to retrieve the data
‫from the S3 bucket and runs some code to redact the data.
‫And therefore the analytics application is
‫obtaining a redacted object from the very same S3 bucket
‫as the E-commerce application.
‫Now, a marketing application may want to have access
‫to an enriched object, and they have a customer
‫loyalty database to enhance the data.
‫So instead of, again, creating a new S3 bucket and
‫creating all the objects with all the enriched data.
‫What we can do is, again, using a Lambda function.
‫So another piece of code.
‫And this one will enrich the data by looking it up
‫from the customer loyalty database.
‫And therefore we can also create an object
‫Lambda access point on top of it.
‫And therefore our marketing application
‫can access this access point,
‫this S3 object Lambda access point to get, again
‫the enriched objects.
‫As you can see, we only need one S3 bucket
‫but we can create access points
‫and object Lambda to modify the data
‫as we wish.
‫So the use cases for it is to redact, for example, PII data.
‫So personally identifiable information, for analytics
‫or non-production environments, or for example
‫to convert data from XML to JSON or to perform any kind
‫of transformation you want.
‫For example resizing and watermarking images on the fly
‫but the watermark is specific
‫to the user who request the object.
‫So that's kind of a cool usage for S3 Object Lambda.
‫So I hope you liked it,
‫and I will see you in the next lecture.