diff --git a/docs/index.html b/docs/index.html index 7f5eda7..948be3e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -48,46 +48,32 @@
Synchronize files and directories between a remote computer and multiple Serverless cloud providers' storages.
-Supported cloud providers:
-Synchronize files and directories between a remote machine and a cloud storage via cloud frameworks and stacks consisting of AWS SAM (Serverless) and AWS Cloud Development Kit (CDK). This package supports the following cloud storage providers: AWS S3.
glob
to include or excludePrefix
, Access Control List (ACL)
, Tags
, Metadata
uploading
, deleting
aws-sdk@3.x
glob
to include or exclude++Note: This plugin is still in development and may not be stable. Use with caution.
+
ni sync-cloud-storage -D
npm i sync-cloud-storage -D
yarn add sync-cloud-storage -D
pnpm add sync-cloud-storage -D
Sync storages action as a pre-deploy hook in the serverless.yml
:
plugins:
- sync-cloud-storage
@@ -105,96 +91,179 @@ AWS S3
foo: bar
bar: foo
-This section provides a detailed reference for all configuration options.
-name
:
string
true
name: assets
patterns
: File patterns to include or exclude during synchronization.
array
of string
true
patterns:
- - "assets/*"
- - "!assets/temp/*"
-
-actions
: List of actions to perform during synchronization.
array
of string
true
upload
, delete
actions:
- - upload
- - delete
-
-prefix
: The prefix to apply to all synced files in the bucket.
string
false
""
prefix: assets
enabled
: Whether to enable the sync for the storage.
boolean
false
true
acl
: Access control list setting for the synced files.
string
false
private
, public-read
, public-read-write
, authenticated-read
acl: public-read
metadata
: Custom metadata to apply to the synced files.
object
false
metadata:
- foo: bar
- bar: foo
-
-tags
: Custom tags to apply to the synced files.
object
false
{}
tags:
- environment: production
+CDK
+Call sync storages action after setting up a CDK App:
+import { Stack, App } from '@aws-cdk/core'
+import SyncCloudStorage from 'sync-cloud-storage'
+
+const app = new App()
+const stack = new Stack(app, 'MyStack')
+const syncCloudStorage = new SyncCloudStorage(stack, {
+ storages: [
+ {
+ name: 'my-bucket',
+ patterns: ['assets/*'],
+ actions: ['upload', 'delete'],
+ prefix: 'assets',
+ acl: 'public-read',
+ metadata: {
+ foo: 'bar',
+ bar: 'foo',
+ },
+ },
+ ],
+})
+
+// Sync storages
+syncCloudStorage.storages()
+
+// Sync tags
+syncCloudStorage.tags()
+
+// Sync metadata
+syncCloudStorage.metadata()
-
Option | +Notes | +Type | +Required | +Default | +
---|---|---|---|---|
storages | +List of storages, Minimum items: 1 | +array of storage |
+true | +undefined | +
region | +Cloud (AWS) region | +string |
+false | +undefined or AWS_REGION environment variable |
+
endpoint | +Cloud (AWS) Endpoint URL | +string |
+false | +undefined or AWS_ENDPOINT_URL environment variable |
+
offline | +Offline mode | +boolean |
+false | +false or IS_OFFLINE environment variable |
+
disabled | +Disable sync | +boolean |
+false | +false | +
silent | +Silent output logs | +boolean |
+false | +false | +
Option | +Notes | +Type | +Required | +Default | +
---|---|---|---|---|
name | +Name of storage (AWS S3 Bucket), Minimum length: 1 | +string |
+true | +undefined | +
patterns | +Patterns of glob paths to include or exclude on sync action, Minimum items: 1 |
+array of string |
+true | +undefined | +
actions | +Sync actions, Valid values: upload , delete |
+array of string |
+false | +upload , delete |
+
prefix | +Prefix for the storage files and folders | +string |
+false | +'' |
+
enabled | +Enable or disable the storage on sync action | +boolean |
+false | +true |
+
acl | +AWS S3 Canned ACL, Valid values: private , public-read , public-read-write , authenticated-read |
+string |
+false | +undefined | +
metadata | +A set of metadata key/value pair to be set or unset on the object | +object |
+false | +undefined | +
tags | +A set of tag key/value pair to be set or unset on the object | +object |
+false | +{} |
+
gitignore | +Use .gitignore file to exclude files and directories | +boolean |
+false | +false | +
ignoreFiles | +Ignore files and directories to exclude from sync action | +array of string |
+false | +undefined | +