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"],
});
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"])
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
})
}
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",
},
});
});
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());
}
}
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
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 string
- The unique name of the resource.
- args DnsRecordsetV2Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args DnsRecordsetV2Args
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DnsRecordsetV2Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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" },
},
});
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: &opentelekomcloud.DnsRecordsetV2TimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
Ttl: pulumi.Float64(0),
ValueSpecs: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
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());
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",
})
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",
},
});
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
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 List<string>
- An array of DNS records.
- Type string
- The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
- Zone
Id 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.
- Dns
Recordset stringV2Id - 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
- Dictionary<string, string>
- The key/value pairs to associate with the zone.
- Timeouts
Dns
Recordset V2Timeouts - Ttl double
- The time to live (TTL) of the record set.
- Value
Specs Dictionary<string, string>
- Records []string
- An array of DNS records.
- Type string
- The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
- Zone
Id 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.
- Dns
Recordset stringV2Id - 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
- map[string]string
- The key/value pairs to associate with the zone.
- Timeouts
Dns
Recordset V2Timeouts Args - Ttl float64
- The time to live (TTL) of the record set.
- Value
Specs map[string]string
- records List<String>
- An array of DNS records.
- type String
- The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
- zone
Id 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.
- dns
Recordset StringV2Id - 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
- Map<String,String>
- The key/value pairs to associate with the zone.
- timeouts
Dns
Recordset V2Timeouts - ttl Double
- The time to live (TTL) of the record set.
- value
Specs Map<String,String>
- records string[]
- An array of DNS records.
- type string
- The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
- zone
Id 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.
- dns
Recordset stringV2Id - 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
- {[key: string]: string}
- The key/value pairs to associate with the zone.
- timeouts
Dns
Recordset V2Timeouts - ttl number
- The time to live (TTL) of the record set.
- value
Specs {[key: string]: string}
- records Sequence[str]
- An array of DNS records.
- type str
- The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
- zone_
id 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_ strv2_ id - 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
- Mapping[str, str]
- The key/value pairs to associate with the zone.
- timeouts
Dns
Recordset V2Timeouts Args - ttl float
- The time to live (TTL) of the record set.
- value_
specs Mapping[str, str]
- records List<String>
- An array of DNS records.
- type String
- The type of record set. Examples: "A", "MX". Changing this creates a new DNS record set.
- zone
Id 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.
- dns
Recordset StringV2Id - 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
- 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.
- value
Specs 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.
- bool
- Id string
- The provider-assigned unique ID for this managed resource.
- bool
- id String
- The provider-assigned unique ID for this managed resource.
- Boolean
- id string
- The provider-assigned unique ID for this managed resource.
- boolean
- id str
- The provider-assigned unique ID for this managed resource.
- bool
- id String
- The provider-assigned unique ID for this managed resource.
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Description string
- A description of the record set.
- Dns
Recordset stringV2Id - 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
- bool
- Dictionary<string, string>
- The key/value pairs to associate with the zone.
- Timeouts
Dns
Recordset V2Timeouts - 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.
- Value
Specs Dictionary<string, string> - Zone
Id 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.
- Dns
Recordset stringV2Id - 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
- bool
- map[string]string
- The key/value pairs to associate with the zone.
- Timeouts
Dns
Recordset V2Timeouts Args - 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.
- Value
Specs map[string]string - Zone
Id 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.
- dns
Recordset StringV2Id - 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
- Boolean
- Map<String,String>
- The key/value pairs to associate with the zone.
- timeouts
Dns
Recordset V2Timeouts - 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.
- value
Specs Map<String,String> - zone
Id 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.
- dns
Recordset stringV2Id - 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
- boolean
- {[key: string]: string}
- The key/value pairs to associate with the zone.
- timeouts
Dns
Recordset V2Timeouts - 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.
- value
Specs {[key: string]: string} - zone
Id 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_ strv2_ id - 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
- bool
- Mapping[str, str]
- The key/value pairs to associate with the zone.
- timeouts
Dns
Recordset V2Timeouts Args - 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.
- dns
Recordset StringV2Id - 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
- Boolean
- 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.
- value
Specs Map<String> - zone
Id 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
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>
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.