create folder inside S3 bucket using Cloudformation

前端 未结 4 1490
死守一世寂寞
死守一世寂寞 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:04

    This is not possible using an AWS CloudFormation template.

    It should be mentioned that folders do not actually exist in Amazon S3. Instead, the path of an object is prepended to the name (key) of an object.

    So, file bar.txt stored in a folder named foo is actually stored with a Key of: foo/bar.txt

    You can also copy files to a folder that doesn't exist and the folder will be automatically created (which is not actually true, since the folder itself doesn't exist). However, the Management Console will provide the appearance of such a folder and the path will suggest that it is stored in such a folder.

    Bottom line: There is no need to pre-create a folder. Just use it as if it were already there.

提交回复
热议问题