← All posts
2 min read

Start an S3 multipart upload

#aws#cli#s3#storage
📑 On this page

Part 44 of AWS from Zero. This lesson keeps the scope to one S3 behavior you can verify from the terminal.

What we are learning

Multipart upload creates an upload session before any parts are sent. The returned upload ID identifies that unfinished upload.

Before you run it

aws sts get-caller-identity
REGION="ap-south-1"
BUCKET="replace-with-your-private-demo-bucket"

Use a private general purpose bucket that you own. Replace every placeholder before running a write or delete command.

Cost note: Uploaded parts consume storage until the multipart upload is completed or aborted.

The command

UPLOAD_ID=$(aws s3api create-multipart-upload \
  --bucket "$BUCKET" \
  --key large-demo.bin \
  --checksum-algorithm SHA256 \
  --query UploadId \
  --output text)
echo "$UPLOAD_ID"

A successful configuration command may return no output. Treat inspection as a separate required step.

Inspect the result

aws s3api list-multipart-uploads \
  --bucket "$BUCKET" \
  --query "Uploads[].{Key:Key,UploadId:UploadId,Started:Initiated}" \
  --output table

Read the returned fields rather than assuming the write succeeded exactly as intended.

One tiny variation

aws s3api create-multipart-upload \
  --bucket "$BUCKET" \
  --key large-private.bin \
  --server-side-encryption AES256

Encryption and metadata are chosen when the multipart upload is initiated, not when individual parts are uploaded.

Common mistake

Starting an upload does not create a usable object. It leaves an incomplete upload that stores billed parts until completed, aborted, or cleaned by lifecycle.

Cleanup

aws s3api abort-multipart-upload \
  --bucket "$BUCKET" \
  --key large-demo.bin \
  --upload-id "$UPLOAD_ID"

Abort every demonstration upload ID that you do not complete.

Next, we will learn Upload one S3 multipart part.

Official AWS CLI reference