[Yandex Cloud documentation](../../../index.md) > [Yandex DataSphere](../../index.md) > [Step-by-step guides](../index.md) > Working with resources > Working with S3 connectors

# Connecting to an S3 storage

You can manage your S3 object storage connection by using the **S3 Connector** resource on your project page in the DataSphere interface.

To connect to an object storage from the notebook code, follow [this guide](connect-to-s3.md).

{% note info %}

Avoid using your S3 storage in [FUSE](https://en.wikipedia.org/wiki/Filesystem_in_Userspace) mode for buckets with single-layer (non-recursive) folders that contain many files, as this will significantly degrade storage performance.

{% endnote %}

## Getting started {#before-begin}

Get an access key from your S3 storage provider. To do this in [Yandex Object Storage](../../../storage/index.md), follow these steps:

1. [Create a service account](../../../iam/operations/sa/create.md).
1. [Assign](../../../iam/operations/sa/assign-role-for-sa.md) the new account a [role](../../../storage/security/index.md) with either read or read and write permissions.
1. [Create an access key](../../../iam/operations/authentication/manage-access-keys.md#create-access-key) for the service account.

## Creating an S3 connector {#create}

1. Select the project in your community or on the DataSphere [home page](https://datasphere.yandex.cloud) in the **Recent projects** tab.
1. Optionally, in the top-right corner, click **Create resource**. In the pop-up window, select **Secret** and [create a secret](secrets.md#create) with the secret part of the static access key for your service account. You can also create a secret when creating your S3 connection.
1. In the top-right corner, click **Create resource**. In the pop-up window, select **S3 Connector**.
1. Fill in the fields as follows:
   * **Name**: Name of the new connector. Follow these naming requirements:

     * The name must be from 3 to 63 characters long.
     * It may contain uppercase and lowercase Latin and Cyrillic letters, numbers, hyphens, underscores, and spaces.
     * The first character must be a letter. The last character cannot be a hyphen, underscore, or space.

   * **Description**: Description of the new connector. This is an optional parameter.
   * **Endpoint**: Storage host. For Object Storage, set it to `https://storage.yandexcloud.net/`.
   * **Bucket**: Name of the storage bucket.

     {% note warning %}

     Do not use buckets with periods in their names for connection. Learn more about buckets [here](../../../storage/concepts/bucket.md).

     {% endnote %}

   * **Mount name**: Name of the volume for mounting the bucket into the project file system. Make sure to follow these naming requirements:

     * Length: between 3 and 63 characters.
     * It can only contain lowercase Latin letters, numbers, and hyphens.
     * It must start with a letter and cannot end with a hyphen.

   * **Static access key ID**: ID of the static access key used to connect to the storage.
   * **Static access key**: In the list, select a [secret](../../concepts/secrets.md) that contains the secret part of the static access key or create a new secret.
   * **Mode**: Object storage access mode, **Read only** or **Read and write**.
1. Click **Create**.

{% note info %}

You need to [configure a NAT gateway](../../../vpc/operations/create-nat-gateway.md) for any [subnet](../../../vpc/concepts/network.md#subnet) associated with the project. The subnet must be in the same [availability zone](../../../overview/concepts/geo-scope.md) where you created the community.

{% endnote %}

## Attaching an S3 storage to a project {#mount}

Go to the S3 connector page and click **Activate**. Once activated, the bucket will be available in the `/s3/` folder of the JupyterLab file browser, and you will be able to view it as a file system.

## Using an S3 storage in a project {#usage}

You can access files in the connected bucket from your project code. Select the file you need in the mounted S3 storage on the **S3 Mounts** ![S3 Mounts](../../../_assets/datasphere/bucket.svg) tab, right-click it, and select **Copy path**. This will copy the file path to the clipboard. Paste the copied path wherever you need in the project.

## Detaching an S3 storage {#unmount}

1. On the project page, under **Project resources**, click **S3 Connector**.
1. Select the connector and go to the resource page.
1. Click **Deactivate** in the top-right corner of the page.

You can re-attach the S3 storage to your project whenever you need it.

## Sharing an S3 connector {#share}

{% note info %}

You can only share resources within a single organization, between communities created in the same [availability zone](../../../overview/concepts/geo-scope.md).

{% endnote %}

1. Select the project in your community or on the DataSphere [home page](https://datasphere.yandex.cloud) in the **Recent projects** tab.
1. Under **Project resources**, click ![dataset](../../../_assets/console-icons/bucket.svg) **S3 Connector**.
1. Select the S3 connector from the list.
1. Go to the **Access** tab.
1. Enable the visibility option next to the name of the community you want to share the S3 connector with.

To make an S3 connector available for use in a different project, the project admin needs to [add](../projects/use-shared-resource.md) that connector on the **Shared** tab.

## Deleting an S3 connector {#delete}

You can only delete a [deactivated](#unmount) connector that is not available to any community.

1. Select the project in your community or on the DataSphere [home page](https://datasphere.yandex.cloud) in the **Recent projects** tab.
1. Under **Project resources**, click ![secret](../../../_assets/console-icons/bucket.svg) **S3 Connector**.
1. Next to the S3 storage, click ![options](../../../_assets/console-icons/ellipsis.svg) and select **Delete**.
1. Click **Confirm**.

You will see a message saying that the secret has been deleted.

{% note warning %}

In fact, [resource deletion](../../../overview/concepts/data-deletion.md) can take up to 72 hours.

{% endnote %}