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.
Terraform in Yandex Cloud
  • Getting started
    • Overview
    • Providers
    • Resources
    • Data sources
    • Modules
    • States
  • Solution library

In this article:

  • Key advantages
  • How Terraform works
  • Usage example
  • See also
  1. Concepts
  2. Overview

Overview

Written by
Yandex Cloud
Updated at August 7, 2025
  • Key advantages
  • How Terraform works
  • Usage example
  • See also

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

Key advantagesKey advantages

  • Automation: Terraform enables you to quickly and easily create, update, and delete cloud resources for streamlined infrastructure management.
  • Code reuse: Terraform supports modules reusable across different projects. This reduces development and testing time.
  • Security: Terraform provides version control and audit of infrastructure changes through state snapshots. This helps to prevent unauthorized changes and ensures data security.

How Terraform worksHow Terraform works

Terraform follows a declarative approach to infrastructure management (Infrastructure as Code, IaC). You describe the desired end state of your infrastructure, and Terraform automatically creates, modifies, or deletes resources to achieve that state.

To use Terraform, install it on your computer, configure the provider, and create configuration files (*.tf) describing your infrastructure in HashiCorp Configuration Language (HCL). Then you can use Terraform commands to create, modify, or delete resources.

Usage exampleUsage example

Let's assume you want to create a VM in Yandex Cloud. The following code describes the configuration of a terraform1 VM with 2 cores and 2 GB of RAM, a boot disk named boot-disk-1, network interface connected to subnet-1, public IP address, and SSH key from a file located at the specified path:

resource "yandex_compute_instance" "vm-1" {
  name = "terraform1"

  resources {
    cores  = 2
    memory = 2
  }

  boot_disk {
    disk_id = yandex_compute_disk.boot-disk-1.id
  }

  network_interface {
    subnet_id = yandex_vpc_subnet.subnet-1.id
    nat       = true
  }

  metadata = {
    ssh-keys = "ubuntu:${file("~/.ssh/id_ed25519.pub")}"
  }
}

This is just a simple example of how you can use Terraform. With this tool, you can create complex infrastructures with multiple resources and dependencies, provide metadata, manage resources using service accounts, and more.

See alsoSee also

  • Providers
  • Resources
  • State
  • Data sources in Terraform

Was the article helpful?

Previous
Getting started
Next
Providers
© 2025 Direct Cursus Technology L.L.C.