Create an object by combining parts that have already been uploaded using multipart upload, and complete the multipart upload.
Syntax
The complete-multipart-upload syntax is as follows:
aws s3api complete-multipart-upload \
--bucket <bucket> \
--key <key> \
--upload-id <upload-id> \
--multipart-upload <multipart-upload> \
[--mpu-object-size <mpu-object-size>] \
[--sse-customer-algorithm <sse-customer-algorithm>] \
[--sse-customer-key <sse-customer-key>] \
[--sse-customer-key-md5 <sse-customer-key-md5>] \
--endpoint-url <endpoint-url>
Options
This section describes the options available when running complete-multipart-upload.
Required options
The following options are required for complete-multipart-upload.
| Options | Type | Required | Description |
|---|---|---|---|
--bucket |
String | Required | Bucket name |
--key |
String | Required | Object name |
--upload-id |
String | Required | Multipart upload ID |
--multipart-upload |
String | Required | List of parts to combined
|
Optional options
These are the optional options for complete-multipart-upload. Options that are not specified will use their default values.
| Options | Type | Required | Description |
|---|---|---|---|
--mpu-object-size |
Long | Optional | Expected total object size for the multipart upload request
|
--sse-customer-algorithm |
String | Optional | User encryption algorithm (AES256) |
--sse-customer-key |
String | Optional | User-provided encryption key |
--sse-customer-key-md5 |
String | Optional | User-provided encryption key's MD5 value |
Common options
For information about the options common to all aws subcommands, see Object Storage options.
Examples
If the request to complete a multipart upload is successful, the identification information and location information for the created object are returned.
Command
The command example is as follows:
aws s3api complete-multipart-upload --bucket my-test-bucket \
--key large.bin \
--upload-id {upload_id} \
--multipart-upload file://mpu.json \
--endpoint-url=https://kr.object.ncloudstorage.com
- mpu.json example
{
"Parts": [
{
"PartNumber": 1,
"ETag": "\"8f4e33f3dc3e414ff94e5fb6905cba8c\""
},
{
"PartNumber": 2,
"ETag": "\"57325bca2c5c2cb6adf5aa9a66fb4e2d\""
},
...
]
}
Output
The output example is as follows:
{
"Location": "http://kr.object.ncloudstorage.com/my-test-bucket/large.bin",
"Bucket": "my-test-bucket",
"Key": "large.bin",
"ETag": "\"1b3e2fdb09fcd6df94df5567914a17d4-2\""
}