Configuration
Storages
AWS S3

Amazon AWS S3

Storage backup file to Amazon AWS S3 (opens in a new tab).

Config keys

type: s3

  • bucket - S3 bucket name
  • region - S3 region, default: us-east-1
  • path - remote path for save
  • access_key_id - S3 access_key_id
  • secret_access_key - S3 secret_access_key
  • timeout - Set timeout of remote upload, default: 300
  • max_retries - Max retries, default: 3
  • endpoint - Special endpoint (optional).
  • storage_class - Storage class, default: STANDARD_IA

https://github.com/gobackup/gobackup/blob/main/storages/s3.go (opens in a new tab)

AWS Regions

  • us-east-1 - US Standard (Default)
  • us-west-2 - US West (Oregon)
  • us-west-1 - US West (Northern California)
  • eu-west-1 - EU (Ireland)
  • ap-southeast-1 - Asia Pacific (Singapore)
  • ap-southeast-2 - Asia Pacific (Sydney)
  • ap-northeast-1 - Asia Pacific (Tokyo)
  • sa-east-1 - South America (Sao Paulo)
  • cn-north-1 - China North 1

Storage Class

Since: 2.0.2

You can use storage_class to set the storage class of the object.

Here is a list of available storage classes:

Storage ClassDescription
STANDARDS3 Standard (default): Frequently accessed data (more than once a month) with millisecond access.
STANDARD_IAS3 Standard-IA: Long-lived, infrequently accessed data (once a month) with millisecond access
INTELLIGENT_TIERINGS3 Intelligent-Tiering: Data with unknown, changing, or unpredictable access patterns
ONEZONE_IAS3 One Zone-IA: Long-lived, infrequently accessed, non-critical data stored in a single AZ, with millisecond access
GLACIERS3 Glacier: Long-term data archiving with retrieval times ranging from minutes to hours
DEEP_ARCHIVES3 Glacier Deep Archive: Long-term data archiving with retrieval times ranging from hours to days
OUTPOSTSS3 on Outposts: Data stored on S3 on AWS Outposts
GLACIER_IRS3 Glacier Instant Retrieval: Data archiving with retrieval times ranging from milliseconds to seconds
SNOWS3 Snowball: Data stored on a Snowball device

You can visit AWS documention to learn more about storage classes (opens in a new tab).

Example

In this case show S3 storage config example, the S3_ACCESS_KEY_Id, S3_SECRET_ACCESS_KEY is env variable.

If you don't want to use env, just set the key and secret in YAML.

models:
  my_app:
    databases:
      # ...
    storages:
      s3:
        type: s3
        bucket: my_app_backup
        region: us-east-1
        path: backups
        access_key_id: $S3_ACCESS_KEY_Id
        secret_access_key: $S3_SECRET_ACCESS_KEY