fauna export create s3

fauna export create s3 [flags]

Start an export to an AWS S3 bucket.

Export operations are asynchronous. Export requests aren’t idempotent.

By default, the command outputs the export’s ID. To get additional information about the export as JSON, use --json.

To use exports, you must:

  • Have an Enterprise plan.

  • Be an owner, admin, or developer for your Fauna account. See Team management .

fauna export create s3 does not support --secret, --local, or Fauna containers.

Flags

API
--account-key <string>

Fauna account key used for authentication. If used, you must also provide a --database and an optional --role. See Account key authentication.

Can’t be used with --user or --secret. If --account-key and --user are specified, --user is ignored.

-u, --user <string>

CLI user to run the command as. You must first log in as the user using fauna login. Defaults to default. See Interactive login.

-r, --role <string>

Role used to run the command. Defaults to admin. Can’t be used with --secret.

-d, --database <string>

Database, including the Region Group identifier and hierarchy, to export. Supports shorthand Region Group identifiers. Separate path components using /. Examples: us/my_db, eu/parent_db/child_db, global/db.

Child databases are not included in the export.

--collection <array>

User-defined collections from the database to export. Pass values as a space-separated list. Example: --collection Product Category. If omitted, all user-defined collections are exported. You can’t export system collections.

--bucket <string> (Required)

Name of the S3 bucket where the export will be stored.

--path <string> (Required)

Path prefix for the destination S3 bucket. Separate subfolders using a slash (/). A trailing slash is supported but not required.

Double-check your bucket name before submitting a request. Once requested, you can’t cancel an export. Fauna can’t delete exported data in an S3 bucket.

We recommend using a unique path for each export. If you submit multiple export requests with the same bucket path, the files from the most recent request will overwrite existing conflicting files. Non-conflicting files will not be overwritten, which may result in a mix of files from multiple exports in the same path.

Exports from databases in Fauna’s Europe (eu-std) Region Group must be stored in an S3 bucket located in an EU AWS region.

--format <string> (Required)

Data format used to convert the database’s FQL document data to JSON. Accepts tagged or simple. Defaults to simple.

Output
--color

Enable color formatting for output. Enabled by default. Use --no-color to disable.

--json

Output results as JSON.

Outputs the

--quiet

Suppress all log messages except fatal errors. Output only command results. Overrides --verbosity and --verbose-component.

Config
--config <string>

Path to a CLI config file to use. If provided, must specify a profile.

-p, --profile <string>

Profile from the CLI config file. A profile is a group of CLI settings.

Debug
--verbose-component <array>

Components to emit logs for. Overrides --verbosity.

Accepts the following values:

  • argv

  • config

  • creds

  • error

  • fetch

Pass values as a space-separated list. Example: --verbose-component argv config.

--verbosity <number>

Least critical log level to emit. Accepts integers ranging from 1 (fatal) to 5 (debug). Lower values represent more critical logs. Log messages with a level greater than this value are not logged.

Options
-h, --help

Show help.

--version

Show the Fauna CLI version.

-w, --wait, --watch

Wait for the export to complete or fail before exiting. Polls for the export’s state using an exponential backoff strategy. Use '--max-wait' to set a timeout.

--max-wait <number>

Maximum wait time in minutes. Defaults to 120 minutes.

Examples

# Export all user-defined collections in
# the 'us/parent_db/child_db' database. Store the export
# in the 'fauna_exports/parent_db/child_db/2099-12-31'
# path of the 'doc-example-bucket' S3 bucket. Format FQL data
# using the simple data format.
fauna export create s3 \
  --database us/parent_db/child_db \
  --bucket doc-example-bucket \
  --path fauna_exports/parent_db/child_db/2099-12-31

# Export the 'Product' and 'Category' collections in
# the 'us/parent_db/child_db' database.
fauna export create s3 \
  --database us/parent_db/child_db \
  --collection Product Category \
  --bucket doc-example-bucket \
  --path fauna_exports/parent_db/child_db/2099-12-31

# Encode the export's FQL document data
# using the 'tagged' format.
fauna export create s3 \
  --database us/parent_db/child_db \
  --bucket doc-example-bucket \
  --path fauna_exports/parent_db/child_db/2099-12-31 \
  --format tagged

# Wait for the export to complete or fail before exiting.
# Waits up to 180 minutes.
fauna export create s3 \
  --database us/parent_db/child_db \
  --bucket doc-example-bucket \
  --path fauna_exports/parent_db/child_db/2099-12-31 \
  --wait \
  --max-wait 180

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!