What would be the best way to create a s3 bucket t...
# general
w
What would be the best way to create a s3 bucket then create a folder structure as part of the setup?
s
As far as I can tell, you can't create folders per se outside of the AWS Console (neither TF nor CF nor the CloudControl API supports it). The next best thing I would try is to just put an empty text file called
.s3folderkeep
or something (like
.gitkeep
since git also does not allow for empty folders).
w
Gotcha, so just create a dummy file and use s3.BucketObject to force it to create the folder
s
Yeah. I think that's the best you can do.
b
There are no "folders" in S3 - they are zero byte objects where the keys end in a
/
So yep, create a BucketObject with the required folder path as it's key