1. Packages
  2. Dnsimple Provider
  3. API Docs
  4. ZoneRecord
DNSimple v4.3.0 published on Thursday, Apr 10, 2025 by Pulumi

dnsimple.ZoneRecord

Explore with Pulumi AI

Provides a DNSimple zone record resource.

Example Usage

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

// Add a record to the root domain
const foobar = new dnsimple.ZoneRecord("foobar", {
    zoneName: dnsimpleDomain,
    name: "",
    value: "192.168.0.11",
    type: "A",
    ttl: 3600,
});
Copy
import pulumi
import pulumi_dnsimple as dnsimple

# Add a record to the root domain
foobar = dnsimple.ZoneRecord("foobar",
    zone_name=dnsimple_domain,
    name="",
    value="192.168.0.11",
    type="A",
    ttl=3600)
Copy
package main

import (
	"github.com/pulumi/pulumi-dnsimple/sdk/v4/go/dnsimple"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Add a record to the root domain
		_, err := dnsimple.NewZoneRecord(ctx, "foobar", &dnsimple.ZoneRecordArgs{
			ZoneName: pulumi.Any(dnsimpleDomain),
			Name:     pulumi.String(""),
			Value:    pulumi.String("192.168.0.11"),
			Type:     pulumi.String("A"),
			Ttl:      pulumi.Int(3600),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DNSimple = Pulumi.DNSimple;

return await Deployment.RunAsync(() => 
{
    // Add a record to the root domain
    var foobar = new DNSimple.ZoneRecord("foobar", new()
    {
        ZoneName = dnsimpleDomain,
        Name = "",
        Value = "192.168.0.11",
        Type = "A",
        Ttl = 3600,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dnsimple.ZoneRecord;
import com.pulumi.dnsimple.ZoneRecordArgs;
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) {
        // Add a record to the root domain
        var foobar = new ZoneRecord("foobar", ZoneRecordArgs.builder()
            .zoneName(dnsimpleDomain)
            .name("")
            .value("192.168.0.11")
            .type("A")
            .ttl(3600)
            .build());

    }
}
Copy
resources:
  # Add a record to the root domain
  foobar:
    type: dnsimple:ZoneRecord
    properties:
      zoneName: ${dnsimpleDomain}
      name: ""
      value: 192.168.0.11
      type: A
      ttl: 3600
Copy
import * as pulumi from "@pulumi/pulumi";
import * as dnsimple from "@pulumi/dnsimple";

// Add a record to a sub-domain
const foobar = new dnsimple.ZoneRecord("foobar", {
    zoneName: dnsimpleDomain,
    name: "terraform",
    value: "192.168.0.11",
    type: "A",
    ttl: 3600,
});
Copy
import pulumi
import pulumi_dnsimple as dnsimple

# Add a record to a sub-domain
foobar = dnsimple.ZoneRecord("foobar",
    zone_name=dnsimple_domain,
    name="terraform",
    value="192.168.0.11",
    type="A",
    ttl=3600)
Copy
package main

import (
	"github.com/pulumi/pulumi-dnsimple/sdk/v4/go/dnsimple"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Add a record to a sub-domain
		_, err := dnsimple.NewZoneRecord(ctx, "foobar", &dnsimple.ZoneRecordArgs{
			ZoneName: pulumi.Any(dnsimpleDomain),
			Name:     pulumi.String("terraform"),
			Value:    pulumi.String("192.168.0.11"),
			Type:     pulumi.String("A"),
			Ttl:      pulumi.Int(3600),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DNSimple = Pulumi.DNSimple;

return await Deployment.RunAsync(() => 
{
    // Add a record to a sub-domain
    var foobar = new DNSimple.ZoneRecord("foobar", new()
    {
        ZoneName = dnsimpleDomain,
        Name = "terraform",
        Value = "192.168.0.11",
        Type = "A",
        Ttl = 3600,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dnsimple.ZoneRecord;
import com.pulumi.dnsimple.ZoneRecordArgs;
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) {
        // Add a record to a sub-domain
        var foobar = new ZoneRecord("foobar", ZoneRecordArgs.builder()
            .zoneName(dnsimpleDomain)
            .name("terraform")
            .value("192.168.0.11")
            .type("A")
            .ttl(3600)
            .build());

    }
}
Copy
resources:
  # Add a record to a sub-domain
  foobar:
    type: dnsimple:ZoneRecord
    properties:
      zoneName: ${dnsimpleDomain}
      name: terraform
      value: 192.168.0.11
      type: A
      ttl: 3600
Copy

Create ZoneRecord Resource

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

Constructor syntax

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

@overload
def ZoneRecord(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               name: Optional[str] = None,
               type: Optional[str] = None,
               value: Optional[str] = None,
               zone_name: Optional[str] = None,
               priority: Optional[int] = None,
               regions: Optional[Sequence[str]] = None,
               ttl: Optional[int] = None)
func NewZoneRecord(ctx *Context, name string, args ZoneRecordArgs, opts ...ResourceOption) (*ZoneRecord, error)
public ZoneRecord(string name, ZoneRecordArgs args, CustomResourceOptions? opts = null)
public ZoneRecord(String name, ZoneRecordArgs args)
public ZoneRecord(String name, ZoneRecordArgs args, CustomResourceOptions options)
type: dnsimple:ZoneRecord
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. ZoneRecordArgs
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. ZoneRecordArgs
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. ZoneRecordArgs
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. ZoneRecordArgs
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. ZoneRecordArgs
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 zoneRecordResource = new DNSimple.ZoneRecord("zoneRecordResource", new()
{
    Name = "string",
    Type = "string",
    Value = "string",
    ZoneName = "string",
    Priority = 0,
    Regions = new[]
    {
        "string",
    },
    Ttl = 0,
});
Copy
example, err := dnsimple.NewZoneRecord(ctx, "zoneRecordResource", &dnsimple.ZoneRecordArgs{
	Name:     pulumi.String("string"),
	Type:     pulumi.String("string"),
	Value:    pulumi.String("string"),
	ZoneName: pulumi.String("string"),
	Priority: pulumi.Int(0),
	Regions: pulumi.StringArray{
		pulumi.String("string"),
	},
	Ttl: pulumi.Int(0),
})
Copy
var zoneRecordResource = new ZoneRecord("zoneRecordResource", ZoneRecordArgs.builder()
    .name("string")
    .type("string")
    .value("string")
    .zoneName("string")
    .priority(0)
    .regions("string")
    .ttl(0)
    .build());
Copy
zone_record_resource = dnsimple.ZoneRecord("zoneRecordResource",
    name="string",
    type="string",
    value="string",
    zone_name="string",
    priority=0,
    regions=["string"],
    ttl=0)
Copy
const zoneRecordResource = new dnsimple.ZoneRecord("zoneRecordResource", {
    name: "string",
    type: "string",
    value: "string",
    zoneName: "string",
    priority: 0,
    regions: ["string"],
    ttl: 0,
});
Copy
type: dnsimple:ZoneRecord
properties:
    name: string
    priority: 0
    regions:
        - string
    ttl: 0
    type: string
    value: string
    zoneName: string
Copy

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

Name This property is required. string
The name of the record
Type This property is required. string
The type of the record
Value This property is required. string
The value of the record
ZoneName This property is required. string
The zone name to add the record to
Priority int
The priority of the record - only useful for some record types
Regions List<string>
A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
Ttl int
The TTL of the record - defaults to 3600
Name This property is required. string
The name of the record
Type This property is required. string
The type of the record
Value This property is required. string
The value of the record
ZoneName This property is required. string
The zone name to add the record to
Priority int
The priority of the record - only useful for some record types
Regions []string
A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
Ttl int
The TTL of the record - defaults to 3600
name This property is required. String
The name of the record
type This property is required. String
The type of the record
value This property is required. String
The value of the record
zoneName This property is required. String
The zone name to add the record to
priority Integer
The priority of the record - only useful for some record types
regions List<String>
A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
ttl Integer
The TTL of the record - defaults to 3600
name This property is required. string
The name of the record
type This property is required. string
The type of the record
value This property is required. string
The value of the record
zoneName This property is required. string
The zone name to add the record to
priority number
The priority of the record - only useful for some record types
regions string[]
A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
ttl number
The TTL of the record - defaults to 3600
name This property is required. str
The name of the record
type This property is required. str
The type of the record
value This property is required. str
The value of the record
zone_name This property is required. str
The zone name to add the record to
priority int
The priority of the record - only useful for some record types
regions Sequence[str]
A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
ttl int
The TTL of the record - defaults to 3600
name This property is required. String
The name of the record
type This property is required. String
The type of the record
value This property is required. String
The value of the record
zoneName This property is required. String
The zone name to add the record to
priority Number
The priority of the record - only useful for some record types
regions List<String>
A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
ttl Number
The TTL of the record - defaults to 3600

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
NameNormalized string
QualifiedName string
The FQDN of the record
ValueNormalized string
The normalized value of the record
ZoneId string
The zone ID of the record
Id string
The provider-assigned unique ID for this managed resource.
NameNormalized string
QualifiedName string
The FQDN of the record
ValueNormalized string
The normalized value of the record
ZoneId string
The zone ID of the record
id String
The provider-assigned unique ID for this managed resource.
nameNormalized String
qualifiedName String
The FQDN of the record
valueNormalized String
The normalized value of the record
zoneId String
The zone ID of the record
id string
The provider-assigned unique ID for this managed resource.
nameNormalized string
qualifiedName string
The FQDN of the record
valueNormalized string
The normalized value of the record
zoneId string
The zone ID of the record
id str
The provider-assigned unique ID for this managed resource.
name_normalized str
qualified_name str
The FQDN of the record
value_normalized str
The normalized value of the record
zone_id str
The zone ID of the record
id String
The provider-assigned unique ID for this managed resource.
nameNormalized String
qualifiedName String
The FQDN of the record
valueNormalized String
The normalized value of the record
zoneId String
The zone ID of the record

Look up Existing ZoneRecord Resource

Get an existing ZoneRecord 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?: ZoneRecordState, opts?: CustomResourceOptions): ZoneRecord
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        name_normalized: Optional[str] = None,
        priority: Optional[int] = None,
        qualified_name: Optional[str] = None,
        regions: Optional[Sequence[str]] = None,
        ttl: Optional[int] = None,
        type: Optional[str] = None,
        value: Optional[str] = None,
        value_normalized: Optional[str] = None,
        zone_id: Optional[str] = None,
        zone_name: Optional[str] = None) -> ZoneRecord
func GetZoneRecord(ctx *Context, name string, id IDInput, state *ZoneRecordState, opts ...ResourceOption) (*ZoneRecord, error)
public static ZoneRecord Get(string name, Input<string> id, ZoneRecordState? state, CustomResourceOptions? opts = null)
public static ZoneRecord get(String name, Output<String> id, ZoneRecordState state, CustomResourceOptions options)
resources:  _:    type: dnsimple:ZoneRecord    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:
Name string
The name of the record
NameNormalized string
Priority int
The priority of the record - only useful for some record types
QualifiedName string
The FQDN of the record
Regions List<string>
A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
Ttl int
The TTL of the record - defaults to 3600
Type string
The type of the record
Value string
The value of the record
ValueNormalized string
The normalized value of the record
ZoneId string
The zone ID of the record
ZoneName string
The zone name to add the record to
Name string
The name of the record
NameNormalized string
Priority int
The priority of the record - only useful for some record types
QualifiedName string
The FQDN of the record
Regions []string
A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
Ttl int
The TTL of the record - defaults to 3600
Type string
The type of the record
Value string
The value of the record
ValueNormalized string
The normalized value of the record
ZoneId string
The zone ID of the record
ZoneName string
The zone name to add the record to
name String
The name of the record
nameNormalized String
priority Integer
The priority of the record - only useful for some record types
qualifiedName String
The FQDN of the record
regions List<String>
A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
ttl Integer
The TTL of the record - defaults to 3600
type String
The type of the record
value String
The value of the record
valueNormalized String
The normalized value of the record
zoneId String
The zone ID of the record
zoneName String
The zone name to add the record to
name string
The name of the record
nameNormalized string
priority number
The priority of the record - only useful for some record types
qualifiedName string
The FQDN of the record
regions string[]
A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
ttl number
The TTL of the record - defaults to 3600
type string
The type of the record
value string
The value of the record
valueNormalized string
The normalized value of the record
zoneId string
The zone ID of the record
zoneName string
The zone name to add the record to
name str
The name of the record
name_normalized str
priority int
The priority of the record - only useful for some record types
qualified_name str
The FQDN of the record
regions Sequence[str]
A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
ttl int
The TTL of the record - defaults to 3600
type str
The type of the record
value str
The value of the record
value_normalized str
The normalized value of the record
zone_id str
The zone ID of the record
zone_name str
The zone name to add the record to
name String
The name of the record
nameNormalized String
priority Number
The priority of the record - only useful for some record types
qualifiedName String
The FQDN of the record
regions List<String>
A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
ttl Number
The TTL of the record - defaults to 3600
type String
The type of the record
value String
The value of the record
valueNormalized String
The normalized value of the record
zoneId String
The zone ID of the record
zoneName String
The zone name to add the record to

Import

DNSimple resources can be imported using their parent zone name (domain name) and numeric record ID.

Importing record example.com with record ID 1234

bash

$ pulumi import dnsimple:index/zoneRecord:ZoneRecord resource_name example.com_1234
Copy

Importing record www.example.com with record ID 1234

bash

$ pulumi import dnsimple:index/zoneRecord:ZoneRecord resource_name example.com_1234
Copy

The record ID can be found in the URL when editing a record on the DNSimple web dashboard.

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

Package Details

Repository
DNSimple pulumi/pulumi-dnsimple
License
Apache-2.0
Notes
This Pulumi package is based on the dnsimple Terraform Provider.