S3 Batch Operations: Pricing ($0.25 per Job + $1 per Million Objects), Every Operation, Creating a Job, and Fixing Failed Jobs and the 50% Failure Threshold

Logeshwaran
—

S3 Batch Operations is a managed S3 feature that runs one operation on millions or billions of objects for you. It can copy them, replace or delete their tags, restore them from Glacier, change their ACLs, update their encryption, compute checksums, set Object Lock retention or legal holds, replicate existing objects, or call a Lambda function on each one. You give it a manifest (a CSV list, an S3 Inventory report, or filters it turns into a list) and an IAM role it can assume. It runs the work in parallel, retries, and writes a completion report of every success and failure. Pricing: $0.25 per job plus $1.00 per million objects processed, on top of the normal S3 request, data and Lambda charges. When a Batch Operations job fails, it is almost always one of these. The job can't read the manifest or write the report (Access Denied, or a role whose trust policy doesn't name batchoperations.s3.amazonaws.com). The manifest is malformed (InvalidManifestContent: wrong columns, a byte-order mark, unencoded keys). Or more than 50% of tasks failed once at least 1,000 had run, usually because objects no longer exist, a KMS key policy blocks the role, Copy hits its 5 GB object limit, or a copy job was created outside the destination Region. Below: every operation, pricing with examples, manifests, the role and policies, creating a job in the console and CLI, statuses, every failure with its fix, reading the completion report, Lambda jobs, and when to use something else.

Ethan's client, an online photo-printing company, had 30 million customer photos in one S3 bucket, and a plan to save money: tag every photo older than three years with archive=true and let a lifecycle rule move tagged objects to Glacier Deep Archive. Their developer started with a script on a laptop, calling PutObjectTagging once per object. After a day it had tagged 900,000 photos. Ethan suggested S3 Batch Operations instead. The first job failed after 20 minutes with "Job failed: task failure rate exceeded 50 percent." Jake, who had come by to collect a box of prints, read the screen: "So the robot gave up because half its homework was wrong?"

⚡ Quick Answer

• What it is: one S3 operation run on a list of objects at huge scale, with retries and a report. Explained.

• Price: $0.25 per job + $1.00 per million objects, plus normal S3 and Lambda charges. Worked costs.

• Job failed? Read the failure reason: manifest access, manifest format, role trust, or more than 50% of tasks failing. Every cause.

• Some tasks failed: the completion report lists each object, its error code and message. Read the report.

Operations · Manifests · IAM role · Create a job · Statuses · Lambda jobs · Alternatives · FAQ.

New to S3 at scale? The cards below cover S3 itself, copying buckets across accounts, lifecycle rules, Glacier retrieval costs and KMS errors, all of which Batch Operations jobs run into.

🧭 NEW HERE? READ THESE FIRST

These five pages explain the pieces Batch Operations works with:

📌 Bookmark this; the failure table and the role policies are the parts you will come back for.

What is S3 Batch Operations?

Most S3 operations act on one object at a time: one PUT, one COPY, one tag change. That is fine for an application, and painful for housekeeping. Re-tagging 30 million objects means 30 million API calls; copying a billion objects to another account means a billion copy requests, each of which can fail and need a retry. Writing, running and babysitting that script is a project in itself.

S3 Batch Operations turns that project into a single job. A job has five parts:

  • A manifest: the list of objects to act on, as a CSV file, an S3 Inventory report, or a set of filters (prefix, creation date, size, storage class) that S3 turns into a list for you.
  • One operation: what to do to every object in the list, with its settings (for example "replace all tags with archive=true", or "copy to bucket X with storage class Glacier Instant Retrieval").
  • An IAM role: the identity S3 Batch Operations assumes to read the manifest, perform the operation on each object, and write the report.
  • A completion report (optional, strongly recommended): a CSV in a bucket you choose, listing the result of every task, or only the failed ones.
  • A priority: a number that decides which of your jobs runs first when several are queued.

Once the job runs, S3 does the rest: it spreads the work across its own fleet, retries tasks that fail with throttling or other temporary errors, tracks progress (you can watch the percentage complete in the console), and stops the job automatically if too many tasks fail. Each object the job touches is one task. A single job can process billions of objects and exabytes of data, and you pay nothing for servers because there are none to run.

Ethan: "A script on a laptop does 900,000 objects a day. A Batch Operations job did all 30 million in about two hours, once we fixed the list."

Jake: "And the list was the homework that was half wrong."

Every operation S3 Batch Operations can perform

OperationWhat it doesTypical use
Copy objectsCopies each object to a destination bucket and prefix, optionally changing storage class, encryption, metadata, tags or Object Lock settingsMigrating buckets or accounts, changing storage class or encryption on existing objects
Invoke AWS Lambda functionCalls your function once per objectAnything custom: resizing images, deleting objects, copying objects over 5 GB, scanning content
Replace all object tagsSets the object's tag set (replacing existing tags)Tag-based lifecycle rules, cost allocation, access control by tag
Delete all object tagsRemoves every tag from each objectUndoing a tagging mistake
Replace access control list (ACL)Sets each object's ACLCleaning up legacy ACLs before turning on bucket-owner-enforced ownership
Restore objectsStarts a restore request for objects in Glacier Flexible Retrieval or Deep Archive (or archive tiers of Intelligent-Tiering)Bringing back a large archive
Update object encryptionChanges the server-side encryption of existing objectsMoving objects to a new KMS key or encryption type
Compute checksumsCalculates checksums for objects at restVerifying data integrity after a migration
Replicate (Batch Replication)Replicates existing objects using the bucket's replication rulesBackfilling a new replication rule, retrying failed replication
Object Lock retentionSets a retention mode and dateApplying compliance retention to existing objects
Object Lock legal holdTurns legal hold on or offLitigation holds on many objects

What it does not do directly

  • Delete objects. There is no built-in delete-objects operation. For bulk deletion, use a lifecycle expiration rule (free, and the usual answer), or a Batch Operations job that invokes a Lambda function which deletes each object.
  • Copy objects larger than 5 GB. The Copy operation handles objects up to 5 GB. Larger objects need multipart copy, which you can run from a Lambda function invoked by the job (within Lambda's 15-minute limit) or with other tools.
  • Several operations in one job. Each job performs one operation. To copy and then tag, run two jobs, or use the Copy operation's own tagging settings.
  • Copy SSE-C objects. Copy supports every CopyObject option except customer-provided encryption keys (SSE-C) and ETag conditions.

S3 Batch Operations pricing, with examples

Batch Operations has two charges of its own:

  • $0.25 per job, for every job you create, whatever its size;
  • $1.00 per million object operations performed.

On top of those, you pay the normal charges for whatever the job does: S3 requests (a PUT per copy or per tag change, GET or LIST requests for reading), data transfer between Regions, storage of copies, restore fees for archived objects, KMS requests for encrypted objects, Lambda invocations and duration for Lambda jobs, and the listing work when S3 builds the manifest for you.

Batch Operations fees by job size

Objects in the jobBatch Operations fee (job + objects)Plus, for a tagging job (PUT requests at $0.005 per 1,000)
10,000$0.26$0.05
1 million$1.25$5
10 million$10.25$50
100 million$100.25$500
1 billion$1,000.25$5,000

Two things stand out. First, for almost every job the Batch Operations fee is the smaller part; the requests the operation makes cost more. Second, a failed job still costs its $0.25 and the objects it processed before stopping, which is another reason to run a small test job first. A single job can list up to about a billion objects for most operations; split bigger workloads into several jobs.

Example 1: tagging 30 million photos

  • Batch Operations: $0.25 + 30 x $1.00 = $30.25
  • PutObjectTagging requests: tagging requests are billed at the PUT rate of $0.005 per 1,000 in S3 Standard (US East), so 30,000,000 / 1,000 x $0.005 = $150
  • Total: about $180, once

That bought the photo company a lifecycle transition that cut its storage bill by thousands of dollars a month, so the payback was days. A laptop script makes the same 30 million tagging requests and pays the same $150; Batch Operations adds $30 and saves a month of babysitting.

Example 2: copying 100 million small objects to another account

  • Batch Operations: $0.25 + 100 x $1.00 = $100.25
  • COPY requests (billed as PUT in the destination): 100,000,000 / 1,000 x $0.005 = $500
  • Data transfer: free within the same Region; inter-Region copies add a per-GB transfer charge

For copies, the request charges usually outweigh the Batch Operations fee; for very large objects, data transfer and storage dominate. Our bucket copy guide compares Batch Operations with aws s3 sync and DataSync for that job.

Example 3: restoring an archive

A restore job for 2 million objects costs $0.25 + $2.00 in Batch Operations fees, plus the restore requests and retrieval per GB at the tier you choose (bulk is cheapest, expedited the most expensive). For archives, retrieval is the big number; see our Glacier retrieval cost guide before you press go.

Request prices vary by storage class and Region; Standard-IA, Glacier and other classes have different PUT and GET rates, covered in our S3 request pricing guide.

Manifests: telling the job which objects to process

The manifest is where most failed jobs begin, so it is worth getting right. You have three choices.

1. A CSV file

A CSV object in S3 with one line per object: bucket name, object key, and optionally a version ID as a third column. No header row. Example:

photos-prod,2022/01/14/order-88812/IMG_0193.jpg
photos-prod,2022/01/14/order-88812/IMG_0194.jpg
photos-prod,2022/01/15/order-88830/My%20Holiday%20%281%29.jpg

The rules that matter:

  • URL-encode the keys. Keys with spaces, plus signs, commas, quotes, non-ASCII characters or other special characters must be URL-encoded (My Holiday (1).jpg becomes My%20Holiday%20%281%29.jpg). An unencoded comma splits the line into extra columns; an unencoded space or plus can point at a different key.
  • Save as UTF-8 without a byte-order mark (BOM). Excel and some Windows editors add a BOM, which corrupts the first bucket name.
  • Same number of columns on every line, no blank lines, no trailing spaces.
  • Include version IDs only if every line has one and you mean to act on specific versions.

Building a CSV from a listing is easy with the AWS CLI, but remember to encode the keys. In Python:

import csv
from urllib.parse import quote
import boto3

s3 = boto3.client("s3")
bucket = "photos-prod"
paginator = s3.get_paginator("list_objects_v2")

with open("manifest.csv", "w", newline="", encoding="utf-8") as f:
    writer = csv.writer(f)
    for page in paginator.paginate(Bucket=bucket, Prefix="2022/"):
        for obj in page.get("Contents", []):
            writer.writerow([bucket, quote(obj["Key"], safe="/")])

Upload it (aws s3 cp manifest.csv s3://ops-batch/manifests/) and note its ETag; the CLI and API ask for it so the job knows exactly which version of the manifest to read.

2. An S3 Inventory report

S3 Inventory produces a daily or weekly list of every object in a bucket, with metadata such as size, storage class, encryption status and last-modified date. A Batch Operations job can use an inventory report's manifest.json directly. For buckets with hundreds of millions of objects, this is far faster and cheaper than listing them yourself, and you can query the inventory with Athena first to build a filtered CSV (for example, only objects older than three years in Standard).

3. A generated manifest from filters

You can skip the list entirely and give the job filters: a source bucket plus conditions such as key prefix or suffix, creation date before or after a date, object size range, storage classes, or replication status. S3 scans the bucket, builds the manifest, and can save a copy of it. This is the easiest option for "everything under 2022/ created before 2023" style jobs, and it is how Batch Replication finds objects to replicate. Save the generated manifest; it records exactly which objects the job was given.

The photo company's first job used a CSV exported from their database, not from S3. A third of the photos in it had been deleted by customers, and keys with spaces were not encoded. Those tasks failed with 404 errors, the failure rate crossed 50 percent, and the job stopped. The second job used an S3 Inventory report filtered with Athena, and finished with zero failures.

The IAM role a job needs

Every job runs as an IAM role that S3 Batch Operations assumes. Two separate permissions are involved, and both cause failures when wrong.

The person or pipeline creating the job

Needs s3:CreateJob (plus s3:DescribeJob, s3:ListJobs, s3:UpdateJobStatus and s3:UpdateJobPriority to manage jobs) and iam:PassRole on the job role.

The job role's trust policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": { "Service": "batchoperations.s3.amazonaws.com" },
      "Action": "sts:AssumeRole"
    }
  ]
}

If the trust policy names a different service (copying a role made for Lambda or EC2 is a common shortcut), the job cannot assume it and fails before doing anything.

The job role's permissions (tagging example)

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DoTheOperation",
      "Effect": "Allow",
      "Action": ["s3:PutObjectTagging", "s3:PutObjectVersionTagging"],
      "Resource": "arn:aws:s3:::photos-prod/*"
    },
    {
      "Sid": "ReadTheManifest",
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:GetObjectVersion"],
      "Resource": "arn:aws:s3:::ops-batch/manifests/*"
    },
    {
      "Sid": "WriteTheReport",
      "Effect": "Allow",
      "Action": ["s3:PutObject"],
      "Resource": "arn:aws:s3:::ops-batch/reports/*"
    }
  ]
}

Other operations need their own actions: Copy needs s3:GetObject (and GetObjectVersion, GetObjectTagging, GetObjectAcl as needed) on the source and s3:PutObject (plus PutObjectTagging, PutObjectAcl if you set them) on the destination; Restore needs s3:RestoreObject; Lambda jobs need lambda:InvokeFunction; jobs that generate a manifest need s3:ListBucket on the source bucket. If objects use SSE-KMS, the role also needs kms:Decrypt on the source key and kms:GenerateDataKey (and often kms:Encrypt) on the destination key, and the key policies must allow the role.

For cross-account jobs, the bucket policies in the other account must also allow the job role, exactly as they would for any cross-account access; our cross-account Access Denied guide shows the policy pattern.

Create a job: console and AWS CLI

In the console

  1. Open the S3 console and choose Batch Operations in the left menu, in the Region where the job should run (for Copy, the destination Region).
  2. Choose Create job.
  3. Manifest: choose an S3 Inventory report, a CSV file (browse to it), or Generate an object list with filters.
  4. Operation: choose the operation and fill in its settings (for tagging, the key and value; for Copy, the destination and storage class).
  5. Completion report: choose Failed tasks only or All tasks and a bucket and prefix for the report.
  6. Permissions: choose the job role.
  7. Review and create. The job prepares, then waits in Suspended (awaiting your confirmation) because console jobs always need it.
  8. Check the number of objects S3 found in the manifest. If it matches what you expect, choose Run job.

That confirmation step is your last chance to catch a wrong manifest: a job you expected to touch 30 million objects that shows 300 million is a job to cancel.

With the AWS CLI

Batch Operations lives in the s3control API and needs your account ID. A tagging job from a CSV manifest:

aws s3control create-job --account-id 123456789012 --region us-east-1 --operation '{"S3PutObjectTagging":{"TagSet":[{"Key":"archive","Value":"true"}]}}' --manifest '{"Spec":{"Format":"S3BatchOperations_CSV_20180820","Fields":["Bucket","Key"]},"Location":{"ObjectArn":"arn:aws:s3:::ops-batch/manifests/manifest.csv","ETag":"60e460c9d1046e73f7dde5043ac3ae85"}}' --report '{"Bucket":"arn:aws:s3:::ops-batch","Prefix":"reports","Format":"Report_CSV_20180820","Enabled":true,"ReportScope":"FailedTasksOnly"}' --priority 10 --role-arn arn:aws:iam::123456789012:role/s3-batch-tagging --description "Tag 2022 photos for archive" --no-confirmation-required

On Windows PowerShell, put each JSON value in a file and pass it as file://operation.json; that avoids quoting problems. Without --no-confirmation-required, the job waits in Suspended until you confirm it:

aws s3control update-job-status --account-id 123456789012 --job-id 00e123a4-c0d8-41f4-a0eb-b46f9ba5b07c --requested-job-status Ready

aws s3control describe-job --account-id 123456789012 --job-id 00e123a4-c0d8-41f4-a0eb-b46f9ba5b07c --query "Job.[Status,ProgressSummary,FailureReasons]"

The ETag in the manifest location must match the manifest object exactly; copy it from aws s3api head-object --bucket ops-batch --key manifests/manifest.csv (without the surrounding quotes in the JSON value). If you edit and re-upload the manifest, the ETag changes and the old value no longer matches.

With Python (boto3)

The same tagging job from Python, which is easier to automate than a long CLI line:

import boto3

account_id = "123456789012"
s3 = boto3.client("s3")
s3control = boto3.client("s3control", region_name="us-east-1")

etag = s3.head_object(Bucket="ops-batch", Key="manifests/manifest.csv")["ETag"].strip('"')

job = s3control.create_job(
    AccountId=account_id,
    ConfirmationRequired=False,
    Operation={"S3PutObjectTagging": {"TagSet": [{"Key": "archive", "Value": "true"}]}},
    Manifest={
        "Spec": {"Format": "S3BatchOperations_CSV_20180820", "Fields": ["Bucket", "Key"]},
        "Location": {"ObjectArn": "arn:aws:s3:::ops-batch/manifests/manifest.csv", "ETag": etag},
    },
    Report={
        "Bucket": "arn:aws:s3:::ops-batch",
        "Prefix": "reports",
        "Format": "Report_CSV_20180820",
        "Enabled": True,
        "ReportScope": "FailedTasksOnly",
    },
    Priority=10,
    RoleArn=f"arn:aws:iam::{account_id}:role/s3-batch-tagging",
    Description="Tag 2022 photos for archive",
)
print("Job ID:", job["JobId"])

Reading the ETag from head_object at the moment you create the job avoids the ETag mismatch failure entirely.

Terraform and infrastructure as code

Batch Operations jobs are one-off operations, not long-lived infrastructure, so most teams manage the pieces that last with Terraform or CloudFormation (the job role and its policies, the manifest and report buckets, S3 Inventory configurations) and start each job from the CLI, boto3 or a pipeline step. That also keeps a job from re-running by accident on the next terraform apply.

Run a safe test job first, step by step

Every large job should start as a tiny one. It costs a quarter and saves hours:

  1. Take the first 50 lines of your real manifest (or 50 objects that match your filters), including a few keys with spaces or special characters if your bucket has them.
  2. Upload that as manifests/test-50.csv and note its ETag.
  3. Create the job with the same operation, role and settings you plan for the full run, and set the completion report to All tasks, not only failures.
  4. Run it and wait for Complete; with 50 objects that takes a minute or two after the job becomes active.
  5. Open the report. Every line should say succeeded. For each failure, read the error code and fix the cause: permissions, KMS, encoding, object state.
  6. Check a few objects by hand: the tags, the copy in the destination, the new storage class, whatever the job was meant to change.
  7. Only then create the full job, with the report set to failed tasks only to keep it small.

Jake: "Fifty photos first. That's what my printer does, a test page before the big run."

Ethan: "Same idea. Nobody wants 30 million test pages."

Job priority, and running several jobs

Every job has a priority, a number you set when you create it (higher numbers run first). When several jobs are ready, S3 runs the higher-priority jobs first and can pause a lower-priority job that is already active; it resumes automatically when the urgent one finishes. You can change a job's priority while it waits or runs with aws s3control update-job-priority. Jobs on different buckets often run side by side, but if two jobs hammer the same prefix, they compete for the same request capacity and both slow down.

Job statuses, and what each one means

StatusMeaningWhat you do
NewJust createdWait; it moves to Preparing
PreparingReading the manifest or generating itWait; large manifests take a while
SuspendedWaiting for your confirmation (console jobs, or CLI jobs without --no-confirmation-required)Check the object count, then Run job or set status Ready
ReadyQueued to runWait; higher-priority jobs go first
ActiveRunning tasksWatch progress and failure counts
Pausing / PausedA higher-priority job took overResumes automatically when that job finishes
Completing / CompleteFinished every task (each may have succeeded or failed)Read the completion report
Canceling / Canceled (the API and console spell both with a double l)You canceled it; no new tasks startTasks already done stay done
Failing / FailedThe job could not run, or too many tasks failedRead the failure reasons, fix, create a new job

Complete, Canceled and Failed are terminal: a job in one of them never changes again, and you cannot restart it; you create a new job. Jobs, their details and their failure reasons are deleted 90 days after reaching a terminal state, so keep the completion reports (they are ordinary objects in your bucket and stay until you delete them) and any job IDs you need for audit.

Note also that "Complete" does not mean "everything worked." A job completes when it has attempted every task; some tasks may still have failed. Always check the failed task count and the report.

Why a Batch Operations job failed, and how to fix it

Start with the job's failure reasons, shown in the console on the job's details page, and in describe-job output under FailureReasons. They fall into two groups.

The job never started its tasks

  • "Reading the manifest is forbidden: AccessDenied" (or similar): the job role cannot GetObject the manifest. Add the permission, check the manifest bucket's policy, and check KMS permissions if the manifest is encrypted with SSE-KMS.
  • The manifest ETag does not match: the manifest object was changed after you copied its ETag. Use the current ETag (from head-object), or upload a new manifest under a new key.
  • InvalidManifestContent: the manifest is malformed. Typical messages are "Required fields are missing in the schema", "Manifest file is not properly formatted", "Invalid object key format", "Invalid version ID format", or that the job contains more keys than allowed in a single job. Check for a header row, a BOM, inconsistent columns, unencoded keys, blank lines, and the Fields you declared (Bucket, Key, and VersionId only if present).
  • The role cannot be assumed: the trust policy does not allow batchoperations.s3.amazonaws.com, or the creator lacks iam:PassRole. "Cross-account pass role is not allowed" means the role is in a different account from the job; the role must be in the account that creates the job.
  • The report bucket is not writable: the role needs s3:PutObject on the report bucket and prefix, and the bucket must not block it with a policy, Object Lock default retention or KMS restrictions.
  • NoSuchJobException when you look up the job: wrong Region, wrong account, a typo in the job ID, or a job older than 90 days since it finished.
  • AccessDeniedException on CreateJob itself: missing s3:CreateJob, a service control policy, or an operation not supported for the bucket type or Region.

The task-failure threshold: more than 50% of tasks failed

To stop a broken job from wasting time and money, S3 watches the task failure rate once a job has run at least 1,000 tasks. If, at any point after that, more than 50 percent of the tasks that have run have failed, the job fails. Tasks already done stay done. The fix is never "retry the job"; it is finding out why tasks fail. Run a small test job (a manifest of 50 objects, with a report of all tasks), look at the errors, fix the cause, then run the full job.

Why individual tasks fail

  • 404 NoSuchKey: the object in the manifest does not exist, because it was deleted after the list was made, the key is not URL-encoded correctly, or the bucket name is wrong. Build manifests from S3 (Inventory or a generated manifest), not from another system's records, and keep the gap between listing and running short.
  • 403 AccessDenied: the role lacks the operation's permission, a bucket policy denies it, the object is owned by another account (with ACLs still enabled), or KMS blocks it: the role lacks kms:Decrypt or kms:GenerateDataKey on the object's key, or the key policy does not allow the role. Our S3 KMS error guide covers the key policy side.
  • Object too large to copy: Copy handles objects up to 5 GB; larger ones fail. Exclude them (filter by size) and copy them with a Lambda job using multipart copy, or another tool.
  • InvalidObjectState: copying or reading an object in Glacier Flexible Retrieval or Deep Archive that has not been restored. Run a Restore job first, wait for the restores to finish, then copy.
  • Wrong Region for Copy: copy jobs must be created in the destination bucket's Region.
  • SSE-C objects: objects encrypted with customer-provided keys cannot be copied by the Copy operation.
  • Object Lock: retention on the destination or source can block overwrites and some changes; a Compliance-mode retention cannot be shortened by anyone.
  • Throttling (503 Slow Down): Batch Operations retries these, but very hot prefixes can still produce failures. Spreading keys across prefixes helps.
  • Lambda errors: the function threw an exception, timed out, returned a malformed response, or returned PermanentFailure. See Lambda jobs.

Jake: "So when half the list is wrong, it stops instead of grinding through the other 15 million?"

Ethan: "Yes, and that saved them money. The fix was a better list, not a bigger retry."

Reading the completion report, and re-running failed tasks

The completion report is a set of CSV files under the prefix you chose, plus a manifest.json that lists them. Each line describes one task: the bucket, the key, the version ID, the task status (succeeded or failed), the error code, the HTTP status code, and a result message. Reports are encrypted with SSE-S3.

For a quick look on Windows, PowerShell can summarize a downloaded report by error code:

$rows = Import-Csv .\report.csv -Header Bucket, Key, VersionId, TaskStatus, ErrorCode, HTTPStatusCode, ResultMessage
$rows | Where-Object TaskStatus -eq 'failed' | Group-Object ErrorCode | Sort-Object Count -Descending | Select-Object Count, Name

For millions of lines, query the report files in place with Athena (an external table over the report prefix) and group by error code. Then build a new manifest of only the failed keys, fix the cause, and run a new job on just those objects. Because failed tasks in the report carry their bucket, key and version, turning them into a manifest is a one-line query or script.

If you did not request a report, CloudTrail data events for S3 (if enabled) record each request the job made, and CloudWatch shows S3 request metrics if you turned them on, but neither is as convenient as the report. Always request at least a failed-tasks report.

Undoing a job that did the wrong thing

Batch Operations does exactly what you tell it, at scale, which makes mistakes large too. There is no undo button, but most operations can be reversed with another job. Keep the manifest and the report of the original job; they are the list of what to put back.

  • Wrong tags: run another job with Replace all object tags and the correct tag set, or Delete all object tags. Note that "replace" means replace: if objects had other tags you needed, the first job already removed them, and only a backup of the old tags (an S3 Inventory report can include tags if you enabled that field) lets you restore them exactly.
  • Copied to the wrong place: delete the copies, for example with a lifecycle expiration rule on the wrong destination prefix, or a Lambda delete job using the completion report as the manifest. If the destination bucket is versioned, the copies may have created new versions on top of existing objects; restore the previous versions with a copy job that lists the old version IDs.
  • Wrong storage class: copy the objects onto themselves with the right class. Moving objects out of archive classes requires a restore first, and objects in Standard-IA, One Zone-IA and the Glacier classes carry minimum storage duration charges even if you move them back early.
  • Wrong ACLs: run another Replace ACL job, or better, set Object Ownership to bucket owner enforced, which disables ACLs entirely.
  • Restore requests: a restore cannot be canceled once requested; the retrieval charges are incurred. Double-check restore jobs before confirming them.
  • Object Lock retention in compliance mode: cannot be shortened or removed by anyone, including the root user, until it expires. Test retention jobs on a small set first, and use governance mode while you are still learning.

Turning on versioning before large copy or tagging jobs on important buckets makes most mistakes recoverable, because overwritten objects keep their previous versions.

Versioned buckets: which version does the job touch?

In a versioned bucket, a manifest line without a version ID means the current version of the object. A line with a version ID means that specific version, and the job role then needs the version-specific permissions (s3:GetObjectVersion, s3:PutObjectVersionTagging, and so on). S3 Inventory can list current versions only or all versions; choose deliberately. Tagging all versions of a photo is a different job from tagging the version customers see, and lifecycle rules for noncurrent versions behave differently from rules for current ones.

Batch Operations jobs that invoke Lambda

Invoking Lambda makes Batch Operations do anything you can write in code, one object per call. The job sends your function an event describing one task, and your function must reply with a result for that task.

import urllib.parse
import boto3

s3 = boto3.client("s3")

def handler(event, context):
    results = []
    for task in event["tasks"]:
        bucket = task["s3BucketArn"].split(":::")[-1]
        key = urllib.parse.unquote_plus(task["s3Key"])
        try:
            s3.delete_object(Bucket=bucket, Key=key)   # your per-object work here
            results.append({"taskId": task["taskId"], "resultCode": "Succeeded", "resultString": "deleted"})
        except s3.exceptions.ClientError as err:
            code = err.response["Error"]["Code"]
            outcome = "TemporaryFailure" if code in ("SlowDown", "InternalError") else "PermanentFailure"
            results.append({"taskId": task["taskId"], "resultCode": outcome, "resultString": code})
    return {
        "invocationSchemaVersion": event["invocationSchemaVersion"],
        "treatMissingKeysAs": "PermanentFailure",
        "invocationId": event["invocationId"],
        "results": results,
    }

The details that trip people up:

  • Keys arrive URL-encoded in the event (in the default 1.0 invocation schema), so decode them before calling S3, or the function looks for a key that does not exist and the task fails with 404.
  • Every task needs a result with the same taskId, and the response must echo the invocationSchemaVersion and invocationId. A malformed response fails the task.
  • Result codes: Succeeded; TemporaryFailure (Batch Operations retries the task); PermanentFailure (no retry, recorded in the report). Use TemporaryFailure only for errors a retry can fix, such as throttling.
  • Timeouts and concurrency: each call must finish within the function's timeout (15 minutes at most). Batch Operations can invoke your function at high concurrency; reserved concurrency on the function caps it, and Lambda throttling becomes temporary failures that are retried.
  • Permissions: the job role needs lambda:InvokeFunction; the function's own execution role needs whatever the function does to S3 (here, s3:DeleteObject).
  • Use a specific version or alias of the function, so changing the code mid-job does not change the job's behavior.

Getting notified when a job finishes or fails

Large jobs run for hours, and nobody should refresh the console that long. Batch Operations records status changes as events through CloudTrail, and an EventBridge rule can send them to email, chat or a function. A pattern that matches job status changes:

{
  "source": ["aws.s3"],
  "detail-type": ["AWS Service Event via CloudTrail"],
  "detail": {
    "eventSource": ["s3.amazonaws.com"],
    "eventName": ["JobStatusChanged"]
  }
}

Point the rule at an SNS topic for an email when a job completes or fails, or at a Lambda function that reads the job's report and posts the failure count to your team chat. A CloudTrail trail must be enabled in the account for these events to flow. Remember that Batch Operations jobs also generate CloudTrail data events for every object they touch if you log data events on the bucket, which on a 30-million-object job means 30 million log entries and the matching CloudTrail charges; exclude the bucket or the operation from data event logging if you do not need them.

Jake: "So your phone buzzes when the robot finishes its homework."

Ethan: "Or when it gives up on it. That's the one I care about."

Batch Operations vs lifecycle rules, sync, DataSync and replication

  • Deleting or archiving by age: use lifecycle rules. Expiration and transitions are automatic, need no manifest, and expirations are free. Batch Operations is for when the rule needs a condition lifecycle cannot express, which is exactly why the photo company used it to tag objects that a lifecycle rule then archived. Our lifecycle rule guide covers the timing and filters.
  • Copying a bucket once, up to a few million objects: aws s3 sync from an EC2 instance in the same Region is simple and fine.
  • Copying huge buckets, or between accounts, with an audit trail: Batch Operations Copy (objects up to 5 GB) with a completion report.
  • Ongoing copying of new objects: S3 Replication (same-Region or cross-Region) for every new object, plus Batch Replication to backfill objects that existed before the rule; our replication guide covers the setup.
  • Moving data from file systems or other clouds into S3: AWS DataSync.
  • Undeleting objects in a versioned bucket: a Batch Operations Copy of the previous versions, or deleting the delete markers with a Lambda job; see our restore deleted objects guide.

Habits that keep jobs from failing

  • Build manifests from S3 itself (Inventory or a generated manifest), never from another system's list.
  • Run a 50-object test job with an all-tasks report before every large job.
  • Use the confirmation step and check the object count.
  • Give the role exactly the actions the operation needs, plus manifest read, report write, and KMS permissions for encrypted objects.
  • Filter out objects the operation cannot handle (over 5 GB for Copy, archived objects, SSE-C).
  • Always request a completion report, and keep it after the job is gone.
  • Use priorities so urgent jobs run first, and tag jobs (and the role) for cost tracking.

Frequently asked questions

What is S3 Batch Operations?

An S3 feature that performs one operation, such as copy, tagging, restore, ACL changes, encryption updates or a Lambda function, on a list of objects at large scale, with retries, progress tracking and a completion report.

How much does S3 Batch Operations cost?

$0.25 per job plus $1.00 per million objects processed, plus the normal S3 request, data transfer, storage, KMS and Lambda charges of the operation itself.

Why did my S3 Batch Operations job fail?

Usually the job role cannot read the manifest or write the report, the manifest is malformed, the role's trust policy does not allow batchoperations.s3.amazonaws.com, or more than 50% of tasks failed after at least 1,000 ran. Check the job's failure reasons.

What is the S3 Batch Operations failure threshold?

Once a job has run at least 1,000 tasks, it fails if more than 50 percent of the tasks run so far have failed. Fix the cause with a small test job before re-running.

Can S3 Batch Operations delete objects?

Not directly; there is no delete-objects operation. Use a lifecycle expiration rule, or a Batch Operations job that invokes a Lambda function to delete each object.

What is the maximum object size for S3 Batch Operations Copy?

5 GB per object. Copy larger objects with multipart copy, for example from a Lambda function invoked by a Batch Operations job.

What format does the S3 Batch Operations manifest use?

A CSV with bucket name, URL-encoded object key and optional version ID per line, no header, UTF-8 without BOM; or an S3 Inventory manifest.json; or filters that generate a manifest.

What IAM role does S3 Batch Operations need?

A role whose trust policy allows batchoperations.s3.amazonaws.com, with permissions for the operation, to read the manifest and to write the completion report, plus KMS permissions for encrypted objects. The creator needs iam:PassRole.

Why is my S3 Batch Operations job stuck in Suspended?

It is waiting for confirmation. Jobs created in the console, or in the CLI without --no-confirmation-required, need you to choose Run job or set the status to Ready.

Can I restart a failed S3 Batch Operations job?

No. Failed, complete and canceled jobs are in final states and never run again. Fix the cause, build a manifest of the remaining or failed objects, and create a new job.

How long are S3 Batch Operations jobs kept?

Job records are deleted 90 days after the job reaches a terminal state. Completion reports are objects in your bucket and stay until you delete them.

Why do my Lambda-invoked tasks fail with 404?

The function used the URL-encoded key from the event without decoding it. Decode with urllib.parse.unquote_plus (Python) or decodeURIComponent after replacing plus signs (JavaScript).

In which Region should I create a Batch Operations copy job?

In the destination bucket's Region. Other operations run in the Region of the objects they act on.

How do I find which objects failed?

Read the completion report: each line has the bucket, key, version, task status, error code, HTTP status and a message. Query large reports with Athena and build a new manifest from the failed lines.

Should I use S3 Batch Operations or lifecycle rules?

Lifecycle rules for anything expressible as age, prefix or tag based transitions and expirations, since they are automatic and expirations are free. Batch Operations for one-time bulk changes, copies, restores, tagging and custom per-object work.

Does S3 Batch Operations work across accounts?

Yes. The job and its role live in your account; the other account's bucket policies (and KMS key policies) must allow the role, as with any cross-account access.

For readers preparing for an AWS certification

We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.

Exams that test this topic: Solutions Architect – Associate (SAA-C03) • CloudOps Engineer – Associate (SOA-C03) • Data Engineer – Associate.

Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:

1. A company must add a tag to 200 million existing S3 objects so a lifecycle rule can archive them, with a report of any failures. What is the most operationally efficient approach?

An S3 Batch Operations job with the Replace all object tags operation and a completion report.

2. What is the most efficient way to give an S3 Batch Operations job the list of objects in a bucket with hundreds of millions of objects?

An S3 Inventory report as the manifest (or a generated manifest from filters).

3. Which service principal must the IAM role trust for S3 Batch Operations to assume it?

batchoperations.s3.amazonaws.com.

4. An S3 Batch Operations job fails after 1,500 tasks with more than half of them failed. What does S3 do, and what should the team do?

S3 fails the job at the 50% task-failure threshold; find the cause in the completion report with a small test job, then create a new job.

5. Existing objects in a bucket must be copied to a new bucket in another Region to backfill a new replication rule. What should be used?

S3 Batch Replication.

6. A Batch Operations Copy job fails for some objects with errors about their size. What is the limit?

5 GB per object; larger objects need multipart copy, for example from a Lambda function invoked by the job.

7. Thousands of archived objects in S3 Glacier Deep Archive must be restored. How can this be done at scale?

An S3 Batch Operations Restore job.

Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.

πŸ“š ALSO READ

Where to go next, from replication to request pricing:

📌 Bookmark this; the failure table and the role policies are the parts you will come back for.

The second job, built from an S3 Inventory report filtered in Athena, tagged 21.4 million photos in just under two hours with zero failures; the lifecycle rule moved them to Glacier Deep Archive over the following days. The company's storage bill dropped by more than two thirds. The developer kept the laptop script, renamed it do-not-run.py, and pinned the 50-object test job to the team wiki as step one of every bulk change.

📌 If you keep one line from this page

S3 Batch Operations runs one operation on millions of objects for $0.25 per job plus $1 per million objects; when a job fails, read its failure reasons (manifest access or format, role trust, or the 50% task-failure threshold), fix the list or the permissions with a 50-object test job, then run a new job.

URL-encode keys · Copy is 5 GB max and runs in the destination Region · always keep a completion report.

Revision note. Written October 21, 2026. Prices are US East list prices on that date. We will update this page when S3 Batch Operations features or prices change.

Related