Brian F
Brian F

Reputation: 1660

Creating an S3 bucket and adding a file using the Serverless Framework

Is it possible to specify a static file to upload to an S3 bucket resource in my serverless.yaml file?

i.e.

resources:
  Resources:
   PropertiesBucket:
     Type: AWS::S3::Bucket
     Properties:
       BucketName: ${self:provider.stage}-MyBucket
     File:
        ./myfile.json
        ????

Upvotes: 2

Views: 738

Answers (1)

wjordan
wjordan

Reputation: 20390

Adding a static file to an S3 bucket is not supported by any official AWS CloudFormation resources, but gilt/cloudformation-helpers has a custom resource, Put S3 Objects, that can do this. See Usage for instructions on installation and usage.

Upvotes: 1

Related Questions