Yandex Cloud
Search
Contact UsTry it for free
  • 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
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Terraform in Yandex Cloud
  • Getting started
  • Solution library
    • Overview
    • Release notes
          • dns_recordset
          • dns_zone
          • dns_zone_iam_binding

In this article:

  • Example usage
  • Schema
  • Required
  • Optional
  • Read-Only
  • Nested Schema for timeouts
  • Import
  1. Terraform reference
  2. Resources
  3. Cloud Domain Name System (DNS)
  4. Resources
  5. dns_recordset

yandex_dns_recordset (Resource)

Written by
Yandex Cloud
Updated at August 7, 2025
  • Example usage
  • Schema
    • Required
    • Optional
    • Read-Only
    • Nested Schema for timeouts
  • Import

Manages a DNS RecordSet within Yandex Cloud.

Example usageExample usage

//
// Create a new DNS Zone & two DNS Records on it.
//
resource "yandex_dns_zone" "zone1" {
  name        = "my_private_zone"
  description = "desc"

  labels = {
    label1 = "label-1-value"
  }

  zone             = "example.com."
  public           = false
  private_networks = [yandex_vpc_network.foo.id]
}

resource "yandex_dns_recordset" "rs1" {
  zone_id = yandex_dns_zone.zone1.id
  name    = "srv.example.com."
  type    = "A"
  ttl     = 200
  data    = ["10.1.0.1"]
}

resource "yandex_dns_recordset" "rs2" {
  zone_id = yandex_dns_zone.zone1.id
  name    = "srv2"
  type    = "A"
  ttl     = 200
  data    = ["10.1.0.2"]
}

// Auxiliary resource for DNS Zone
resource "yandex_vpc_network" "foo" {}

SchemaSchema

RequiredRequired

  • data (Set of String) The string data for the records in this record set.
  • name (String) The DNS name this record set will apply to.
  • ttl (Number) The time-to-live of this record set (seconds).
  • type (String) The DNS record set type.
  • zone_id (String) The id of the zone in which this record set will reside.

OptionalOptional

  • timeouts (Block, Optional) (see below for nested schema)

Read-OnlyRead-Only

  • id (String) The ID of this resource.

Nested Schema for Nested Schema for timeouts

Optional:

  • create (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
  • delete (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
  • update (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

ImportImport

The resource can be imported by using their resource ID. For getting the resource ID you can use Yandex Cloud Web Console or YC CLI.

# terraform import yandex_dns_recordset.<resource Name> <{zone_id}/{name}/{type}>
terraform import yandex_dns_recordset.rs1 dns9m**********tducf/srv.example.com./A

Was the article helpful?

Previous
dns_zone
Next
dns_zone
© 2025 Direct Cursus Technology L.L.C.