Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • 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
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 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®
    • 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 from Managed Service for OpenSearch to Managed Service for ClickHouse® with a storage change 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, processing, and exporting Object Storage data 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 version 4.4 to 6.0
    • Sharding Yandex StoreDoc collections
    • Yandex StoreDoc performance analysis and optimization
    • Managed Service for MySQL® performance analysis and optimization
    • 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® via 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
    • Configuring a cold storage 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
    • Sending email notifications in Managed Service for OpenSearch
    • Connecting an MCP client to an OpenSearch cluster
    • Creating a PostgreSQL cluster for 1C:Enterprise
    • Troubleshooting Managed Service for PostgreSQL cluster performance
    • Managed Service for PostgreSQL performance analysis and optimization
    • 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
    • Migrating a Managed Service for PostgreSQL cluster to a different version
    • 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 via 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 a glibc upgrade
    • Using a Yandex Lockbox secret in a PySpark job to connect to Yandex Managed Service for PostgreSQL
    • Configuring permissions for access to a secret created by Connection Manager for a Managed Service for PostgreSQL user
    • 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 a 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 usage detail files 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™
    • Yandex Managed Service for Apache Spark™ integration with DataSphere
    • Using a Yandex Lockbox secret in a PySpark job to connect to Yandex Managed Service for PostgreSQL
    • Running a PySpark job in Yandex Managed Service for YTsaurus

In this article:

  • Getting started
  • Required paid resources
  • Set up your infrastructure
  • Create PySpark jobs
  • Delete the resources you created
  1. Building a data platform
  2. Working with Apache Kafka® topics using Yandex Data Processing

Working with Apache Kafka® topics using PySpark jobs in Yandex Data Processing

Written by
Yandex Cloud
Updated at July 16, 2026
View in Markdown
  • Getting started
    • Required paid resources
  • Set up your infrastructure
  • Create PySpark jobs
  • Delete the resources you created

Yandex Data Processing clusters support integration with Managed Service for Apache Kafka® clusters. You can write and read messages to and from Apache Kafka® topics using PySpark jobs. Reading supports both batch processing and stream processing.

To configure integration between Managed Service for Apache Kafka® and Yandex Data Processing clusters:

  1. Set up your infrastructure.
  2. Create PySpark jobs.

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

Getting startedGetting started

Sign up for Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or create a new account.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can create or select a folder for your infrastructure on the cloud page.

Learn more about clouds and folders here.

Required paid resourcesRequired paid resources

  • Managed Service for Apache Kafka® cluster: use of computing resources allocated to hosts, storage and backup size (see Managed Service for Apache Kafka® pricing).
  • Yandex Data Processing cluster: use of computing resources with a Yandex Data Processing markup, use of network drives, retrieval and storage of logs, amount of outgoing traffic (see Yandex Data Processing pricing).
  • NAT gateway: hourly use of the gateway and its outgoing traffic (see Yandex Virtual Private Cloud pricing).
  • Yandex Object Storage bucket: use of storage, data operations (see Object Storage pricing).

Set up your infrastructureSet up your infrastructure

Manually
Terraform
  1. Create a cloud network named dataproc-network, without subnets.

  2. Create a subnet named dataproc-subnet-b in the ru-central1-b availability zone.

  3. Set up a NAT gateway for dataproc-subnet-b.

  4. Create a security group named dataproc-security-group in dataproc-network.

  5. Configure the security group.

  6. Create a service account named dataproc-sa with the following roles:

    • storage.viewer
    • storage.uploader
    • dataproc.agent
    • dataproc.user
  7. Create a bucket with a unique name within Object Storage.

  8. Grant the FULL_CONTROL permission for the new bucket to the dataproc-sa service account.

  9. Create a Yandex Data Processing cluster with the following parameters:

    • Cluster name: dataproc-cluster.

    • Environment: PRODUCTION.

    • Version: 2.1.

    • Services:

      • HDFS
      • LIVY
      • SPARK
      • TEZ
      • YARN
    • Service account: dataproc-sa.

    • Availability zone: ru-central1-b.

    • Bucket name: Name of the new bucket.

    • Network: dataproc-network.

    • Security groups: dataproc-security-group.

    • Subclusters: Master, one subcluster named Data and one subcluster named Compute.

  10. Create a Managed Service for Apache Kafka® cluster with the following parameters:

    • Cluster name: dataproc-kafka.
    • Environment: PRODUCTION.
    • Version: 3.5.
    • Availability zone: ru-central1-b.
    • Network: dataproc-network.
    • Security groups: dataproc-security-group.
    • Subnet: dataproc-subnet-b.
  11. Create an Apache Kafka® topic with the following parameters:

    • Name: dataproc-kafka-topic.
    • Number of partitions: 1.
    • Replication factor: 1.
  12. Create an Apache Kafka® user with the following parameters:

    • Name: user1.
    • Password: password1.
    • Topics the user gets permissions for: * (all topics).
    • Permissions for the topics: ACCESS_ROLE_CONSUMER, ACCESS_ROLE_PRODUCER, and ACCESS_ROLE_ADMIN.
  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-and-data-proc.tf configuration file to the same working directory.

    This file describes:

    • Network.
    • NAT gateway and route table required for Yandex Data Processing.
    • Subnet.
    • Security group for the Yandex Data Processing and Managed Service for Apache Kafka® clusters.
    • Service account for the Yandex Data Processing cluster.
    • Service account for managing the Yandex Object Storage bucket.
    • Yandex Object Storage bucket.
    • Static access key required to grant the service account permissions for the bucket.
    • Yandex Data Processing cluster.
    • Managed Service for Apache Kafka® cluster.
    • Apache Kafka® user.
    • Apache Kafka® topic.
  6. In kafka-and-data-proc.tf, specify the following:

    • folder_id: Cloud folder ID, same as in the provider settings.
    • dp_ssh_key: Absolute path to the public key for the Yandex Data Processing cluster. Learn more about connecting to a Yandex Data Processing host over SSH here.
  7. Make sure the Terraform configuration files are correct 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.

Create PySpark jobsCreate PySpark jobs

  1. On your local computer, save the following scripts:

    kafka-write.py

    Script for writing messages to an Apache Kafka® topic:

    #!/usr/bin/env python3
    
    from pyspark.sql import SparkSession, Row
    from pyspark.sql.functions import to_json, col, struct
    
    def main():
       spark = SparkSession.builder.appName("dataproc-kafka-write-app").getOrCreate()
    
       df = spark.createDataFrame([
          Row(msg="Test message #1 from dataproc-cluster"),
          Row(msg="Test message #2 from dataproc-cluster")
       ])
       df = df.select(to_json(struct([col(c).alias(c) for c in df.columns])).alias('value'))
       df.write.format("kafka") \
          .option("kafka.bootstrap.servers", "<host_FQDN>:9091") \
          .option("topic", "dataproc-kafka-topic") \
          .option("kafka.security.protocol", "SASL_SSL") \
          .option("kafka.sasl.mechanism", "SCRAM-SHA-512") \
          .option("kafka.sasl.jaas.config",
                  "org.apache.kafka.common.security.scram.ScramLoginModule required "
                  "username=user1 "
                  "password=password1 "
                  ";") \
          .save()
    
    if __name__ == "__main__":
       main()
    
    kafka-read-batch.py

    Script for reading from a topic and batch processing:

    #!/usr/bin/env python3
    
    from pyspark.sql import SparkSession, Row
    from pyspark.sql.functions import to_json, col, struct
    
    def main():
       spark = SparkSession.builder.appName("dataproc-kafka-read-batch-app").getOrCreate()
    
       df = spark.read.format("kafka") \
          .option("kafka.bootstrap.servers", "<host_FQDN>:9091") \
          .option("subscribe", "dataproc-kafka-topic") \
          .option("kafka.security.protocol", "SASL_SSL") \
          .option("kafka.sasl.mechanism", "SCRAM-SHA-512") \
          .option("kafka.sasl.jaas.config",
                  "org.apache.kafka.common.security.scram.ScramLoginModule required "
                  "username=user1 "
                  "password=password1 "
                  ";") \
          .option("startingOffsets", "earliest") \
          .load() \
          .selectExpr("CAST(value AS STRING)") \
          .where(col("value").isNotNull())
    
       df.write.format("text").save("s3a://<new_bucket_name>/kafka-read-batch-output")
    
    if __name__ == "__main__":
       main()
    
    kafka-read-stream.py

    Script for reading from a topic and stream processing:

    #!/usr/bin/env python3
    
    from pyspark.sql import SparkSession, Row
    from pyspark.sql.functions import to_json, col, struct
    
    def main():
       spark = SparkSession.builder.appName("dataproc-kafka-read-stream-app").getOrCreate()
    
       query = spark.readStream.format("kafka")\
          .option("kafka.bootstrap.servers", "<host_FQDN>:9091") \
          .option("subscribe", "dataproc-kafka-topic") \
          .option("kafka.security.protocol", "SASL_SSL") \
          .option("kafka.sasl.mechanism", "SCRAM-SHA-512") \
          .option("kafka.sasl.jaas.config",
                  "org.apache.kafka.common.security.scram.ScramLoginModule required "
                  "username=user1 "
                  "password=password1 "
                  ";") \
          .option("startingOffsets", "earliest")\
          .load()\
          .selectExpr("CAST(value AS STRING)")\
          .where(col("value").isNotNull())\
          .writeStream\
          .trigger(once=True)\
          .queryName("received_messages")\
          .format("memory")\
          .start()
    
       query.awaitTermination()
    
       df = spark.sql("select value from received_messages")
    
       df.write.format("text").save("s3a://<new_bucket_name>/kafka-read-stream-output")
    
    if __name__ == "__main__":
       main()
    
  2. Get the Apache Kafka® host FQDN and specify it in each script.

  3. Upload the prepared scripts to the bucket root.

  4. Create a PySpark job for writing a message to the Apache Kafka® topic. In the Main python file field, specify the script path: s3a://<new_bucket_name>/kafka-write.py.

  5. Wait for the job status to change to Done.

  6. Make sure the data is successfully written to the topic. To do this, create a new PySpark job for reading data from the topic and batch processing. In the Main python file field, specify the script path: s3a://<new_bucket_name>/kafka-read-batch.py.

  7. Wait for the new job status to change to Done.

  8. Download the file with the read data from the bucket:

    part-00000
    {"msg":"Test message #1 from dataproc-cluster"}
    {"msg":"Test message #2 from dataproc-cluster"}
    

    The file resides in the new folder named kafka-read-batch-output in the bucket.

  9. Read messages from the topic during stream processing. To do this, create another PySpark job. In the Main python file field, specify the script path: s3a://<new_bucket_name>/kafka-read-stream.py.

  10. Wait for the new job status to change to Done.

  11. Download the files with the read data from the bucket:

    part-00000
    {"msg":"Test message #1 from dataproc-cluster"}
    
    part-00001
    {"msg":"Test message #2 from dataproc-cluster"}
    

    The files reside in the new folder named kafka-read-stream-output in the bucket.

Note

You can view the job logs and search data in them using Yandex Cloud Logging. For more information, see Working with logs.

Delete the resources you createdDelete the resources you created

Some resources are not free of charge. Delete the resources you no longer need to avoid paying for them:

  1. Delete the objects from the bucket.

  2. Delete the rest of the resources depending on how you created them:

    Manually
    Terraform
    1. Yandex Data Processing cluster.
    2. Managed Service for Apache Kafka® cluster.
    3. Bucket.
    4. Security group.
    5. Subnet.
    6. Route table.
    7. NAT gateway.
    8. Network.
    9. Service account.
    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
Mounting Object Storage buckets to the file system of Yandex Data Processing hosts
Next
Automating operations with Yandex Data Processing using Managed Service for Apache Airflow™
© 2026 Direct Cursus Technology L.L.C.