{"id":20385837,"url":"https://github.com/funkybob/serverless-s3-deploy","last_synced_at":"2025-07-01T23:04:12.860Z","repository":{"id":14655706,"uuid":"76811271","full_name":"funkybob/serverless-s3-deploy","owner":"funkybob","description":"Plugin for serverless to deploy files to a S3 Bucket","archived":false,"fork":false,"pushed_at":"2023-03-04T04:19:14.000Z","size":244,"stargazers_count":58,"open_issues_count":13,"forks_count":24,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-15T15:18:42.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funkybob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-18T22:48:05.000Z","updated_at":"2024-08-02T06:41:33.000Z","dependencies_parsed_at":"2024-01-03T02:24:52.386Z","dependency_job_id":"bba227b6-8006-4d57-a663-773aea8cedc6","html_url":"https://github.com/funkybob/serverless-s3-deploy","commit_stats":{"total_commits":81,"total_committers":20,"mean_commits":4.05,"dds":0.345679012345679,"last_synced_commit":"377c3a85fa5e1545a0727bfc46adb64571af8e4f"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/funkybob/serverless-s3-deploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkybob%2Fserverless-s3-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkybob%2Fserverless-s3-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkybob%2Fserverless-s3-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkybob%2Fserverless-s3-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funkybob","download_url":"https://codeload.github.com/funkybob/serverless-s3-deploy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkybob%2Fserverless-s3-deploy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261186778,"owners_count":23121944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T02:35:46.228Z","updated_at":"2025-07-01T23:04:12.828Z","avatar_url":"https://github.com/funkybob.png","language":"JavaScript","funding_links":[],"categories":["Serverless Framework Plugins"],"sub_categories":[],"readme":"# serverless-s3-deploy\n\nPlugin for serverless to deploy files to a variety of S3 Buckets\n\n\u003e **Note: This project is currently not maintained.**\n\n# Installation\n\n```\n npm install --save-dev serverless-s3-deploy\n```\n\n# Usage\n\nAdd to your serverless.yml:\n\n```\n  plugins:\n    - serverless-s3-deploy\n\n  custom:\n    assets:\n      targets:\n       - bucket: my-bucket\n         files:\n          - source: ../assets/\n            globs: '**/*.css'\n          - source: ../app/\n            globs:\n              - '**/*.js'\n              - '**/*.map'\n       - bucket: my-other-bucket\n         empty: true\n         prefix: subdir\n         files:\n          - source: ../email-templates/\n            globs: '**/*.html'\n```\n\nYou can specify any number of `target`s that you want. Each `target` has a\n`bucket` and a `prefix`.\n\n`bucket` is either the name of your S3 bucket or a reference to a\nCloudFormation resources created in the same serverless configuration file.\nSee below for additional details.\n\nYou can specify `source` relative to the current directory.\n\nEach `source` has its own list of `globs`, which can be either a single glob,\nor a list of globs.\n\nSetting `empty` to `true` will delete all files inside the bucket before \nuploading the new content to S3 bucket. The `prefix` value is respected and \nfiles outside will not be deleted.\n\nNow you can upload all of these assets to your bucket by running:\n\n```\n$ sls s3deploy\n```\n\nIf you have defined multiple buckets, you can limit your deployment to\na single bucket with the `--bucket` option:\n\n```\n$ sls s3deploy --bucket my-bucket\n```\n\n## ACL\n\nYou can optionally specificy an ACL for the files uploaded on a per target\nbasis:\n\n```\n  custom:\n    assets:\n      targets:\n        - bucket: my-bucket\n          acl: private\n          files:\n```\n\nThe default value is `private`. Options are defined\n[here](http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl).\n\n## Content Type\n\nThe appropriate Content Type for each file will attempt to be determined using\n``mime-types``. If one can't be determined, a default fallback of\n'application/octet-stream' will be used.\n\nYou can override this fallback per-source by setting ``defaultContentType``.\n\n```\n  custom:\n    assets:\n      targets:\n        - bucket: my-bucket\n          files:\n            - source: html/\n              defaultContentType: text/html\n              ...\n```\n\n## Other Headers\n\nAdditional headers can be included per target by providing a ``headers`` object.\n\nSee http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html for more\ndetails.\n\n```\n  custom:\n    assets:\n      targets:\n        - bucket: my-bucket\n          files:\n            - source: html/\n              headers:\n                CacheControl: max-age=31104000 # 1 year\n```\n\n## Resolving References\n\nA common use case is to create the S3 buckets in the `resources` section of\nyour serverless configuration and then reference it in your S3 plugin\nsettings:\n\n```\n  custom:\n    assets:\n      targets:\n        - bucket:\n            Ref: MyBucket\n          files:\n            - source: html/\n\n  resources:\n    # AWS CloudFormation Template\n    Resources:\n      MyBucket:\n        Type: AWS::S3::Bucket\n        Properties:\n          AccessControl: PublicRead\n          WebsiteConfiguration:\n            IndexDocument: index.html\n            ErrorDocument: index.html\n```\n\nYou can disable the resolving with the following flag:\n```\n  custom:\n    assets:\n      resolveReferences: false\n```\n\n## Auto-deploy\n\nIf you want s3deploy to run automatically after a deploy, set the `auto` flag:\n\n```\n  custom:\n    assets:\n      auto: true\n```\n\n## IAM Configuration\n\nYou're going to need an IAM policy that supports this deployment. This might be\na good starting point:\n\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": [\n                \"arn:aws:s3:::${bucket}\"\n            ]\n        },\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\",\n                \"s3:GetObject\",\n                \"s3:DeleteObject\"\n            ],\n            \"Resource\": [\n                \"arn:aws:s3:::${bucket}/*\"\n            ]\n        }\n    ]\n}\n```\n\n## Upload concurrency\n\nIf you want to tweak the upload concurrency, change `uploadConcurrency` config:\n\n```\nconfig:\n  assets:\n    # defaults to 3\n    uploadConcurrency: 1\n```\n\n## Verbosity\n\nVerbosity cloud be enabled using either of these methods:\n\nConfiguration:\n\n```\n  custom:\n    assets:\n      verbose: true\n```\n\nCli:\n\n```\n  sls s3deploy -v\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkybob%2Fserverless-s3-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunkybob%2Fserverless-s3-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkybob%2Fserverless-s3-deploy/lists"}