Want to learn about running containers in Lambda? Join our free hands-on workshop. Register Now

DomainRecord

Provides a Linode Domain Record resource. This can be used to create, modify, and delete Linodes Domain Records. For more information, see DNS Manager and the Linode APIv4 docs.

Attributes

This resource exports no additional attributes.

Example Usage

using Pulumi;
using Linode = Pulumi.Linode;

class MyStack : Stack
{
    public MyStack()
    {
        var foobarDomain = new Linode.Domain("foobarDomain", new Linode.DomainArgs
        {
            Domain = "foobar.example",
            SoaEmail = "example@foobar.example",
            Type = "master",
        });
        var foobarDomainRecord = new Linode.DomainRecord("foobarDomainRecord", new Linode.DomainRecordArgs
        {
            DomainId = foobarDomain.Id,
            Name = "www",
            RecordType = "CNAME",
            Target = "foobar.example",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-linode/sdk/v2/go/linode"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        foobarDomain, err := linode.NewDomain(ctx, "foobarDomain", &linode.DomainArgs{
            Domain:   pulumi.String("foobar.example"),
            SoaEmail: pulumi.String("example@foobar.example"),
            Type:     pulumi.String("master"),
        })
        if err != nil {
            return err
        }
        _, err = linode.NewDomainRecord(ctx, "foobarDomainRecord", &linode.DomainRecordArgs{
            DomainId:   foobarDomain.ID(),
            Name:       pulumi.String("www"),
            RecordType: pulumi.String("CNAME"),
            Target:     pulumi.String("foobar.example"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_linode as linode

foobar_domain = linode.Domain("foobarDomain",
    domain="foobar.example",
    soa_email="example@foobar.example",
    type="master")
foobar_domain_record = linode.DomainRecord("foobarDomainRecord",
    domain_id=foobar_domain.id,
    name="www",
    record_type="CNAME",
    target="foobar.example")
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";

const foobarDomain = new linode.Domain("foobar", {
    domain: "foobar.example",
    soaEmail: "example@foobar.example",
    type: "master",
});
const foobarDomainRecord = new linode.DomainRecord("foobar", {
    domainId: foobarDomain.id.apply(id => Number.parseFloat(id)),
    name: "www",
    recordType: "CNAME",
    target: "foobar.example",
});

Create a DomainRecord Resource

def DomainRecord(resource_name: str, opts: Optional[ResourceOptions] = None, domain_id: Optional[int] = None, name: Optional[str] = None, port: Optional[int] = None, priority: Optional[int] = None, protocol: Optional[str] = None, record_type: Optional[str] = None, service: Optional[str] = None, tag: Optional[str] = None, target: Optional[str] = None, ttl_sec: Optional[int] = None, weight: Optional[int] = None)
func NewDomainRecord(ctx *Context, name string, args DomainRecordArgs, opts ...ResourceOption) (*DomainRecord, error)
name string
The unique name of the resource.
args DomainRecordArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DomainRecordArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DomainRecordArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

DomainRecord Resource Properties

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

Inputs

The DomainRecord resource accepts the following input properties:

DomainId int

The ID of the Domain to access. Changing domain_id forces the creation of a new Linode Domain Record..

RecordType string

The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. Changing record_type forces the creation of a new Linode Domain Record..

Target string

The target for this Record. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the address the named Domain should resolve to.

Name string

The name of this Record. Setting this is invalid for SRV records as it is generated by the API. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the subdomain being associated with an IP address.

Port int

The port this Record points to.

Priority int

The priority of the target host. Lower values are preferred.

Protocol string

The protocol this Record’s service communicates with. Only valid for SRV records.

Service string

The service this Record identified. Only valid for SRV records.

Tag string

The tag portion of a CAA record. It is invalid to set this on other record types.

TtlSec int

‘Time to Live’ - the amount of time in seconds that this Domain’s records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.

Weight int

The relative weight of this Record. Higher values are preferred.

DomainId int

The ID of the Domain to access. Changing domain_id forces the creation of a new Linode Domain Record..

RecordType string

The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. Changing record_type forces the creation of a new Linode Domain Record..

Target string

The target for this Record. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the address the named Domain should resolve to.

Name string

The name of this Record. Setting this is invalid for SRV records as it is generated by the API. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the subdomain being associated with an IP address.

Port int

The port this Record points to.

Priority int

The priority of the target host. Lower values are preferred.

Protocol string

The protocol this Record’s service communicates with. Only valid for SRV records.

Service string

The service this Record identified. Only valid for SRV records.

Tag string

The tag portion of a CAA record. It is invalid to set this on other record types.

TtlSec int

‘Time to Live’ - the amount of time in seconds that this Domain’s records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.

Weight int

The relative weight of this Record. Higher values are preferred.

domainId number

The ID of the Domain to access. Changing domain_id forces the creation of a new Linode Domain Record..

recordType string

The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. Changing record_type forces the creation of a new Linode Domain Record..

target string

The target for this Record. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the address the named Domain should resolve to.

name string

The name of this Record. Setting this is invalid for SRV records as it is generated by the API. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the subdomain being associated with an IP address.

port number

The port this Record points to.

priority number

The priority of the target host. Lower values are preferred.

protocol string

The protocol this Record’s service communicates with. Only valid for SRV records.

service string

The service this Record identified. Only valid for SRV records.

tag string

The tag portion of a CAA record. It is invalid to set this on other record types.

ttlSec number

‘Time to Live’ - the amount of time in seconds that this Domain’s records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.

weight number

The relative weight of this Record. Higher values are preferred.

domain_id int

The ID of the Domain to access. Changing domain_id forces the creation of a new Linode Domain Record..

record_type str

The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. Changing record_type forces the creation of a new Linode Domain Record..

target str

The target for this Record. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the address the named Domain should resolve to.

name str

The name of this Record. Setting this is invalid for SRV records as it is generated by the API. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the subdomain being associated with an IP address.

port int

The port this Record points to.

priority int

The priority of the target host. Lower values are preferred.

protocol str

The protocol this Record’s service communicates with. Only valid for SRV records.

service str

The service this Record identified. Only valid for SRV records.

tag str

The tag portion of a CAA record. It is invalid to set this on other record types.

ttl_sec int

‘Time to Live’ - the amount of time in seconds that this Domain’s records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.

weight int

The relative weight of this Record. Higher values are preferred.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing DomainRecord Resource

Get an existing DomainRecord 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?: DomainRecordState, opts?: CustomResourceOptions): DomainRecord
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, domain_id: Optional[int] = None, name: Optional[str] = None, port: Optional[int] = None, priority: Optional[int] = None, protocol: Optional[str] = None, record_type: Optional[str] = None, service: Optional[str] = None, tag: Optional[str] = None, target: Optional[str] = None, ttl_sec: Optional[int] = None, weight: Optional[int] = None) -> DomainRecord
func GetDomainRecord(ctx *Context, name string, id IDInput, state *DomainRecordState, opts ...ResourceOption) (*DomainRecord, error)
public static DomainRecord Get(string name, Input<string> id, DomainRecordState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

DomainId int

The ID of the Domain to access. Changing domain_id forces the creation of a new Linode Domain Record..

Name string

The name of this Record. Setting this is invalid for SRV records as it is generated by the API. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the subdomain being associated with an IP address.

Port int

The port this Record points to.

Priority int

The priority of the target host. Lower values are preferred.

Protocol string

The protocol this Record’s service communicates with. Only valid for SRV records.

RecordType string

The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. Changing record_type forces the creation of a new Linode Domain Record..

Service string

The service this Record identified. Only valid for SRV records.

Tag string

The tag portion of a CAA record. It is invalid to set this on other record types.

Target string

The target for this Record. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the address the named Domain should resolve to.

TtlSec int

‘Time to Live’ - the amount of time in seconds that this Domain’s records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.

Weight int

The relative weight of this Record. Higher values are preferred.

DomainId int

The ID of the Domain to access. Changing domain_id forces the creation of a new Linode Domain Record..

Name string

The name of this Record. Setting this is invalid for SRV records as it is generated by the API. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the subdomain being associated with an IP address.

Port int

The port this Record points to.

Priority int

The priority of the target host. Lower values are preferred.

Protocol string

The protocol this Record’s service communicates with. Only valid for SRV records.

RecordType string

The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. Changing record_type forces the creation of a new Linode Domain Record..

Service string

The service this Record identified. Only valid for SRV records.

Tag string

The tag portion of a CAA record. It is invalid to set this on other record types.

Target string

The target for this Record. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the address the named Domain should resolve to.

TtlSec int

‘Time to Live’ - the amount of time in seconds that this Domain’s records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.

Weight int

The relative weight of this Record. Higher values are preferred.

domainId number

The ID of the Domain to access. Changing domain_id forces the creation of a new Linode Domain Record..

name string

The name of this Record. Setting this is invalid for SRV records as it is generated by the API. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the subdomain being associated with an IP address.

port number

The port this Record points to.

priority number

The priority of the target host. Lower values are preferred.

protocol string

The protocol this Record’s service communicates with. Only valid for SRV records.

recordType string

The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. Changing record_type forces the creation of a new Linode Domain Record..

service string

The service this Record identified. Only valid for SRV records.

tag string

The tag portion of a CAA record. It is invalid to set this on other record types.

target string

The target for this Record. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the address the named Domain should resolve to.

ttlSec number

‘Time to Live’ - the amount of time in seconds that this Domain’s records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.

weight number

The relative weight of this Record. Higher values are preferred.

domain_id int

The ID of the Domain to access. Changing domain_id forces the creation of a new Linode Domain Record..

name str

The name of this Record. Setting this is invalid for SRV records as it is generated by the API. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the subdomain being associated with an IP address.

port int

The port this Record points to.

priority int

The priority of the target host. Lower values are preferred.

protocol str

The protocol this Record’s service communicates with. Only valid for SRV records.

record_type str

The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. Changing record_type forces the creation of a new Linode Domain Record..

service str

The service this Record identified. Only valid for SRV records.

tag str

The tag portion of a CAA record. It is invalid to set this on other record types.

target str

The target for this Record. This field’s actual usage depends on the type of record this represents. For A and AAAA records, this is the address the named Domain should resolve to.

ttl_sec int

‘Time to Live’ - the amount of time in seconds that this Domain’s records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.

weight int

The relative weight of this Record. Higher values are preferred.

Import

Linodes Domain Records can be imported using the Linode Domain id followed by the Domain Record id separated by a comma, e.g.

 $ pulumi import linode:index/domainRecord:DomainRecord www-foobar 1234567,7654321

The Linode Guide, Import Existing Infrastructure to Terraform, offers resource importing examples for Domain Records and other Linode resource types.

Package Details

Repository
https://github.com/pulumi/pulumi-linode
License
Apache-2.0
Notes
This Pulumi package is based on the linode Terraform Provider.