So now let's talk about
the S3 Batch Operation.
So this allows you to perform bulk operations
on existing S3 objects with a single request.
For example, and there are lots of use cases, right?
You can modify all the object metadata
and properties of many S3 objects at a time.
Or you can copy objects between S3 buckets
as a batch operation.
Or, something that can come up in exam,
is to encrypt all the un-encrypted objects
in your S3 buckets.
Or to modify ACLs, or tags.
Or to restore many objects at a time from S3 Glacier.
Or to invoke a Lambda function,
to perform whatever custom action you want
on every object from your S3 Batch Operation.
So, the idea is that you can do whatever operation you want
on the list of objects.
And so therefore, a job consists of a list of objects,
the action to perform,
as well as optional parameters.
So why we reuse S3 Batch Operations
versus scripting it ourselves?
Well, because when we use the S3 Batch Operation,
there is a management of retries.
We can track the progress.
We can send completion notifications,
generate reports and so on.
And you may ask me,
well, how do we generate a list of objects
to pass to S3 Batch?
Well for this, you can use a feature from S3,
call the S3 Inventory,
to get the object list,
and use S3 Select to filter your objects.
So using S3 Inventory and then S3 Select,
we get a filtered list of objects
that we want to include in our Batch Operation.
We pass it to the Batch Operation,
plus whatever operation we wanna do,
as well as some parameters.
And then S3 Batch will do its thing
and process the objects.
So again, one main use case is to find all the
un-encrypted objects using S3 Inventory.
And then encrypt them all at once
using an S3 Batch Operation.
So, that's it for this lecture.
I hope you liked it.
And I will see you in the next lecture.