Skip to main content

Connect S3 to a 1C server cluster

Last update:

S3 is a service for storing and distributing an unlimited amount of data. You can connect S3 to your 1C server cluster to store media files there — images and documents. This will allow you to:

  • reduce the number of requests to the database cluster — file action requests will be routed to the storage bucket;
  • improve the reliability of media file storage — data in S3 is replicated to three independent servers in different racks;
  • edit and replace media files in the bucket in the Control panel or using S3 tools.

Operating principle

You connect S3 to a 1C server cluster in the Control panel, and then configure the media file storage method in the 1C configuration menu.

After this, new media files will start being sent to S3. Existing media files will not be automatically transferred to S3; you can transfer them after the connection.

After connecting and configuring, you can work with media files via both 1C and S3 — for example, you can create, modify, or delete them in S3, while 1C will display their current status.

S3 has a flat addressing structure — there are no folders or hierarchies in the storage, but you can create and view simulated folders (directories) for easier management. The folder name is a prefix in the object name.

You cannot connect parent and child directories in the same bucket simultaneously. For example, if the example/images directory is connected, you cannot connect its parent directory example or a child directory example/images/photos, but you can connect the example/documents directory.

There are two ways to connect S3:

  • automatically — you can connect an existing bucket or create a new one. The service user and access policies for working with the bucket will be created automatically;
  • manually — you can connect an existing bucket. You must create the service user and access policies yourself.

Limitations and recommendations for buckets

Only buckets can be connected to a 1C server cluster if they use:

For optimal performance, we recommend choosing buckets that use:

  • with a private type;
  • in the region and pool where the 1C server cluster is located.

Cost

Storage of files in a bucket is charged according to the S3 pricing and payment model.

When a 1C server cluster is deleted, files in the connected buckets are not deleted and continue to be billed — to stop billing, delete the buckets.

Connect a bucket to a cluster automatically

When connecting a bucket, the following will be created and configured by default:

  • service user GO1C_SERVICE_USER;
  • access policy for the service user GO1C_POLICY;
  • access policy for the current user ALL_OTHER.

A bucket can be connected automatically by the Account Owner or users with combinations of the member and iam.admin roles.

A bucket can only be connected to 1C server clusters with the ACTIVE status.

warning

If you modify or delete a service user or access policies, the connection to the 1C server cluster may be lost, but the connection status in the Control panel will not change.

  1. In the Control panel, from the top menu, click Products and select 1C Managed Cloud.

  2. Go to the 1C Server Clusters section.

  3. Open the cluster page → Storage tab.

  4. Click Connect.

  5. Select the connection type — Automatically.

  6. In the Region and Pool fields, select the region and pool where the bucket will be created. We recommend creating the bucket in the same region and pool as the 1C server cluster.

  7. In the Bucket field, select New S3 bucket. This will create a private bucket with Virtual-Hosted addressing and a standard storage class.

  8. In the Bucket name field, specify a name for the new bucket. For S3 API compatibility, the bucket name must be unique within S3 and comply with Amazon S3 bucket naming rules; for more details, see the Bucket naming rules in the Amazon documentation.

  9. In the Prefix field, specify a prefix for the simulated folder (directory) where media files will be stored.

    To create a new folder, enter its name according to the Amazon S3 bucket naming rules. The folder will be created automatically.

    If media files will be stored in the root of the bucket, leave the field blank.

  10. Click Create connection.

Connect a bucket to a cluster manually

A bucket can only be connected to 1C server clusters with the ACTIVE status.

warning

If you modify or delete a service user or access policies, the connection to the 1C server cluster may be lost, but the connection status in the Control panel will not change.

  1. Prepare the bucket for connection.
  2. Connect the bucket.

1. Prepare the bucket for connection

  1. Ensure you are in the project where the 1C server cluster is located.

  2. Create a service user with the following settings:

    • scope — Projects;
    • a project has been added where the bucket will be created;
    • role — s3.user.
  3. Create a bucket in object storage. Observe limitations and recommendations for buckets.

  4. Go to the Object StorageBuckets section.

  5. Open the page of the created bucket → Bucket Policy tab.

  6. Click Create Bucket Policy.

  7. Add a rule for the service account:

    • in the Access field, select Allow;
    • in the Users field, select Authorized and add the service user you created in step 2;
    • in the Actions field, select Editor.
  8. Add a rule for users:

    • in the Access field, select Allow;
    • in the Users field, select Authorized and add the user who will connect the storage to the 1C cluster;
    • in the Actions field, select All.
  9. Click Save.

  10. Issue S3 keys for the service user.

2. Connect the bucket

  1. In the Control panel, from the top menu, click Products and select 1C Managed Cloud.

  2. Go to the 1C Server Clusters section.

  3. Open the cluster page → Storage tab.

  4. Click Connect.

  5. Select the connection type — Manually.

  6. In the Region and Pool fields, select the region and pool where the bucket is located.

  7. In the Bucket field, select the bucket, which you prepared earlier.

  8. In the Prefix field, specify a prefix for the simulated folder (directory) where media files will be stored.

    To create a new folder, enter its name according to the bucket naming rules for Amazon S3. The folder will be created automatically.

    If media files will be stored in the root of the bucket, leave the field blank.

  9. In the S3 keys block, specify the Access key and Secret key for the service user that you created when preparing the bucket.

  10. Click Create connection.

Disconnect the bucket

A bucket can only be disconnected from 1C server clusters with the ACTIVE status. When disconnecting a bucket from a cluster, the service user's S3 key and the access policy rule created for this bucket will be removed.

  1. In the Control panel, from the top menu, click Products and select 1C Managed Cloud.
  2. Go to the 1C Server Clusters section.
  3. Open the cluster page → Storage tab.
  4. In the row with the bucket, click .
  5. Enter the name of the bucket to confirm deletion.
  6. Click Disconnect. If the bucket is no longer needed, delete it.