Search code examples
amazon-web-servicesserverlessserverless-frameworkaws-serverless

How can I upload a local folder to s3 bucket with given prefix using serverless.yaml file


I want to upload a local folder to s3 bucket with given prefix before a glue job refers to the files. I am using serverless-s3-sync and below is my code in serverless.yaml file.

custom:
  s3Sync:
    bucketName: "${self:custom.deploymentBucket}"
    bucketPrefix: "datasets/folder1/"
    localDir: ./GlueEtl

When deploying, getting error × serverless-s3-sync requires at least one configuration entry in custom.s3Sync Whats wrong am I doing or any other method will be helpful.


Solution

  • Based on documentation here, it looks like the s3Sync requires a list of entries whereas you are not providing a list. An example would be the following.

    custom:
      s3Sync:
        - bucketName: ${self:custom.deploymentBucket}
          bucketPrefix: datasets/folder1/
          localDir: ./GlueEtl