Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Tutorials
    • All tutorials
    • Unassisted deployment of the Apache Kafka® web interface
    • Upgrading a Managed Service for Apache Kafka® cluster to migrate from ZooKeeper to KRaft
    • Migrating a database from a third-party Apache Kafka® cluster to Managed Service for Apache Kafka®
    • Moving data between Managed Service for Apache Kafka® clusters using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Debezium
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Debezium
    • Delivering data from Managed Service for YDB to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for ClickHouse® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Yandex MPP Analytics for PostgreSQL using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Yandex StoreDoc using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for MySQL® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for OpenSearch using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for PostgreSQL using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for YDB using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Data Streams using Data Transfer
    • Delivering data from Data Streams to Managed Service for YDB using Data Transfer
    • Delivering data from Data Streams to Managed Service for Apache Kafka® using Data Transfer
    • YDB change data capture and delivery to YDS
    • Configuring Kafka Connect to work with a Managed Service for Apache Kafka® cluster
    • Synchronizing Apache Kafka® topics in Object Storage with no web access
    • Monitoring message loss in an Apache Kafka® topic
    • Automating Query tasks with Managed Service for Apache Airflow™
    • Sending requests to the Yandex Cloud API via the Yandex Cloud Python SDK
    • Configuring an SMTP server to send e-mail notifications
    • Adding data to a ClickHouse® DB
    • Migrating data to Managed Service for ClickHouse® using ClickHouse® tools
    • Migrating data to Managed Service for ClickHouse® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for ClickHouse® using Data Transfer
    • Asynchronously replicating data from PostgreSQL to ClickHouse®
    • Exchanging data between Managed Service for ClickHouse® and Yandex Data Processing
    • Configuring Managed Service for ClickHouse® for Graphite
    • Fetching data from Managed Service for Apache Kafka® to Managed Service for ClickHouse®
    • Fetching data from Managed Service for Apache Kafka® to ksqlDB
    • Fetching data from RabbitMQ to Managed Service for ClickHouse®
    • Saving a data stream from Data Streams to Managed Service for ClickHouse®
    • Asynchronous replication of data from Yandex Metrica to ClickHouse® using Data Transfer
    • Using hybrid storage in Managed Service for ClickHouse®
    • Sharding Managed Service for ClickHouse® tables
    • Loading data from Yandex Direct to a Managed Service for ClickHouse® data mart using Cloud Functions, Object Storage, and Data Transfer
    • Loading data from Object Storage to Managed Service for ClickHouse® using Data Transfer
    • Migrating data with change of storage from Managed Service for OpenSearch to Managed Service for ClickHouse® using Data Transfer
    • Loading data from Managed Service for YDB to Managed Service for ClickHouse® using Data Transfer
    • Yandex Managed Service for ClickHouse® integration with Microsoft SQL Server via ClickHouse® JDBC Bridge
    • Migrating databases from Google BigQuery to Managed Service for ClickHouse®
    • Yandex Managed Service for ClickHouse® integration with Oracle via ClickHouse® JDBC Bridge
    • Configuring Cloud DNS to access a Managed Service for ClickHouse® cluster from other cloud networks
    • Migrating a Yandex Data Processing HDFS cluster to a different availability zone
    • Importing data from Managed Service for MySQL® to Yandex Data Processing using Sqoop
    • Importing data from Managed Service for PostgreSQL to Yandex Data Processing using Sqoop
    • Mounting Object Storage buckets to the file system of Yandex Data Processing hosts
    • Working with Apache Kafka® topics using Yandex Data Processing
    • Automating operations with Yandex Data Processing using Managed Service for Apache Airflow™
    • Shared use of Yandex Data Processing tables through Apache Hive™ Metastore
    • Transferring metadata across Yandex Data Processing clusters using Apache Hive™ Metastore
    • Importing data from Object Storage, processing it, and exporting it to Managed Service for ClickHouse®
    • Migrating collections from a third-party MongoDB cluster to Yandex StoreDoc
    • Migrating data to Yandex StoreDoc
    • Migrating Yandex StoreDoc cluster from 4.4 to 6.0
    • Sharding Yandex StoreDoc collections
    • Yandex StoreDoc performance analysis and tuning
    • Migrating a database from a third-party MySQL® cluster to a Managed Service for MySQL® cluster
    • Managed Service for MySQL® performance analysis and tuning
    • Syncing data from a third-party MySQL® cluster to Managed Service for MySQL® using Data Transfer
    • Migrating a database from Managed Service for MySQL® to a third-party MySQL® cluster
    • Migrating a database from Managed Service for MySQL® to Object Storage using Data Transfer
    • Migrating data from Object Storage to Managed Service for MySQL® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Debezium
    • Migrating a database from Managed Service for MySQL® to Managed Service for YDB using Data Transfer
    • MySQL® change data capture and delivery to YDS
    • Migrating data from Managed Service for MySQL® to Managed Service for PostgreSQL using Data Transfer
    • Migrating data from AWS RDS for PostgreSQL to Managed Service for PostgreSQL using Data Transfer
    • Migrating data from Managed Service for MySQL® to Yandex MPP Analytics for PostgreSQL using Data Transfer
    • Configuring an index policy in Managed Service for OpenSearch
    • Migrating data from a third-party OpenSearch cluster to Managed Service for OpenSearch using Data Transfer
    • Loading data from Managed Service for OpenSearch to Object Storage using Data Transfer
    • Migrating data from Managed Service for OpenSearch to Managed Service for YDB using Data Transfer
    • Copying data from Managed Service for OpenSearch to Yandex MPP Analytics for PostgreSQL using Yandex Data Transfer
    • Migrating data from Managed Service for PostgreSQL to Managed Service for OpenSearch using Data Transfer
    • Authenticating a Managed Service for OpenSearch cluster in OpenSearch Dashboards using Keycloak
    • Using the yandex-lemmer plugin in Managed Service for OpenSearch
    • Creating a PostgreSQL cluster for 1C:Enterprise
    • Searching for the Managed Service for PostgreSQL cluster performance issues
    • Managed Service for PostgreSQL performance analysis and tuning
    • Logical replication in PostgreSQL
    • Migrating a database from a third-party PostgreSQL cluster to Managed Service for PostgreSQL
    • Migrating a database from Managed Service for PostgreSQL
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Debezium
    • Delivering data from Managed Service for PostgreSQL to Managed Service for YDB using Data Transfer
    • Migrating a database from Managed Service for PostgreSQL to Object Storage
    • Migrating data from Object Storage to Managed Service for PostgreSQL using Data Transfer
    • PostgreSQL change data capture and delivery to YDS
    • Migrating data from Managed Service for PostgreSQL to Managed Service for MySQL® using Data Transfer
    • Migrating data from Managed Service for PostgreSQL to Managed Service for OpenSearch using Data Transfer
    • Fixing string sorting issues in PostgreSQL after upgrading glibc
    • Migrating a database from Greenplum® to ClickHouse®
    • Migrating a database from Greenplum® to PostgreSQL
    • Exporting Greenplum® data to a cold storage in Object Storage
    • Loading data from Object Storage to Yandex MPP Analytics for PostgreSQL using Data Transfer
    • Copying data from Managed Service for OpenSearch to Yandex MPP Analytics for PostgreSQL using Yandex Data Transfer
    • Creating an external table from an Object Storage bucket table using a configuration file
    • Getting data from external sources using named queries in Greenplum®
    • Migrating a database from a third-party Valkey™ cluster to Yandex Managed Service for Valkey™
    • Using a Yandex Managed Service for Valkey™ cluster as a PHP session storage
    • Loading data from Object Storage to Managed Service for YDB using Data Transfer
    • Loading data from Managed Service for YDB to Object Storage using Data Transfer
    • Processing Audit Trails events
    • Processing Cloud Logging logs
    • Processing Debezium CDC streams
    • Analyzing data with Jupyter
    • Processing files with usage details in Yandex Cloud Billing
    • Ingesting data into storage systems
    • Smart log processing
    • Data transfer in microservice architectures
    • Migrating data to Object Storage using Data Transfer
    • Migrating data from a third-party Greenplum® or PostgreSQL cluster to Yandex MPP Analytics for PostgreSQL using Data Transfer
    • Migrating Yandex StoreDoc clusters
    • Migrating MySQL® clusters
    • Migrating to a third-party MySQL® cluster
    • Migrating PostgreSQL clusters
    • Creating a schema registry to deliver data in Debezium CDC format from Apache Kafka®
    • Automating operations using Yandex Managed Service for Apache Airflow™
    • Working with an Object Storage table from a PySpark job
    • Integrating Yandex Managed Service for Apache Spark™ with Apache Hive™ Metastore
    • Running a PySpark job using Yandex Managed Service for Apache Airflow™
    • Using Yandex Object Storage in Yandex Managed Service for Apache Spark™

In this article:

  • Required paid resources
  • Getting started
  • Send data to the topic
  • Make sure the bucket is not accessible from the external network
  • Check if there is data in the bucket via the service connection
  • Delete the resources you created
  1. Building a data platform
  2. Synchronizing Apache Kafka® topics in Object Storage with no web access

Syncing data from Apache Kafka® topics to an Object Storage bucket without using the internet

Written by
Yandex Cloud
Updated at September 8, 2025
  • Required paid resources
  • Getting started
  • Send data to the topic
  • Make sure the bucket is not accessible from the external network
  • Check if there is data in the bucket via the service connection
  • Delete the resources you created

Note

The VPC Private Endpoints feature in Yandex Virtual Private Cloud is at the Preview stage. To get access to the feature, contact your account manager.

You can synchronize data from Apache Kafka® topics to a Yandex Object Storage bucket without using the internet via a service connection in the user network hosting the Managed Service for Apache Kafka® cluster. To do this:

  1. Send data to the topic.
  2. Make sure the bucket is not accessible from the external network.
  3. Check if there is data in the bucket.

If you no longer need the resources you created, delete them.

Required paid resourcesRequired paid resources

The support cost for this solution includes:

  • Fee for an Object Storage bucket: Covers data storage and bucket operations (see Object Storage pricing).
  • Managed Service for Apache Kafka® cluster fee: Covers the use of computating resources allocated to hosts and disk space (see Managed Service for Apache Kafka® pricing).
  • Fee for using public IP addresses for cluster hosts (see Virtual Private Cloud pricing).

Getting startedGetting started

  1. Set up the infrastructure:

    Manually
    Terraform
    1. Create a network named my-private-network. Disable Create subnets when creating it.

    2. Create a subnet in any availability zone.

    3. Create a service connection to Object Storage in my-private-network and write down its ID.

    4. Create a service account named storage-pe-admin with the storage.admin role. The Managed Service for Apache Kafka® cluster will use it to access the bucket.

    5. Create a static access key for the storage-pe-admin service account.

    6. Create a Yandex Object Storage bucket and configure its bucket policy:

      • Result: Allow.
      • Action: All actions.
      • Resource: <bucket_name> and <bucket_name>/*.
      • Condition: Select the yc:private-endpoint-id key from the list and specify the ID of the created service connection as its value.
    7. Create a Managed Service for Apache Kafka® cluster of any suitable configuration and the following settings:

      • Broker hosts: One
      • Access to cluster hosts: Public
      • Network: my-private-network
    8. If using security groups in your cluster, make sure they are configured correctly and allow connecting to the cluster.

    9. In the cluster, create a topic named my-private-topic.

    10. In the cluster, create a user named mkf-user with the ACCESS_ROLE_PRODUCER access permission for the new topic.

    11. In the cluster, create a connector with the following settings:

      • Under Additional properties, specify the connector properties:
        • key.converter: org.apache.kafka.connect.storage.StringConverter
        • value.converter: org.apache.kafka.connect.converters.ByteArrayConverter
        • format.output.fields.value.encoding: none
      • Select the S3 Sink connector type.
      • In the Topics field, specify my-private-topic.
      • Under S3 connection, specify the following settings:
        • Bucket: Bucket you created previously.
        • Endpoint: storage.pe.yandexcloud.net.
        • Access key ID, Secret access key: ID and secret key of the previously created static access key.
    12. Create a VM with a public IP address in the created my-private-network to connect to the bucket.

    1. If you do not have Terraform yet, install it.

    2. Get the authentication credentials. You can add them to environment variables or specify them later in the provider configuration file.

    3. Configure and initialize a provider. There is no need to create a provider configuration file manually, you can download it.

    4. Place the configuration file in a separate working directory and specify the parameter values. If you did not add the authentication credentials to environment variables, specify them in the configuration file.

    5. Download the kafka-objstorage-sync-private-network.tf configuration file to the same working directory.

      This file describes:

      • Network.
      • Subnet.
      • Service connection.
      • Security group required for cluster connection.
      • Service account for creating and accessing the bucket.
      • Object Storage bucket.
      • Managed Service for Apache Kafka® cluster.
      • Apache Kafka® topic.
      • Apache Kafka® user.
      • Apache Kafka® connector.
      • VM to read data from the bucket.
    6. In the kafka-objstorage-sync-private-network.tf file, specify the following:

      • tf_account_name: Service account name, the same as the one in the provider settings.
      • bucket_name: Bucket name consistent with the naming conventions.
      • mkf_version: Apache Kafka® version.
      • mkf_user_password: Apache Kafka® user password.
      • vm_image_id: ID of the public image.
      • vm_username and vm_ssh_key: Username and absolute path to the public key, for access to the VM.
    7. Validate your Terraform configuration files using this command:

      terraform validate
      

      Terraform will display any configuration errors detected in your files.

    8. Create the required infrastructure:

      1. Run this command to view the planned changes:

        terraform plan
        

        If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

      2. If everything looks correct, apply the changes:

        1. Run this command:

          terraform apply
          
        2. Confirm updating the resources.

        3. Wait for the operation to complete.

      All the required resources will be created in the specified folder. You can check resource availability and their settings in the management console.

  2. Make sure that Yandex Cloud DNS has the *.storage.pe.yandexcloud.net record in the . service zone of the new network.

  3. Install kafkacat to write data to the Apache Kafka® topic.

    sudo apt update && sudo apt install --yes kafkacat
    

    Make sure you can use it to connect to the previously created Managed Service for Apache Kafka® cluster over SSL.

Send data to the topicSend data to the topic

  1. Send test data to my-private-topic using kafkacat:

    for i in $(echo {1..50})
        do
           echo "test message_"$i | kafkacat -P \
              -b <broker_host_FQDN>:9091 \
              -t my-private-topic \
              -k key \
              -X security.protocol=SASL_SSL \
              -X sasl.username="<username_in_source_cluster>" \
              -X sasl.password="<user_password_in_source_cluster>" \
              -X ssl.ca.location=/usr/local/share/ca-certificates/Yandex/YandexInternalRootCA.crt -Z
        done
    
  2. Make sure data is replicated to the bucket. To do this, open the bucket upload statistics and check the Modify Requests chart for requests.

Make sure the bucket is not accessible from the external networkMake sure the bucket is not accessible from the external network

  1. If you do not have the AWS CLI yet, install and configure it.

  2. Run this command to get a list of bucket objects at a public network address:

    aws s3 ls s3://<bucket_name> \
        --endpoint-url=https://storage.yandexcloud.net \
        --recursive
    

    Result:

    An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied
    
  3. Run this command to get a list of bucket objects at a private network address:

    aws s3 ls s3://<bucket_name> \
        --endpoint-url=https://storage.pe.yandexcloud.net \
        --recursive
    

    Result:

    Could not connect to the endpoint URL: "https://storage.pe.yandexcloud.net/<bucket_name>?list-type=2&prefix=&encoding-type=url"
    

Check if there is data in the bucket via the service connectionCheck if there is data in the bucket via the service connection

Connect to the previously created VM over SSH and do the following:

  1. Install and configure the AWS CLI.

  2. Run this command to get a list of bucket objects at a private network address:

    aws s3 ls s3://<bucket_name> \
        --endpoint-url=https://storage.pe.yandexcloud.net \
        --recursive
    

    Result:

    2025-08-01 14:38:23         20 my-private-topic-1-0
    2025-08-01 14:38:23        587 my-private-topic-1-1
    2025-08-01 14:38:24        440 my-private-topic-1-29
    

This result means Apache Kafka® topic data has been successfully synchronized via the service connection.

Delete the resources you createdDelete the resources you created

Some resources incur charges. To avoid paying for them, delete the resources you no longer need:

Manually
Terraform
  • Delete the Managed Service for Apache Kafka® cluster.
  • Delete the Object Storage bucket. Before deleting the bucket, delete all its objects.
  • Delete the VM.

First, delete all objects from the bucket you created previously.

  1. In the terminal window, go to the directory containing the infrastructure plan.

    Warning

    Make sure the directory has no Terraform manifests with the resources you want to keep. Terraform deletes all resources that were created using the manifests in the current directory.

  2. Delete resources:

    1. Run this command:

      terraform destroy
      
    2. Confirm deleting the resources and wait for the operation to complete.

    All the resources described in the Terraform manifests will be deleted.

Was the article helpful?

Previous
Configuring Kafka Connect to work with a Managed Service for Apache Kafka® cluster
Next
Managing data schemas in Managed Service for Apache Kafka®
© 2025 Direct Cursus Technology L.L.C.