1. Packages
  2. Opentelekomcloud Provider
  3. API Docs
  4. DnsRecordsetV2
opentelekomcloud 1.36.35 published on Monday, Apr 14, 2025 by opentelekomcloud

opentelekomcloud.DnsRecordsetV2

Explore with Pulumi AI

Up-to-date reference of API arguments for DNS recordset you can get at documentation portal

Manages a DNS record set in the OpenTelekomCloud DNS Service.

Example Usage

Automatically detect the correct network

import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";

const exampleZone = new opentelekomcloud.DnsZoneV2("exampleZone", {
    email: "email2@example.com",
    description: "a zone",
    ttl: 6000,
    type: "public",
});
const rsExampleCom = new opentelekomcloud.DnsRecordsetV2("rsExampleCom", {
    zoneId: exampleZone.dnsZoneV2Id,
    description: "An example record set",
    ttl: 3000,
    type: "A",
    records: ["10.0.0.1"],
});
const rsTxtExample = new opentelekomcloud.DnsRecordsetV2("rsTxtExample", {
    zoneId: opentelekomcloud_dns_zone_v2.zone_1.id,
    type: "TXT",
    description: "a record set",
    ttl: 300,
    records: ["v=spf1 include:my.example.try.com -all"],
});
Copy
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud

example_zone = opentelekomcloud.DnsZoneV2("exampleZone",
    email="email2@example.com",
    description="a zone",
    ttl=6000,
    type="public")
rs_example_com = opentelekomcloud.DnsRecordsetV2("rsExampleCom",
    zone_id=example_zone.dns_zone_v2_id,
    description="An example record set",
    ttl=3000,
    type="A",
    records=["10.0.0.1"])
rs_txt_example = opentelekomcloud.DnsRecordsetV2("rsTxtExample",
    zone_id=opentelekomcloud_dns_zone_v2["zone_1"]["id"],
    type="TXT",
    description="a record set",
    ttl=300,
    records=["v=spf1 include:my.example.try.com -all"])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleZone, err := opentelekomcloud.NewDnsZoneV2(ctx, "exampleZone", &opentelekomcloud.DnsZoneV2Args{
			Email:       pulumi.String("email2@example.com"),
			Description: pulumi.String("a zone"),
			Ttl:         pulumi.Float64(6000),
			Type:        pulumi.String("public"),
		})
		if err != nil {
			return err
		}
		_, err = opentelekomcloud.NewDnsRecordsetV2(ctx, "rsExampleCom", &opentelekomcloud.DnsRecordsetV2Args{
			ZoneId:      exampleZone.DnsZoneV2Id,
			Description: pulumi.String("An example record set"),
			Ttl:         pulumi.Float64(3000),
			Type:        pulumi.String("A"),
			Records: pulumi.StringArray{
				pulumi.String("10.0.0.1"),
			},
		})
		if err != nil {
			return err
		}
		_, err = opentelekomcloud.NewDnsRecordsetV2(ctx, "rsTxtExample", &opentelekomcloud.DnsRecordsetV2Args{
			ZoneId:      pulumi.Any(opentelekomcloud_dns_zone_v2.Zone_1.Id),
			Type:        pulumi.String("TXT"),
			Description: pulumi.String("a record set"),
			Ttl:         pulumi.Float64(300),
			Records: pulumi.StringArray{
				pulumi.String("v=spf1 include:my.example.try.com -all"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;

return await Deployment.RunAsync(() => 
{
    var exampleZone = new Opentelekomcloud.DnsZoneV2("exampleZone", new()
    {
        Email = "email2@example.com",
        Description = "a zone",
        Ttl = 6000,
        Type = "public",
    });

    var rsExampleCom = new Opentelekomcloud.DnsRecordsetV2("rsExampleCom", new()
    {
        ZoneId = exampleZone.DnsZoneV2Id,
        Description = "An example record set",
        Ttl = 3000,
        Type = "A",
        Records = new[]
        {
            "10.0.0.1",
        },
    });

    var rsTxtExample = new Opentelekomcloud.DnsRecordsetV2("rsTxtExample", new()
    {
        ZoneId = opentelekomcloud_dns_zone_v2.Zone_1.Id,
        Type = "TXT",
        Description = "a record set",
        Ttl = 300,
        Records = new[]
        {
            "v=spf1 include:my.example.try.com -all",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.DnsZoneV2;
import com.pulumi.opentelekomcloud.DnsZoneV2Args;
import com.pulumi.opentelekomcloud.DnsRecordsetV2;
import com.pulumi.opentelekomcloud.DnsRecordsetV2Args;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleZone = new DnsZoneV2("exampleZone", DnsZoneV2Args.builder()
            .email("email2@example.com")
            .description("a zone")
            .ttl(6000)
            .type("public")
            .build());

        var rsExampleCom = new DnsRecordsetV2("rsExampleCom", DnsRecordsetV2Args.builder()
            .zoneId(exampleZone.dnsZoneV2Id())
            .description("An example record set")
            .ttl(3000)
            .type("A")
            .records("10.0.0.1")
            .build());

        var rsTxtExample = new DnsRecordsetV2("rsTxtExample", DnsRecordsetV2Args.builder()
            .zoneId(opentelekomcloud_dns_zone_v2.zone_1().id())
            .type("TXT")
            .description("a record set")
            .ttl(300)
            .records("v=spf1 include:my.example.try.com -all")
            .build());

    }
}
Copy
resources:
  exampleZone:
    type: opentelekomcloud:DnsZoneV2
    properties:
      email: email2@example.com
      description: a zone
      ttl: 6000
      type: public
  rsExampleCom:
    type: opentelekomcloud:DnsRecordsetV2
    properties:
      zoneId: ${exampleZone.dnsZoneV2Id}
      description: An example record set
      ttl: 3000
      type: A
      records:
        - 10.0.0.1
  rsTxtExample:
    type: opentelekomcloud:DnsRecordsetV2
    properties:
      zoneId: ${opentelekomcloud_dns_zone_v2.zone_1.id}
      type: TXT
      description: a record set
      ttl: 300
      records:
        - v=spf1 include:my.example.try.com -all
Copy

Create DnsRecordsetV2 Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new DnsRecordsetV2(name: string, args: DnsRecordsetV2Args, opts?: CustomResourceOptions);
@overload
def DnsRecordsetV2(resource_name: str,
                   args: DnsRecordsetV2Args,
                   opts: Optional[ResourceOptions] = None)

@overload
def DnsRecordsetV2(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   records: Optional[Sequence[str]] = None,
                   type: Optional[str] = None,
                   zone_id: Optional[str] = None,
                   description: Optional[str] = None,
                   dns_recordset_v2_id: Optional[str] = None,
                   name: Optional[str] = None,
                   region: Optional[str] = None,
                   tags: Optional[Mapping[str, str]] = None,
                   timeouts: Optional[DnsRecordsetV2TimeoutsArgs] = None,
                   ttl: Optional[float] = None,
                   value_specs: Optional[Mapping[str, str]] = None)
func NewDnsRecordsetV2(ctx *Context, name string, args DnsRecordsetV2Args, opts ...ResourceOption) (*DnsRecordsetV2, error)
public DnsRecordsetV2(string name, DnsRecordsetV2Args args, CustomResourceOptions? opts = null)
public DnsRecordsetV2(String name, DnsRecordsetV2Args args)
public DnsRecordsetV2(String name, DnsRecordsetV2Args args, CustomResourceOptions options)
type: opentelekomcloud:DnsRecordsetV2
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. DnsRecordsetV2Args
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. DnsRecordsetV2Args
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. DnsRecordsetV2Args
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. DnsRecordsetV2Args
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. DnsRecordsetV2Args
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var dnsRecordsetV2Resource = new Opentelekomcloud.DnsRecordsetV2("dnsRecordsetV2Resource", new()
{
    Records = new[]
    {
        "string",
    },
    Type = "string",
    ZoneId = "string",
    Description = "string",
    DnsRecordsetV2Id = "string",
    Name = "string",
    Region = "string",
    Tags = 
    {
        { "string", "string" },
    },
    Timeouts = new Opentelekomcloud.Inputs.DnsRecordsetV2TimeoutsArgs
    {
        Create = "string",
        Delete = "string",
        Update = "string",
    },
    Ttl = 0,
    ValueSpecs = 
    {
        { "string", "string" },
    },
});
Copy
example, err := opentelekomcloud.NewDnsRecordsetV2(ctx, "dnsRecordsetV2Resource", &opentelekomcloud.DnsRecordsetV2Args{
Records: pulumi.StringArray{
pulumi.String("string"),
},
Type: pulumi.String("string"),
ZoneId: pulumi.String("string"),
Description: pulumi.String("string"),
DnsRecordsetV2Id: pulumi.String("string"),
Name: pulumi.String("string"),
Region: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
Timeouts: &.DnsRecordsetV2TimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
Ttl: pulumi.Float64(0),
ValueSpecs: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
Copy
var dnsRecordsetV2Resource = new DnsRecordsetV2("dnsRecordsetV2Resource", DnsRecordsetV2Args.builder()
    .records("string")
    .type("string")
    .zoneId("string")
    .description("string")
    .dnsRecordsetV2Id("string")
    .name("string")
    .region("string")
    .tags(Map.of("string", "string"))
    .timeouts(DnsRecordsetV2TimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .update("string")
        .build())
    .ttl(0)
    .valueSpecs(Map.of("string", "string"))
    .build());
Copy
dns_recordset_v2_resource = opentelekomcloud.DnsRecordsetV2("dnsRecordsetV2Resource",
    records=["string"],
    type="string",
    zone_id="string",
    description="string",
    dns_recordset_v2_id="string",
    name="string",
    region="string",
    tags={
        "string": "string",
    },
    timeouts={
        "create": "string",
        "delete": "string",
        "update": "string",
    },
    ttl=0,
    value_specs={
        "string": "string",
    })
Copy
const dnsRecordsetV2Resource = new opentelekomcloud.DnsRecordsetV2("dnsRecordsetV2Resource", {
    records: ["string"],
    type: "string",
    zoneId: "string",
    description: "string",
    dnsRecordsetV2Id: "string",
    name: "string",
    region: "string",
    tags: {
        string: "string",
    },
    timeouts: {
        create: "string",
        "delete": "string",
        update: "string",
    },
    ttl: 0,
    valueSpecs: {
        string: "string",
    },
});
Copy
type: opentelekomcloud:DnsRecordsetV2
properties:
    description: string
    dnsRecordsetV2Id: string
    name: string
    records:
        - string
    region: string
    tags:
        string: string
    timeouts:
        create: string
        delete: string
        update: string
    ttl: 0
    type: string
    valueSpecs:
        string: string
    zoneId: string
Copy

DnsRecordsetV2 Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The DnsRecordsetV2 resource accepts the following input properties:

Records This property is required. List<string>
An array of DNS records.
Type This property is required. string
The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
ZoneId This property is required. string
The ID of the zone in which to create the record set. Changing this creates a new DNS record set.
Description string
A description of the record set.
DnsRecordsetV2Id string
Name string

The name of the record set. Changing this creates a new DNS record set.

Note: The . at the end of the name.

Region string
Tags Dictionary<string, string>
The key/value pairs to associate with the zone.
Timeouts DnsRecordsetV2Timeouts
Ttl double
The time to live (TTL) of the record set.
ValueSpecs Dictionary<string, string>
Records This property is required. []string
An array of DNS records.
Type This property is required. string
The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
ZoneId This property is required. string
The ID of the zone in which to create the record set. Changing this creates a new DNS record set.
Description string
A description of the record set.
DnsRecordsetV2Id string
Name string

The name of the record set. Changing this creates a new DNS record set.

Note: The . at the end of the name.

Region string
Tags map[string]string
The key/value pairs to associate with the zone.
Timeouts DnsRecordsetV2TimeoutsArgs
Ttl float64
The time to live (TTL) of the record set.
ValueSpecs map[string]string
records This property is required. List<String>
An array of DNS records.
type This property is required. String
The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
zoneId This property is required. String
The ID of the zone in which to create the record set. Changing this creates a new DNS record set.
description String
A description of the record set.
dnsRecordsetV2Id String
name String

The name of the record set. Changing this creates a new DNS record set.

Note: The . at the end of the name.

region String
tags Map<String,String>
The key/value pairs to associate with the zone.
timeouts DnsRecordsetV2Timeouts
ttl Double
The time to live (TTL) of the record set.
valueSpecs Map<String,String>
records This property is required. string[]
An array of DNS records.
type This property is required. string
The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
zoneId This property is required. string
The ID of the zone in which to create the record set. Changing this creates a new DNS record set.
description string
A description of the record set.
dnsRecordsetV2Id string
name string

The name of the record set. Changing this creates a new DNS record set.

Note: The . at the end of the name.

region string
tags {[key: string]: string}
The key/value pairs to associate with the zone.
timeouts DnsRecordsetV2Timeouts
ttl number
The time to live (TTL) of the record set.
valueSpecs {[key: string]: string}
records This property is required. Sequence[str]
An array of DNS records.
type This property is required. str
The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
zone_id This property is required. str
The ID of the zone in which to create the record set. Changing this creates a new DNS record set.
description str
A description of the record set.
dns_recordset_v2_id str
name str

The name of the record set. Changing this creates a new DNS record set.

Note: The . at the end of the name.

region str
tags Mapping[str, str]
The key/value pairs to associate with the zone.
timeouts DnsRecordsetV2TimeoutsArgs
ttl float
The time to live (TTL) of the record set.
value_specs Mapping[str, str]
records This property is required. List<String>
An array of DNS records.
type This property is required. String
The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
zoneId This property is required. String
The ID of the zone in which to create the record set. Changing this creates a new DNS record set.
description String
A description of the record set.
dnsRecordsetV2Id String
name String

The name of the record set. Changing this creates a new DNS record set.

Note: The . at the end of the name.

region String
tags Map<String>
The key/value pairs to associate with the zone.
timeouts Property Map
ttl Number
The time to live (TTL) of the record set.
valueSpecs Map<String>

Outputs

All input properties are implicitly available as output properties. Additionally, the DnsRecordsetV2 resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Shared bool
Id string
The provider-assigned unique ID for this managed resource.
Shared bool
id String
The provider-assigned unique ID for this managed resource.
shared Boolean
id string
The provider-assigned unique ID for this managed resource.
shared boolean
id str
The provider-assigned unique ID for this managed resource.
shared bool
id String
The provider-assigned unique ID for this managed resource.
shared Boolean

Look up Existing DnsRecordsetV2 Resource

Get an existing DnsRecordsetV2 resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DnsRecordsetV2State, opts?: CustomResourceOptions): DnsRecordsetV2
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        dns_recordset_v2_id: Optional[str] = None,
        name: Optional[str] = None,
        records: Optional[Sequence[str]] = None,
        region: Optional[str] = None,
        shared: Optional[bool] = None,
        tags: Optional[Mapping[str, str]] = None,
        timeouts: Optional[DnsRecordsetV2TimeoutsArgs] = None,
        ttl: Optional[float] = None,
        type: Optional[str] = None,
        value_specs: Optional[Mapping[str, str]] = None,
        zone_id: Optional[str] = None) -> DnsRecordsetV2
func GetDnsRecordsetV2(ctx *Context, name string, id IDInput, state *DnsRecordsetV2State, opts ...ResourceOption) (*DnsRecordsetV2, error)
public static DnsRecordsetV2 Get(string name, Input<string> id, DnsRecordsetV2State? state, CustomResourceOptions? opts = null)
public static DnsRecordsetV2 get(String name, Output<String> id, DnsRecordsetV2State state, CustomResourceOptions options)
resources:  _:    type: opentelekomcloud:DnsRecordsetV2    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Description string
A description of the record set.
DnsRecordsetV2Id string
Name string

The name of the record set. Changing this creates a new DNS record set.

Note: The . at the end of the name.

Records List<string>
An array of DNS records.
Region string
Shared bool
Tags Dictionary<string, string>
The key/value pairs to associate with the zone.
Timeouts DnsRecordsetV2Timeouts
Ttl double
The time to live (TTL) of the record set.
Type string
The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
ValueSpecs Dictionary<string, string>
ZoneId string
The ID of the zone in which to create the record set. Changing this creates a new DNS record set.
Description string
A description of the record set.
DnsRecordsetV2Id string
Name string

The name of the record set. Changing this creates a new DNS record set.

Note: The . at the end of the name.

Records []string
An array of DNS records.
Region string
Shared bool
Tags map[string]string
The key/value pairs to associate with the zone.
Timeouts DnsRecordsetV2TimeoutsArgs
Ttl float64
The time to live (TTL) of the record set.
Type string
The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
ValueSpecs map[string]string
ZoneId string
The ID of the zone in which to create the record set. Changing this creates a new DNS record set.
description String
A description of the record set.
dnsRecordsetV2Id String
name String

The name of the record set. Changing this creates a new DNS record set.

Note: The . at the end of the name.

records List<String>
An array of DNS records.
region String
shared Boolean
tags Map<String,String>
The key/value pairs to associate with the zone.
timeouts DnsRecordsetV2Timeouts
ttl Double
The time to live (TTL) of the record set.
type String
The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
valueSpecs Map<String,String>
zoneId String
The ID of the zone in which to create the record set. Changing this creates a new DNS record set.
description string
A description of the record set.
dnsRecordsetV2Id string
name string

The name of the record set. Changing this creates a new DNS record set.

Note: The . at the end of the name.

records string[]
An array of DNS records.
region string
shared boolean
tags {[key: string]: string}
The key/value pairs to associate with the zone.
timeouts DnsRecordsetV2Timeouts
ttl number
The time to live (TTL) of the record set.
type string
The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
valueSpecs {[key: string]: string}
zoneId string
The ID of the zone in which to create the record set. Changing this creates a new DNS record set.
description str
A description of the record set.
dns_recordset_v2_id str
name str

The name of the record set. Changing this creates a new DNS record set.

Note: The . at the end of the name.

records Sequence[str]
An array of DNS records.
region str
shared bool
tags Mapping[str, str]
The key/value pairs to associate with the zone.
timeouts DnsRecordsetV2TimeoutsArgs
ttl float
The time to live (TTL) of the record set.
type str
The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
value_specs Mapping[str, str]
zone_id str
The ID of the zone in which to create the record set. Changing this creates a new DNS record set.
description String
A description of the record set.
dnsRecordsetV2Id String
name String

The name of the record set. Changing this creates a new DNS record set.

Note: The . at the end of the name.

records List<String>
An array of DNS records.
region String
shared Boolean
tags Map<String>
The key/value pairs to associate with the zone.
timeouts Property Map
ttl Number
The time to live (TTL) of the record set.
type String
The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
valueSpecs Map<String>
zoneId String
The ID of the zone in which to create the record set. Changing this creates a new DNS record set.

Supporting Types

DnsRecordsetV2Timeouts
, DnsRecordsetV2TimeoutsArgs

Create string
Delete string
Update string
Create string
Delete string
Update string
create String
delete String
update String
create string
delete string
update string
create str
delete str
update str
create String
delete String
update String

Import

This resource can be imported by specifying the zone ID and recordset ID,

separated by a forward slash.

$ pulumi import opentelekomcloud:index/dnsRecordsetV2:DnsRecordsetV2 recordset_1 <zone_id>/<recordset_id>
Copy

Imported key pairs are considered to be not shared.

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
License
Notes
This Pulumi package is based on the opentelekomcloud Terraform Provider.