copy-object

Prev Next

Available in Classic and VPC

Copy an object stored in Ncloud Storage. Copying is only possible between buckets in the same Region.

Commands

The command statement is as follows:

aws s3api copy-object --bucket <value> --copy-source <value> --key <value> [--options]
Note

You can copy objects up to 5 GB in size with a single copy operation. To copy objects larger than 5 GB, use upload-part-copy.

Parameter

The following describes the parameters.

Parameter Type Required Description Restrictions
--bucket <value> string Y Name of the target bucket to copy the object to -
--copy-source <value> string Y Source object to copy Up to 5 GB can be copied.
--key <value> string Y Name (key value) of the object to save -
--endpoint-url <value> string Y Specify the default URL for command calls. It is only available for the KR Region. See Ncloud Storage overview for call domain information.
--cache-control <value> string N Set caching behavior. -
--content-disposition <value> string N Specify representation information for the object. -
--content-encoding <value> string N Set content encoding. -
--content-language <value> string N Set content language. -
--content-type <value> string N Define explicit content type. -
--metadata <value> string N Set up metadata to store with the object. -
--metadata-directive <value> string N Set the x-amz-metadata-directive header for the CopyObject operation. If this option is enabled, --copy-props is disabled.
--storage-class <value> string N Specify the storage class for storing the object. Available options
  • STANDARD
  • DEEP_ARCHIVE
  • * Default: Store in the Standard class.
--cli-input-json | --cli-input-yaml string N Enter arguments from the provided json or yaml string. You can't specify json and yaml together.
--generate-cli-skeleton <value> integer N Create a parameter template that can be used as input later without executing the API command. -
--debug boolean N Use debug logging. -
--no-verify-ssl boolean N Redefine the default behavior for validating SSL certificates. -
--no-paginate boolean N Disable automatic pagination, call only the first page for results. -
--output <value> string N Specify the format of response results. Available options
  • json
  • text
  • table
  • yaml
  • yaml-stream
--query <value> string N JMESPath query to use for filtering response data -
--profile <value> string N Use a specific profile in the credentials file. -
--region <value> string N Specify the Region. Only KR is supported.
--color <value> string N Set output color. Available options
  • on
  • off
  • auto
--no-sign-request boolean N Disable credential loading. -
--ca-bundle <value> string N Specify the CA certificate to use when verifying SSL certificates. -
--cli-read-timeout <value> int N Maximum read time; entering 0 changes it to a blocked status instead of a timeout. It is set to 60 seconds by default.
--cli-connect-timeout <value> int N Maximum connection time; entering 0 changes it to a blocked status instead of a timeout. It is set to 60 seconds by default.
--no-cli-pager boolean N Disable the CLI pager for response values. -
--cli-auto-prompt boolean N Enable automatic prompting for CLI input parameters. -
--no-cli-auto-prompt boolean N Disable automatic prompting for CLI input parameters. -
--sse-customer-algorithm string N User encryption algorithm (AES256) -
--sse-customer-key string N User-provided encryption key -
--sse-customer-key-md5 string N User-provided encryption key's MD5 value -
--copy-source-sse-customer-algorithm string N User encryption algorithm (AES256) of the source -
--copy-source-sse-customer-key string N User-provided encryption key of the source -
--copy-source-sse-customer-key-md5 string N MD5 value of the source user-provided encryption key -

Permission

For a sub account user to use this command, they must have View/GetObject (bucket where the object to be copied is stored) and Change/PutObject (target bucket where the object will be stored) action permissions.

Examples

This section describes an example of calling and responding to the copy-object command.

Copy object stored in bucket with version control enabled

Call examples

You can copy objects by specifying the destination bucket to store the objects and the source objects to copy, and then calling the command. If you do not specify a storage class, the objects are stored in the Standard Class. The following is a call example.

aws s3api copy-object --bucket bucket-a --copy-source test-abcd/img/image.png --key img.png \
--endpoint-url=https://kr.ncloudstorage.com 

Response example

The response example is as follows:

{
    "CopySourceVersionId": "54321fd4-0613-11f0-954d-a4f5ef94c2b0",
    "CopyObjectResult": {
        "ETag": "\"12345678a25da72de9ec3094a1f30cb6\"",
        "LastModified": "2025-03-26T12:25:27+00:00"
}

Related commands

Related commands are as follows: