How can I create a s3 bucket subdirectory?


#1

When I try to create a subdirectory on my serverless.yml I get the following error:

An error occurred: S3Bucket - Bucket name should not contain '/'.

Here’s the code:

resources:
 Resources:
   S3Bucket:
     Type: AWS::S3::Bucket
     Properties:
       BucketName: "bucketname/sub"

#2

Hmm so S3 doesn’t really have such a concept. You can create buckets and files in them. The file names can contain slashes which you can logically interpret as sub directories.