Renaming and moving objects
To work with objects in an encrypted bucket, a user or service account must have the following roles for the encryption key in addition to the storage.configurer
role:
kms.keys.encrypter
: To read the key, encrypt, and upload objects.kms.keys.decrypter
: To read the key, decrypt, and download objects.kms.keys.encrypterDecrypter
: Includes thekms.keys.encrypter
andkms.keys.decrypter
permissions.
For more information, see Key Management Service service roles.
Renaming
-
If you do not have the AWS CLI yet, install and configure it.
-
To rename an object, run this command:
aws --endpoint-url=https://storage.yandexcloud.net/ \ s3 mv s3://<bucket_name>/<object_key> s3://<bucket_name>/<new_object_key>
Where:
--endpoint-url
: Object Storage endpoint.s3 mv
: Command to rename or move an object. To rename an object, specify the bucket name and the current key of the object to be renamed in the first part of the command and the bucket name and a new object key in the second part.
Result:
move: s3://<bucket_name>/<object_key> to s3://<bucket_name>/<new_object_key>
For more information about the aws s3 mv
command, see the AWS CLI Command Reference
Moving
-
If you do not have the AWS CLI yet, install and configure it.
-
To move an object, e.g., from one bucket to another, run this command:
aws --endpoint-url=https://storage.yandexcloud.net/ \ s3 mv s3://<source_bucket_name>/<object_key> s3://<target_bucket_name>/<object_key>
Where:
--endpoint-url
: Object Storage endpoint.s3 mv
: Command to rename or move an object. To move an object, specify the name of the source bucket and the key of the object to be moved in the first part of the command and the name of the target bucket and the object key in the second part.
Result:
move: s3://<source_bucket_name>/<object_key> to s3://<target_bucket_name>/<object_key>
For more information about the aws s3 mv
command, see the AWS CLI Command Reference
In Object Storage, folders are simulated using key prefixes. To move an object from one folder to another, rename its key prefix.
You can also rename and move objects using supported tools like a file browser.