Ericson Willians
Ericson Willians

Reputation: 7855

How can I create a s3 bucket subdirectory (Serverless)?

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"

How can I create bucket subdirectories through serverless.yml?

Upvotes: 4

Views: 2167

Answers (2)

A.Khan
A.Khan

Reputation: 4002

You can only create S3 bucket using serverless framework. Any folder/object can only be created using SDK or console.

Upvotes: 4

cementblocks
cementblocks

Reputation: 4616

AWS S3 buckets don't have directories, they just appear to when a filename has a / in it.

See this question.

Upvotes: 2

Related Questions