create folder inside S3 bucket using Cloudformation

前端 未结 4 1492
死守一世寂寞
死守一世寂寞 2021-02-01 16:47

I\'m able to create an S3 bucket using cloudformation but would like to create a folder inside an S3 bucket..like

-->
<         


        
4条回答
  •  面向向阳花
    2021-02-01 17:03

    We cannot (at least as of now) create a sub folder inside s3 bucket.

    You can try using following command :

     aws s3 mb s3://yavdhesh-bucket/inside-folder
    

    And then try to list all the folders inside the bucket using command:

    aws s3 ls s3://yavdhesh-bucket
    

    And you will observe that the sub folder was not created.

    there is only one way to create a subfolder, that is by creating/copying a file inside a non-existing sub folder or sub directory (with respect to bucket)

    For example,

    aws s3 cp demo.txt s3://yavdhesh-bucket/inside-folder/
    

    Now if you list down the files present inside your sub-folder, it should work.

     aws s3 ls s3://yavdhesh-bucket/inside-folder/
    

    it should list down all the files present in this sub folder.

    Hope it helps.

提交回复
热议问题