Skip to main content

Connect S3 to a 1C server cluster

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—images and documents—there. This allows 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 a bucket in the control panel or using S3 tools.

Operating principle

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

After that, new media files will start being sent to S3. Existing media files will not be automatically moved to S3; you can migrate them after connecting.

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 address structure — there are no folders or hierarchy in the storage, but for convenience, you can create and view simulated folders (directories). The folder name is a prefix in the object name.

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

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

File storage in the bucket is charged according to the S3 billing model and pricing.

When a 1C server cluster is deleted, files in connected buckets are not deleted and continue to be billed — to stop being charged, 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.

An Account Owner or users with the role combinations member and iam.admin can connect a bucket automatically.

You can only connect a bucket to a 1C server cluster 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, in the top menu, click Products and select Turnkey 1C 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. A private bucket with Virtual-Hosted addressing and the standard storage class will be created.

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

  9. In the Prefix field, specify the prefix for the simulated folder (directory) where the 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

You can only connect a bucket to a 1C server cluster 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. Make sure you are in the project where the 1C server cluster is located.

  2. Create a service user with the following settings:

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

  4. Go to section Object Storage → Buckets.

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

  6. Click Create access 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 that you created in step 2;
    • in the Action set field, select Editor.
  8. Add a rule for panel 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 Action set field, select All.
  9. Click Save.

  10. Issue S3 keys for the service user.

2. Connect the bucket

  1. In the control panel, in the top menu, click Products and select Turnkey 1C 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 you prepared earlier.

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

    To create a new folder, specify its name in accordance with the bucket naming rules of 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 section, specify the Access key and Secret key for the service user that you created during bucket setup.

  10. Click Create connection.

Disconnect the bucket

You can only disconnect a bucket from a 1C server cluster with the ACTIVE status. When disconnecting a bucket from a cluster, the service user's S3 key and the access policy rule for the service user that were created for this bucket will be deleted.

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