Main menu

Automatically publish translation files to S3

This feature is currently in Beta. Please request access.

You'll need an AWS account with access to Amazon's Simple Storage Service

Adding S3 as a deployment host

  • Open the developer tools modal from any project view where you see the :wrench icon:
  • Switch to the "Deployments" tab, and click the "New host" link
  • Choose "Amazon S3", enter your credentials, and confirm with "Add host".

Nothing is uploaded yet. You've just created a destination for publishing files. See general instructions on publishing files to a host.

S3 settings:

  • Bucket:
    Enter only the S3 bucket into this field. Directory paths inside the bucket are defined by deployments that publish to the bucket.

  • Region:
    Optional, but recommended. Specifying the region is required for correct file previews.

  • Authentication
    Choose between IAM User or IAM Role. See our guide to storing AWS credentials and general advice on key security.

  • Access control
    Private and Public refer to S3 "private" and "public-read" permissions. If you choose "Private" then file URLs will have to be signed in order to download them.

Tip: Selecting "Public" will fail if your bucket has public access disabled.

Downloading published files

Once Loco has been configured to deploy translation files to S3, you will see a preview of the bucket objects. These URLs are the raw S3 origins in the form "https://s3.{region}.amazonaws.com/{bucket}/{path}". The objects will only exist once a deployment has been published.

If you've left the region field blank, the URI will take the form: "https://{bucket}.s3.amazonaws.com/{path}". The links are valid, but Amazon's SSL certificate won't work with CNAME buckets.

For private deployments, Loco will sign the URLs with your credentials so you can access them. Don't use our signatures in your application! They will expire after one hour. Note that the region field is required for signing.

CDN deployment

Downloading these files from your application may not be very fast, and you may want them on your own domain. This is easily resolved, but not something Loco will do for you. See Bucket hosting for accessing S3 origins on your own domain.

Amazon CloudFront is probably the simplest option for CDN deployment of these files, but other CDN providers can be made to work as long as they can access the bucket objects.

Cross-origin resource sharing (CORS)

If you plan to access deployed files from a web application, ensure your bucket has the appropriate CORS access. Loco won't handle this for you. Check your bucket permissions in the AWS Console.

See: Configuring CORS for Amazon S3.

Limitations

  • Deployment to S3 is one-way. Loco never deletes, or moves these files at any point. If you end up with redundant files in your bucket, you'll have to remove them manually (e.g. via the AWS console).

  • IAM Role authentication is in development.

Last updated by