diff --git a/README.md b/README.md index 03729d1..bff8832 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,8 @@ custom: # ... ``` -run `sls offline start --profile s3local` to sync to the local s3 bucket instead of Amazon AWS S3 +As per [serverless-s3-local's instructions](https://github.com/ar90n/serverless-s3-local#triggering-aws-events-offline), once a local credentials profile is configured, run `sls offline start --aws-profile s3local` to sync to the local s3 bucket instead of Amazon AWS S3 + +> `bucketNameKey` will not work in offline mode and can only be used in conjunction with valid AWS credentials, use `bucketName` instead. run `sls deploy` for normal deployment \ No newline at end of file diff --git a/index.js b/index.js index f2a33c5..88a2632 100644 --- a/index.js +++ b/index.js @@ -96,10 +96,7 @@ class ServerlessS3Sync { s3Options.endpoint = new provider.sdk.Endpoint(this.serverless.service.custom.s3Sync.endpoint); s3Options.s3ForcePathStyle = true; } - const s3Client = new provider.sdk.S3({ - region: region, - credentials: awsCredentials - }); + const s3Client = new provider.sdk.S3(s3Options); if(this.getEndpoint() && this.isOffline()) { //see: https://github.com/aws/aws-sdk-js/issues/1157 s3Client.shouldDisableBodySigning = () => true