1. Packages
  2. Ibm Provider
  3. API Docs
  4. DnsResourceRecord
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.DnsResourceRecord

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Create, update, or delete a DNS record. For more information, see managing DNS records.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const test_pdns_resource_record_a = new ibm.DnsResourceRecord("test-pdns-resource-record-a", {
        instanceId: ibm_resource_instance["test-pdns-instance"].guid,
        zoneId: ibm_dns_zone["test-pdns-zone"].zone_id,
        type: "A",
        rdata: "1.2.3.4",
        ttl: 3600,
    });
    const test_pdns_resource_record_aaaa = new ibm.DnsResourceRecord("test-pdns-resource-record-aaaa", {
        instanceId: ibm_resource_instance["test-pdns-instance"].guid,
        zoneId: ibm_dns_zone["test-pdns-zone"].zone_id,
        type: "AAAA",
        rdata: "2001:0db8:0012:0001:3c5e:7354:0000:5db5",
    });
    const test_pdns_resource_record_cname = new ibm.DnsResourceRecord("test-pdns-resource-record-cname", {
        instanceId: ibm_resource_instance["test-pdns-instance"].guid,
        zoneId: ibm_dns_zone["test-pdns-zone"].zone_id,
        type: "CNAME",
        rdata: "test.com",
    });
    const test_pdns_resource_record_ptr = new ibm.DnsResourceRecord("test-pdns-resource-record-ptr", {
        instanceId: ibm_resource_instance["test-pdns-instance"].guid,
        zoneId: ibm_dns_zone["test-pdns-zone"].zone_id,
        type: "PTR",
        rdata: "testA.test.com",
    });
    const test_pdns_resource_record_mx = new ibm.DnsResourceRecord("test-pdns-resource-record-mx", {
        instanceId: ibm_resource_instance["test-pdns-instance"].guid,
        zoneId: ibm_dns_zone["test-pdns-zone"].zone_id,
        type: "MX",
        rdata: "mailserver.test.com",
        preference: 10,
    });
    const test_pdns_resource_record_srv = new ibm.DnsResourceRecord("test-pdns-resource-record-srv", {
        instanceId: ibm_resource_instance["test-pdns-instance"].guid,
        zoneId: ibm_dns_zone["test-pdns-zone"].zone_id,
        type: "SRV",
        rdata: "tester.com",
        priority: 100,
        weight: 100,
        port: 8000,
        service: "_sip",
        protocol: "udp",
    });
    const test_pdns_resource_record_txt = new ibm.DnsResourceRecord("test-pdns-resource-record-txt", {
        instanceId: ibm_resource_instance["test-pdns-instance"].guid,
        zoneId: ibm_dns_zone["test-pdns-zone"].zone_id,
        type: "TXT",
        rdata: "textinformation",
        ttl: 900,
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    test_pdns_resource_record_a = ibm.DnsResourceRecord("test-pdns-resource-record-a",
        instance_id=ibm_resource_instance["test-pdns-instance"]["guid"],
        zone_id=ibm_dns_zone["test-pdns-zone"]["zone_id"],
        type="A",
        rdata="1.2.3.4",
        ttl=3600)
    test_pdns_resource_record_aaaa = ibm.DnsResourceRecord("test-pdns-resource-record-aaaa",
        instance_id=ibm_resource_instance["test-pdns-instance"]["guid"],
        zone_id=ibm_dns_zone["test-pdns-zone"]["zone_id"],
        type="AAAA",
        rdata="2001:0db8:0012:0001:3c5e:7354:0000:5db5")
    test_pdns_resource_record_cname = ibm.DnsResourceRecord("test-pdns-resource-record-cname",
        instance_id=ibm_resource_instance["test-pdns-instance"]["guid"],
        zone_id=ibm_dns_zone["test-pdns-zone"]["zone_id"],
        type="CNAME",
        rdata="test.com")
    test_pdns_resource_record_ptr = ibm.DnsResourceRecord("test-pdns-resource-record-ptr",
        instance_id=ibm_resource_instance["test-pdns-instance"]["guid"],
        zone_id=ibm_dns_zone["test-pdns-zone"]["zone_id"],
        type="PTR",
        rdata="testA.test.com")
    test_pdns_resource_record_mx = ibm.DnsResourceRecord("test-pdns-resource-record-mx",
        instance_id=ibm_resource_instance["test-pdns-instance"]["guid"],
        zone_id=ibm_dns_zone["test-pdns-zone"]["zone_id"],
        type="MX",
        rdata="mailserver.test.com",
        preference=10)
    test_pdns_resource_record_srv = ibm.DnsResourceRecord("test-pdns-resource-record-srv",
        instance_id=ibm_resource_instance["test-pdns-instance"]["guid"],
        zone_id=ibm_dns_zone["test-pdns-zone"]["zone_id"],
        type="SRV",
        rdata="tester.com",
        priority=100,
        weight=100,
        port=8000,
        service="_sip",
        protocol="udp")
    test_pdns_resource_record_txt = ibm.DnsResourceRecord("test-pdns-resource-record-txt",
        instance_id=ibm_resource_instance["test-pdns-instance"]["guid"],
        zone_id=ibm_dns_zone["test-pdns-zone"]["zone_id"],
        type="TXT",
        rdata="textinformation",
        ttl=900)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewDnsResourceRecord(ctx, "test-pdns-resource-record-a", &ibm.DnsResourceRecordArgs{
    			InstanceId: pulumi.Any(ibm_resource_instance.TestPdnsInstance.Guid),
    			ZoneId:     pulumi.Any(ibm_dns_zone.TestPdnsZone.Zone_id),
    			Type:       pulumi.String("A"),
    			Rdata:      pulumi.String("1.2.3.4"),
    			Ttl:        pulumi.Float64(3600),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ibm.NewDnsResourceRecord(ctx, "test-pdns-resource-record-aaaa", &ibm.DnsResourceRecordArgs{
    			InstanceId: pulumi.Any(ibm_resource_instance.TestPdnsInstance.Guid),
    			ZoneId:     pulumi.Any(ibm_dns_zone.TestPdnsZone.Zone_id),
    			Type:       pulumi.String("AAAA"),
    			Rdata:      pulumi.String("2001:0db8:0012:0001:3c5e:7354:0000:5db5"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ibm.NewDnsResourceRecord(ctx, "test-pdns-resource-record-cname", &ibm.DnsResourceRecordArgs{
    			InstanceId: pulumi.Any(ibm_resource_instance.TestPdnsInstance.Guid),
    			ZoneId:     pulumi.Any(ibm_dns_zone.TestPdnsZone.Zone_id),
    			Type:       pulumi.String("CNAME"),
    			Rdata:      pulumi.String("test.com"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ibm.NewDnsResourceRecord(ctx, "test-pdns-resource-record-ptr", &ibm.DnsResourceRecordArgs{
    			InstanceId: pulumi.Any(ibm_resource_instance.TestPdnsInstance.Guid),
    			ZoneId:     pulumi.Any(ibm_dns_zone.TestPdnsZone.Zone_id),
    			Type:       pulumi.String("PTR"),
    			Rdata:      pulumi.String("testA.test.com"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ibm.NewDnsResourceRecord(ctx, "test-pdns-resource-record-mx", &ibm.DnsResourceRecordArgs{
    			InstanceId: pulumi.Any(ibm_resource_instance.TestPdnsInstance.Guid),
    			ZoneId:     pulumi.Any(ibm_dns_zone.TestPdnsZone.Zone_id),
    			Type:       pulumi.String("MX"),
    			Rdata:      pulumi.String("mailserver.test.com"),
    			Preference: pulumi.Float64(10),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ibm.NewDnsResourceRecord(ctx, "test-pdns-resource-record-srv", &ibm.DnsResourceRecordArgs{
    			InstanceId: pulumi.Any(ibm_resource_instance.TestPdnsInstance.Guid),
    			ZoneId:     pulumi.Any(ibm_dns_zone.TestPdnsZone.Zone_id),
    			Type:       pulumi.String("SRV"),
    			Rdata:      pulumi.String("tester.com"),
    			Priority:   pulumi.Float64(100),
    			Weight:     pulumi.Float64(100),
    			Port:       pulumi.Float64(8000),
    			Service:    pulumi.String("_sip"),
    			Protocol:   pulumi.String("udp"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ibm.NewDnsResourceRecord(ctx, "test-pdns-resource-record-txt", &ibm.DnsResourceRecordArgs{
    			InstanceId: pulumi.Any(ibm_resource_instance.TestPdnsInstance.Guid),
    			ZoneId:     pulumi.Any(ibm_dns_zone.TestPdnsZone.Zone_id),
    			Type:       pulumi.String("TXT"),
    			Rdata:      pulumi.String("textinformation"),
    			Ttl:        pulumi.Float64(900),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var test_pdns_resource_record_a = new Ibm.DnsResourceRecord("test-pdns-resource-record-a", new()
        {
            InstanceId = ibm_resource_instance.Test_pdns_instance.Guid,
            ZoneId = ibm_dns_zone.Test_pdns_zone.Zone_id,
            Type = "A",
            Rdata = "1.2.3.4",
            Ttl = 3600,
        });
    
        var test_pdns_resource_record_aaaa = new Ibm.DnsResourceRecord("test-pdns-resource-record-aaaa", new()
        {
            InstanceId = ibm_resource_instance.Test_pdns_instance.Guid,
            ZoneId = ibm_dns_zone.Test_pdns_zone.Zone_id,
            Type = "AAAA",
            Rdata = "2001:0db8:0012:0001:3c5e:7354:0000:5db5",
        });
    
        var test_pdns_resource_record_cname = new Ibm.DnsResourceRecord("test-pdns-resource-record-cname", new()
        {
            InstanceId = ibm_resource_instance.Test_pdns_instance.Guid,
            ZoneId = ibm_dns_zone.Test_pdns_zone.Zone_id,
            Type = "CNAME",
            Rdata = "test.com",
        });
    
        var test_pdns_resource_record_ptr = new Ibm.DnsResourceRecord("test-pdns-resource-record-ptr", new()
        {
            InstanceId = ibm_resource_instance.Test_pdns_instance.Guid,
            ZoneId = ibm_dns_zone.Test_pdns_zone.Zone_id,
            Type = "PTR",
            Rdata = "testA.test.com",
        });
    
        var test_pdns_resource_record_mx = new Ibm.DnsResourceRecord("test-pdns-resource-record-mx", new()
        {
            InstanceId = ibm_resource_instance.Test_pdns_instance.Guid,
            ZoneId = ibm_dns_zone.Test_pdns_zone.Zone_id,
            Type = "MX",
            Rdata = "mailserver.test.com",
            Preference = 10,
        });
    
        var test_pdns_resource_record_srv = new Ibm.DnsResourceRecord("test-pdns-resource-record-srv", new()
        {
            InstanceId = ibm_resource_instance.Test_pdns_instance.Guid,
            ZoneId = ibm_dns_zone.Test_pdns_zone.Zone_id,
            Type = "SRV",
            Rdata = "tester.com",
            Priority = 100,
            Weight = 100,
            Port = 8000,
            Service = "_sip",
            Protocol = "udp",
        });
    
        var test_pdns_resource_record_txt = new Ibm.DnsResourceRecord("test-pdns-resource-record-txt", new()
        {
            InstanceId = ibm_resource_instance.Test_pdns_instance.Guid,
            ZoneId = ibm_dns_zone.Test_pdns_zone.Zone_id,
            Type = "TXT",
            Rdata = "textinformation",
            Ttl = 900,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.DnsResourceRecord;
    import com.pulumi.ibm.DnsResourceRecordArgs;
    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 test_pdns_resource_record_a = new DnsResourceRecord("test-pdns-resource-record-a", DnsResourceRecordArgs.builder()
                .instanceId(ibm_resource_instance.test-pdns-instance().guid())
                .zoneId(ibm_dns_zone.test-pdns-zone().zone_id())
                .type("A")
                .rdata("1.2.3.4")
                .ttl(3600)
                .build());
    
            var test_pdns_resource_record_aaaa = new DnsResourceRecord("test-pdns-resource-record-aaaa", DnsResourceRecordArgs.builder()
                .instanceId(ibm_resource_instance.test-pdns-instance().guid())
                .zoneId(ibm_dns_zone.test-pdns-zone().zone_id())
                .type("AAAA")
                .rdata("2001:0db8:0012:0001:3c5e:7354:0000:5db5")
                .build());
    
            var test_pdns_resource_record_cname = new DnsResourceRecord("test-pdns-resource-record-cname", DnsResourceRecordArgs.builder()
                .instanceId(ibm_resource_instance.test-pdns-instance().guid())
                .zoneId(ibm_dns_zone.test-pdns-zone().zone_id())
                .type("CNAME")
                .rdata("test.com")
                .build());
    
            var test_pdns_resource_record_ptr = new DnsResourceRecord("test-pdns-resource-record-ptr", DnsResourceRecordArgs.builder()
                .instanceId(ibm_resource_instance.test-pdns-instance().guid())
                .zoneId(ibm_dns_zone.test-pdns-zone().zone_id())
                .type("PTR")
                .rdata("testA.test.com")
                .build());
    
            var test_pdns_resource_record_mx = new DnsResourceRecord("test-pdns-resource-record-mx", DnsResourceRecordArgs.builder()
                .instanceId(ibm_resource_instance.test-pdns-instance().guid())
                .zoneId(ibm_dns_zone.test-pdns-zone().zone_id())
                .type("MX")
                .rdata("mailserver.test.com")
                .preference(10)
                .build());
    
            var test_pdns_resource_record_srv = new DnsResourceRecord("test-pdns-resource-record-srv", DnsResourceRecordArgs.builder()
                .instanceId(ibm_resource_instance.test-pdns-instance().guid())
                .zoneId(ibm_dns_zone.test-pdns-zone().zone_id())
                .type("SRV")
                .rdata("tester.com")
                .priority(100)
                .weight(100)
                .port(8000)
                .service("_sip")
                .protocol("udp")
                .build());
    
            var test_pdns_resource_record_txt = new DnsResourceRecord("test-pdns-resource-record-txt", DnsResourceRecordArgs.builder()
                .instanceId(ibm_resource_instance.test-pdns-instance().guid())
                .zoneId(ibm_dns_zone.test-pdns-zone().zone_id())
                .type("TXT")
                .rdata("textinformation")
                .ttl(900)
                .build());
    
        }
    }
    
    resources:
      test-pdns-resource-record-a:
        type: ibm:DnsResourceRecord
        properties:
          instanceId: ${ibm_resource_instance"test-pdns-instance"[%!s(MISSING)].guid}
          zoneId: ${ibm_dns_zone"test-pdns-zone"[%!s(MISSING)].zone_id}
          type: A
          rdata: 1.2.3.4
          ttl: 3600
      test-pdns-resource-record-aaaa:
        type: ibm:DnsResourceRecord
        properties:
          instanceId: ${ibm_resource_instance"test-pdns-instance"[%!s(MISSING)].guid}
          zoneId: ${ibm_dns_zone"test-pdns-zone"[%!s(MISSING)].zone_id}
          type: AAAA
          rdata: 2001:0db8:0012:0001:3c5e:7354:0000:5db5
      test-pdns-resource-record-cname:
        type: ibm:DnsResourceRecord
        properties:
          instanceId: ${ibm_resource_instance"test-pdns-instance"[%!s(MISSING)].guid}
          zoneId: ${ibm_dns_zone"test-pdns-zone"[%!s(MISSING)].zone_id}
          type: CNAME
          rdata: test.com
      test-pdns-resource-record-ptr:
        type: ibm:DnsResourceRecord
        properties:
          instanceId: ${ibm_resource_instance"test-pdns-instance"[%!s(MISSING)].guid}
          zoneId: ${ibm_dns_zone"test-pdns-zone"[%!s(MISSING)].zone_id}
          type: PTR
          rdata: testA.test.com
      test-pdns-resource-record-mx:
        type: ibm:DnsResourceRecord
        properties:
          instanceId: ${ibm_resource_instance"test-pdns-instance"[%!s(MISSING)].guid}
          zoneId: ${ibm_dns_zone"test-pdns-zone"[%!s(MISSING)].zone_id}
          type: MX
          rdata: mailserver.test.com
          preference: 10
      test-pdns-resource-record-srv:
        type: ibm:DnsResourceRecord
        properties:
          instanceId: ${ibm_resource_instance"test-pdns-instance"[%!s(MISSING)].guid}
          zoneId: ${ibm_dns_zone"test-pdns-zone"[%!s(MISSING)].zone_id}
          type: SRV
          rdata: tester.com
          priority: 100
          weight: 100
          port: 8000
          service: _sip
          protocol: udp
      test-pdns-resource-record-txt:
        type: ibm:DnsResourceRecord
        properties:
          instanceId: ${ibm_resource_instance"test-pdns-instance"[%!s(MISSING)].guid}
          zoneId: ${ibm_dns_zone"test-pdns-zone"[%!s(MISSING)].zone_id}
          type: TXT
          rdata: textinformation
          ttl: 900
    

    Create DnsResourceRecord Resource

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

    Constructor syntax

    new DnsResourceRecord(name: string, args: DnsResourceRecordArgs, opts?: CustomResourceOptions);
    @overload
    def DnsResourceRecord(resource_name: str,
                          args: DnsResourceRecordArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def DnsResourceRecord(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          rdata: Optional[str] = None,
                          instance_id: Optional[str] = None,
                          zone_id: Optional[str] = None,
                          type: Optional[str] = None,
                          protocol: Optional[str] = None,
                          priority: Optional[float] = None,
                          dns_resource_record_id: Optional[str] = None,
                          preference: Optional[float] = None,
                          service: Optional[str] = None,
                          timeouts: Optional[DnsResourceRecordTimeoutsArgs] = None,
                          ttl: Optional[float] = None,
                          port: Optional[float] = None,
                          weight: Optional[float] = None,
                          name: Optional[str] = None)
    func NewDnsResourceRecord(ctx *Context, name string, args DnsResourceRecordArgs, opts ...ResourceOption) (*DnsResourceRecord, error)
    public DnsResourceRecord(string name, DnsResourceRecordArgs args, CustomResourceOptions? opts = null)
    public DnsResourceRecord(String name, DnsResourceRecordArgs args)
    public DnsResourceRecord(String name, DnsResourceRecordArgs args, CustomResourceOptions options)
    
    type: ibm:DnsResourceRecord
    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 DnsResourceRecordArgs
    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 DnsResourceRecordArgs
    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 DnsResourceRecordArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DnsResourceRecordArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DnsResourceRecordArgs
    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 dnsResourceRecordResource = new Ibm.DnsResourceRecord("dnsResourceRecordResource", new()
    {
        Rdata = "string",
        InstanceId = "string",
        ZoneId = "string",
        Type = "string",
        Protocol = "string",
        Priority = 0,
        DnsResourceRecordId = "string",
        Preference = 0,
        Service = "string",
        Timeouts = new Ibm.Inputs.DnsResourceRecordTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Update = "string",
        },
        Ttl = 0,
        Port = 0,
        Weight = 0,
        Name = "string",
    });
    
    example, err := ibm.NewDnsResourceRecord(ctx, "dnsResourceRecordResource", &ibm.DnsResourceRecordArgs{
    	Rdata:               pulumi.String("string"),
    	InstanceId:          pulumi.String("string"),
    	ZoneId:              pulumi.String("string"),
    	Type:                pulumi.String("string"),
    	Protocol:            pulumi.String("string"),
    	Priority:            pulumi.Float64(0),
    	DnsResourceRecordId: pulumi.String("string"),
    	Preference:          pulumi.Float64(0),
    	Service:             pulumi.String("string"),
    	Timeouts: &ibm.DnsResourceRecordTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    	Ttl:    pulumi.Float64(0),
    	Port:   pulumi.Float64(0),
    	Weight: pulumi.Float64(0),
    	Name:   pulumi.String("string"),
    })
    
    var dnsResourceRecordResource = new DnsResourceRecord("dnsResourceRecordResource", DnsResourceRecordArgs.builder()
        .rdata("string")
        .instanceId("string")
        .zoneId("string")
        .type("string")
        .protocol("string")
        .priority(0)
        .dnsResourceRecordId("string")
        .preference(0)
        .service("string")
        .timeouts(DnsResourceRecordTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .update("string")
            .build())
        .ttl(0)
        .port(0)
        .weight(0)
        .name("string")
        .build());
    
    dns_resource_record_resource = ibm.DnsResourceRecord("dnsResourceRecordResource",
        rdata="string",
        instance_id="string",
        zone_id="string",
        type="string",
        protocol="string",
        priority=0,
        dns_resource_record_id="string",
        preference=0,
        service="string",
        timeouts={
            "create": "string",
            "delete": "string",
            "update": "string",
        },
        ttl=0,
        port=0,
        weight=0,
        name="string")
    
    const dnsResourceRecordResource = new ibm.DnsResourceRecord("dnsResourceRecordResource", {
        rdata: "string",
        instanceId: "string",
        zoneId: "string",
        type: "string",
        protocol: "string",
        priority: 0,
        dnsResourceRecordId: "string",
        preference: 0,
        service: "string",
        timeouts: {
            create: "string",
            "delete": "string",
            update: "string",
        },
        ttl: 0,
        port: 0,
        weight: 0,
        name: "string",
    });
    
    type: ibm:DnsResourceRecord
    properties:
        dnsResourceRecordId: string
        instanceId: string
        name: string
        port: 0
        preference: 0
        priority: 0
        protocol: string
        rdata: string
        service: string
        timeouts:
            create: string
            delete: string
            update: string
        ttl: 0
        type: string
        weight: 0
        zoneId: string
    

    DnsResourceRecord 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 DnsResourceRecord resource accepts the following input properties:

    InstanceId string
    The GUID of the private DNS instance.
    Rdata string
    The resource data of a DNS resource record.
    Type string
    The type of DNS record that you want to create. Supported values are A, AAAA, CNAME, PTR, TXT, MX, and SRV.
    ZoneId string
    The ID of the DNS zone where you want to create a DNS record.
    DnsResourceRecordId string
    (String) The unique identifier of the DNS record. The ID is composed of <instance_id>/<zone_id>/<dns_record_id>.
    Name string
    The name of the DNS record.
    Port double
    Required for SRV records. If you create an SRV record, enter the TCP or UDP port of the target server.
    Preference double
    Required for MX records. If you create an MX record, enter the preference of the record.
    Priority double
    Required for SRV records-If you create an SRV record, enter the priority of the record.
    Protocol string
    Required for SRV records. If you create an SRV record, enter the name of the protocol that you want.
    Service string
    Required for SRV records. If you create an SRV record, enter the name of the service that you want. The name must start with an underscore (_).
    Timeouts DnsResourceRecordTimeouts
    Ttl double
    The time to live (TTL) value of the DNS record to be created.
    Weight double
    Required for SRV records. If you create an SRV record, enter the weight of the record. The weight of distributing queries among multiple target servers.
    InstanceId string
    The GUID of the private DNS instance.
    Rdata string
    The resource data of a DNS resource record.
    Type string
    The type of DNS record that you want to create. Supported values are A, AAAA, CNAME, PTR, TXT, MX, and SRV.
    ZoneId string
    The ID of the DNS zone where you want to create a DNS record.
    DnsResourceRecordId string
    (String) The unique identifier of the DNS record. The ID is composed of <instance_id>/<zone_id>/<dns_record_id>.
    Name string
    The name of the DNS record.
    Port float64
    Required for SRV records. If you create an SRV record, enter the TCP or UDP port of the target server.
    Preference float64
    Required for MX records. If you create an MX record, enter the preference of the record.
    Priority float64
    Required for SRV records-If you create an SRV record, enter the priority of the record.
    Protocol string
    Required for SRV records. If you create an SRV record, enter the name of the protocol that you want.
    Service string
    Required for SRV records. If you create an SRV record, enter the name of the service that you want. The name must start with an underscore (_).
    Timeouts DnsResourceRecordTimeoutsArgs
    Ttl float64
    The time to live (TTL) value of the DNS record to be created.
    Weight float64
    Required for SRV records. If you create an SRV record, enter the weight of the record. The weight of distributing queries among multiple target servers.
    instanceId String
    The GUID of the private DNS instance.
    rdata String
    The resource data of a DNS resource record.
    type String
    The type of DNS record that you want to create. Supported values are A, AAAA, CNAME, PTR, TXT, MX, and SRV.
    zoneId String
    The ID of the DNS zone where you want to create a DNS record.
    dnsResourceRecordId String
    (String) The unique identifier of the DNS record. The ID is composed of <instance_id>/<zone_id>/<dns_record_id>.
    name String
    The name of the DNS record.
    port Double
    Required for SRV records. If you create an SRV record, enter the TCP or UDP port of the target server.
    preference Double
    Required for MX records. If you create an MX record, enter the preference of the record.
    priority Double
    Required for SRV records-If you create an SRV record, enter the priority of the record.
    protocol String
    Required for SRV records. If you create an SRV record, enter the name of the protocol that you want.
    service String
    Required for SRV records. If you create an SRV record, enter the name of the service that you want. The name must start with an underscore (_).
    timeouts DnsResourceRecordTimeouts
    ttl Double
    The time to live (TTL) value of the DNS record to be created.
    weight Double
    Required for SRV records. If you create an SRV record, enter the weight of the record. The weight of distributing queries among multiple target servers.
    instanceId string
    The GUID of the private DNS instance.
    rdata string
    The resource data of a DNS resource record.
    type string
    The type of DNS record that you want to create. Supported values are A, AAAA, CNAME, PTR, TXT, MX, and SRV.
    zoneId string
    The ID of the DNS zone where you want to create a DNS record.
    dnsResourceRecordId string
    (String) The unique identifier of the DNS record. The ID is composed of <instance_id>/<zone_id>/<dns_record_id>.
    name string
    The name of the DNS record.
    port number
    Required for SRV records. If you create an SRV record, enter the TCP or UDP port of the target server.
    preference number
    Required for MX records. If you create an MX record, enter the preference of the record.
    priority number
    Required for SRV records-If you create an SRV record, enter the priority of the record.
    protocol string
    Required for SRV records. If you create an SRV record, enter the name of the protocol that you want.
    service string
    Required for SRV records. If you create an SRV record, enter the name of the service that you want. The name must start with an underscore (_).
    timeouts DnsResourceRecordTimeouts
    ttl number
    The time to live (TTL) value of the DNS record to be created.
    weight number
    Required for SRV records. If you create an SRV record, enter the weight of the record. The weight of distributing queries among multiple target servers.
    instance_id str
    The GUID of the private DNS instance.
    rdata str
    The resource data of a DNS resource record.
    type str
    The type of DNS record that you want to create. Supported values are A, AAAA, CNAME, PTR, TXT, MX, and SRV.
    zone_id str
    The ID of the DNS zone where you want to create a DNS record.
    dns_resource_record_id str
    (String) The unique identifier of the DNS record. The ID is composed of <instance_id>/<zone_id>/<dns_record_id>.
    name str
    The name of the DNS record.
    port float
    Required for SRV records. If you create an SRV record, enter the TCP or UDP port of the target server.
    preference float
    Required for MX records. If you create an MX record, enter the preference of the record.
    priority float
    Required for SRV records-If you create an SRV record, enter the priority of the record.
    protocol str
    Required for SRV records. If you create an SRV record, enter the name of the protocol that you want.
    service str
    Required for SRV records. If you create an SRV record, enter the name of the service that you want. The name must start with an underscore (_).
    timeouts DnsResourceRecordTimeoutsArgs
    ttl float
    The time to live (TTL) value of the DNS record to be created.
    weight float
    Required for SRV records. If you create an SRV record, enter the weight of the record. The weight of distributing queries among multiple target servers.
    instanceId String
    The GUID of the private DNS instance.
    rdata String
    The resource data of a DNS resource record.
    type String
    The type of DNS record that you want to create. Supported values are A, AAAA, CNAME, PTR, TXT, MX, and SRV.
    zoneId String
    The ID of the DNS zone where you want to create a DNS record.
    dnsResourceRecordId String
    (String) The unique identifier of the DNS record. The ID is composed of <instance_id>/<zone_id>/<dns_record_id>.
    name String
    The name of the DNS record.
    port Number
    Required for SRV records. If you create an SRV record, enter the TCP or UDP port of the target server.
    preference Number
    Required for MX records. If you create an MX record, enter the preference of the record.
    priority Number
    Required for SRV records-If you create an SRV record, enter the priority of the record.
    protocol String
    Required for SRV records. If you create an SRV record, enter the name of the protocol that you want.
    service String
    Required for SRV records. If you create an SRV record, enter the name of the service that you want. The name must start with an underscore (_).
    timeouts Property Map
    ttl Number
    The time to live (TTL) value of the DNS record to be created.
    weight Number
    Required for SRV records. If you create an SRV record, enter the weight of the record. The weight of distributing queries among multiple target servers.

    Outputs

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

    CreatedOn string
    (Timestamp) The time when the DNS record was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedOn string
    (Timestamp) The time when the DNS record was modified.
    ResourceRecordId string
    (String) The ID of the DNS record.
    CreatedOn string
    (Timestamp) The time when the DNS record was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedOn string
    (Timestamp) The time when the DNS record was modified.
    ResourceRecordId string
    (String) The ID of the DNS record.
    createdOn String
    (Timestamp) The time when the DNS record was created.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedOn String
    (Timestamp) The time when the DNS record was modified.
    resourceRecordId String
    (String) The ID of the DNS record.
    createdOn string
    (Timestamp) The time when the DNS record was created.
    id string
    The provider-assigned unique ID for this managed resource.
    modifiedOn string
    (Timestamp) The time when the DNS record was modified.
    resourceRecordId string
    (String) The ID of the DNS record.
    created_on str
    (Timestamp) The time when the DNS record was created.
    id str
    The provider-assigned unique ID for this managed resource.
    modified_on str
    (Timestamp) The time when the DNS record was modified.
    resource_record_id str
    (String) The ID of the DNS record.
    createdOn String
    (Timestamp) The time when the DNS record was created.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedOn String
    (Timestamp) The time when the DNS record was modified.
    resourceRecordId String
    (String) The ID of the DNS record.

    Look up Existing DnsResourceRecord Resource

    Get an existing DnsResourceRecord 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?: DnsResourceRecordState, opts?: CustomResourceOptions): DnsResourceRecord
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_on: Optional[str] = None,
            dns_resource_record_id: Optional[str] = None,
            instance_id: Optional[str] = None,
            modified_on: Optional[str] = None,
            name: Optional[str] = None,
            port: Optional[float] = None,
            preference: Optional[float] = None,
            priority: Optional[float] = None,
            protocol: Optional[str] = None,
            rdata: Optional[str] = None,
            resource_record_id: Optional[str] = None,
            service: Optional[str] = None,
            timeouts: Optional[DnsResourceRecordTimeoutsArgs] = None,
            ttl: Optional[float] = None,
            type: Optional[str] = None,
            weight: Optional[float] = None,
            zone_id: Optional[str] = None) -> DnsResourceRecord
    func GetDnsResourceRecord(ctx *Context, name string, id IDInput, state *DnsResourceRecordState, opts ...ResourceOption) (*DnsResourceRecord, error)
    public static DnsResourceRecord Get(string name, Input<string> id, DnsResourceRecordState? state, CustomResourceOptions? opts = null)
    public static DnsResourceRecord get(String name, Output<String> id, DnsResourceRecordState state, CustomResourceOptions options)
    resources:  _:    type: ibm:DnsResourceRecord    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.
    The following state arguments are supported:
    CreatedOn string
    (Timestamp) The time when the DNS record was created.
    DnsResourceRecordId string
    (String) The unique identifier of the DNS record. The ID is composed of <instance_id>/<zone_id>/<dns_record_id>.
    InstanceId string
    The GUID of the private DNS instance.
    ModifiedOn string
    (Timestamp) The time when the DNS record was modified.
    Name string
    The name of the DNS record.
    Port double
    Required for SRV records. If you create an SRV record, enter the TCP or UDP port of the target server.
    Preference double
    Required for MX records. If you create an MX record, enter the preference of the record.
    Priority double
    Required for SRV records-If you create an SRV record, enter the priority of the record.
    Protocol string
    Required for SRV records. If you create an SRV record, enter the name of the protocol that you want.
    Rdata string
    The resource data of a DNS resource record.
    ResourceRecordId string
    (String) The ID of the DNS record.
    Service string
    Required for SRV records. If you create an SRV record, enter the name of the service that you want. The name must start with an underscore (_).
    Timeouts DnsResourceRecordTimeouts
    Ttl double
    The time to live (TTL) value of the DNS record to be created.
    Type string
    The type of DNS record that you want to create. Supported values are A, AAAA, CNAME, PTR, TXT, MX, and SRV.
    Weight double
    Required for SRV records. If you create an SRV record, enter the weight of the record. The weight of distributing queries among multiple target servers.
    ZoneId string
    The ID of the DNS zone where you want to create a DNS record.
    CreatedOn string
    (Timestamp) The time when the DNS record was created.
    DnsResourceRecordId string
    (String) The unique identifier of the DNS record. The ID is composed of <instance_id>/<zone_id>/<dns_record_id>.
    InstanceId string
    The GUID of the private DNS instance.
    ModifiedOn string
    (Timestamp) The time when the DNS record was modified.
    Name string
    The name of the DNS record.
    Port float64
    Required for SRV records. If you create an SRV record, enter the TCP or UDP port of the target server.
    Preference float64
    Required for MX records. If you create an MX record, enter the preference of the record.
    Priority float64
    Required for SRV records-If you create an SRV record, enter the priority of the record.
    Protocol string
    Required for SRV records. If you create an SRV record, enter the name of the protocol that you want.
    Rdata string
    The resource data of a DNS resource record.
    ResourceRecordId string
    (String) The ID of the DNS record.
    Service string
    Required for SRV records. If you create an SRV record, enter the name of the service that you want. The name must start with an underscore (_).
    Timeouts DnsResourceRecordTimeoutsArgs
    Ttl float64
    The time to live (TTL) value of the DNS record to be created.
    Type string
    The type of DNS record that you want to create. Supported values are A, AAAA, CNAME, PTR, TXT, MX, and SRV.
    Weight float64
    Required for SRV records. If you create an SRV record, enter the weight of the record. The weight of distributing queries among multiple target servers.
    ZoneId string
    The ID of the DNS zone where you want to create a DNS record.
    createdOn String
    (Timestamp) The time when the DNS record was created.
    dnsResourceRecordId String
    (String) The unique identifier of the DNS record. The ID is composed of <instance_id>/<zone_id>/<dns_record_id>.
    instanceId String
    The GUID of the private DNS instance.
    modifiedOn String
    (Timestamp) The time when the DNS record was modified.
    name String
    The name of the DNS record.
    port Double
    Required for SRV records. If you create an SRV record, enter the TCP or UDP port of the target server.
    preference Double
    Required for MX records. If you create an MX record, enter the preference of the record.
    priority Double
    Required for SRV records-If you create an SRV record, enter the priority of the record.
    protocol String
    Required for SRV records. If you create an SRV record, enter the name of the protocol that you want.
    rdata String
    The resource data of a DNS resource record.
    resourceRecordId String
    (String) The ID of the DNS record.
    service String
    Required for SRV records. If you create an SRV record, enter the name of the service that you want. The name must start with an underscore (_).
    timeouts DnsResourceRecordTimeouts
    ttl Double
    The time to live (TTL) value of the DNS record to be created.
    type String
    The type of DNS record that you want to create. Supported values are A, AAAA, CNAME, PTR, TXT, MX, and SRV.
    weight Double
    Required for SRV records. If you create an SRV record, enter the weight of the record. The weight of distributing queries among multiple target servers.
    zoneId String
    The ID of the DNS zone where you want to create a DNS record.
    createdOn string
    (Timestamp) The time when the DNS record was created.
    dnsResourceRecordId string
    (String) The unique identifier of the DNS record. The ID is composed of <instance_id>/<zone_id>/<dns_record_id>.
    instanceId string
    The GUID of the private DNS instance.
    modifiedOn string
    (Timestamp) The time when the DNS record was modified.
    name string
    The name of the DNS record.
    port number
    Required for SRV records. If you create an SRV record, enter the TCP or UDP port of the target server.
    preference number
    Required for MX records. If you create an MX record, enter the preference of the record.
    priority number
    Required for SRV records-If you create an SRV record, enter the priority of the record.
    protocol string
    Required for SRV records. If you create an SRV record, enter the name of the protocol that you want.
    rdata string
    The resource data of a DNS resource record.
    resourceRecordId string
    (String) The ID of the DNS record.
    service string
    Required for SRV records. If you create an SRV record, enter the name of the service that you want. The name must start with an underscore (_).
    timeouts DnsResourceRecordTimeouts
    ttl number
    The time to live (TTL) value of the DNS record to be created.
    type string
    The type of DNS record that you want to create. Supported values are A, AAAA, CNAME, PTR, TXT, MX, and SRV.
    weight number
    Required for SRV records. If you create an SRV record, enter the weight of the record. The weight of distributing queries among multiple target servers.
    zoneId string
    The ID of the DNS zone where you want to create a DNS record.
    created_on str
    (Timestamp) The time when the DNS record was created.
    dns_resource_record_id str
    (String) The unique identifier of the DNS record. The ID is composed of <instance_id>/<zone_id>/<dns_record_id>.
    instance_id str
    The GUID of the private DNS instance.
    modified_on str
    (Timestamp) The time when the DNS record was modified.
    name str
    The name of the DNS record.
    port float
    Required for SRV records. If you create an SRV record, enter the TCP or UDP port of the target server.
    preference float
    Required for MX records. If you create an MX record, enter the preference of the record.
    priority float
    Required for SRV records-If you create an SRV record, enter the priority of the record.
    protocol str
    Required for SRV records. If you create an SRV record, enter the name of the protocol that you want.
    rdata str
    The resource data of a DNS resource record.
    resource_record_id str
    (String) The ID of the DNS record.
    service str
    Required for SRV records. If you create an SRV record, enter the name of the service that you want. The name must start with an underscore (_).
    timeouts DnsResourceRecordTimeoutsArgs
    ttl float
    The time to live (TTL) value of the DNS record to be created.
    type str
    The type of DNS record that you want to create. Supported values are A, AAAA, CNAME, PTR, TXT, MX, and SRV.
    weight float
    Required for SRV records. If you create an SRV record, enter the weight of the record. The weight of distributing queries among multiple target servers.
    zone_id str
    The ID of the DNS zone where you want to create a DNS record.
    createdOn String
    (Timestamp) The time when the DNS record was created.
    dnsResourceRecordId String
    (String) The unique identifier of the DNS record. The ID is composed of <instance_id>/<zone_id>/<dns_record_id>.
    instanceId String
    The GUID of the private DNS instance.
    modifiedOn String
    (Timestamp) The time when the DNS record was modified.
    name String
    The name of the DNS record.
    port Number
    Required for SRV records. If you create an SRV record, enter the TCP or UDP port of the target server.
    preference Number
    Required for MX records. If you create an MX record, enter the preference of the record.
    priority Number
    Required for SRV records-If you create an SRV record, enter the priority of the record.
    protocol String
    Required for SRV records. If you create an SRV record, enter the name of the protocol that you want.
    rdata String
    The resource data of a DNS resource record.
    resourceRecordId String
    (String) The ID of the DNS record.
    service String
    Required for SRV records. If you create an SRV record, enter the name of the service that you want. The name must start with an underscore (_).
    timeouts Property Map
    ttl Number
    The time to live (TTL) value of the DNS record to be created.
    type String
    The type of DNS record that you want to create. Supported values are A, AAAA, CNAME, PTR, TXT, MX, and SRV.
    weight Number
    Required for SRV records. If you create an SRV record, enter the weight of the record. The weight of distributing queries among multiple target servers.
    zoneId String
    The ID of the DNS zone where you want to create a DNS record.

    Supporting Types

    DnsResourceRecordTimeouts, DnsResourceRecordTimeoutsArgs

    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

    The ibm_dns_resource_record resource can be imported by using the DNS record ID, zone ID and resource record ID.

    Syntax

    $ pulumi import ibm:index/dnsResourceRecord:DnsResourceRecord example <instance_id>/<zone_id>/<dns_record_id>
    

    Example

    $ pulumi import ibm:index/dnsResourceRecord:DnsResourceRecord example 6ffda12064634723b079acdb018ef308/5ffda12064634723b079acdb018ef308/6463472064634723b079acdb018a1206
    

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

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud