[Yandex Cloud documentation](../../../index.md) > [Yandex MetaData Hub](../../index.md) > Apache Hive™ Metastore > Step-by-step guides > Connecting to a Yandex Object Storage bucket with a bucket policy

# Connecting to a Yandex Object Storage bucket with a bucket policy

In Apache Hive™ Metastore, you can work with a Yandex Object Storage bucket with [bucket policies](../../../storage/security/policy.md) configured. You access the bucket from a separate DNS zone through an internal load balancer that distributes traffic across NAT instances. This connection is outlined below. A Apache Hive™ Metastore cluster will be used in place of the `test-s3-vm` VM.

![Storage VPC Access](../../../_assets/metadata-hub/storage-vpc-access-metastore.svg)

## Getting started {#before-you-begin}

1. Create a network infrastructure to access the Object Storage bucket as shown in the picture above. Learn how to create such an infrastructure in [this tutorial](../../../storage/tutorials/storage-vpc-access.md).
1. [Test the new infrastructure](../../../vpc/tutorials/storage-vpc-access.md#check). 

## Prepare the Apache Hive™ Metastore cluster {#prepare-metastore}

1. [Create a service account](../../../iam/operations/sa/create.md) named `my-account` with the `storage.uploader` and `managed-metastore.integrationProvider` roles.
1. [Grant](../../../storage/operations/buckets/edit-acl.md) the `READ and WRITE` permission to the `my-account` service account for the bucket you created earlier.
1. [Configure the network and create a Apache Hive™ Metastore cluster](cluster-create.md). When creating it, specify the `my-account` service account.

## Test the connection {#check-connection}

To test the Object Storage bucket connection, [export the Apache Hive™ Metastore cluster data to that bucket](export-and-import.md#export). 

_Apache® and [Apache Hive™](https://hive.apache.org/) are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries._