How to create a “folder type” object (ie PREFIX) on S3 using AWS CLI?

It is usually explained that on S3 there are no folders / directories, this is true, however there are PREFIX objects. In some cases - for example, using riofs to "mount" the file system on S3 - it would actually be useful to know how to create one of them.

Does anyone know if there is a “right” way to do this using the AWS CLI? This is probably possible using the low-level API.aws s3api ...

Related SO Messages:

Amazon S3 boto - how to create a folder?

Creating a folder through s3cmd (Amazon S3)

PS

I also want to note that in the AWS console this action is actually called "Create Folder ...", so do not honestly tell people that there is no "concept" of the folder on S3.

Many thanks!

+4
3

, :

aws s3api put-object --bucket test --key dir-test/

, "/" --key. ... ?

+13

S3 . , , , - /, S3.

, . , , (/ ). , , , , .

, . .

+8

/ /DirName

DirName = "Hello"
s3bucket = "s3://mybucket"


os.system("aws s3 cp " + DirName + " " + s3//mybucket" + "/" + DirName + " --recursive")
0

Source: https://habr.com/ru/post/1611509/


All Articles