1. Packages
  2. DNSimple
  3. API Docs
  4. ZoneRecord
DNSimple v3.4.3 published on Thursday, May 23, 2024 by Pulumi

dnsimple.ZoneRecord

Explore with Pulumi AI

dnsimple logo
DNSimple v3.4.3 published on Thursday, May 23, 2024 by Pulumi

    Provides a DNSimple zone record resource.

    Deprecation warning

    You can still use the deprecated dnsimple.Record configuration, but be aware that it will be removed in the upcoming 1.0.0 release.

    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",
    });
    
    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")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-dnsimple/sdk/v3/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.String("3600"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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",
        });
    
    });
    
    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());
    
        }
    }
    
    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
    
    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",
    });
    
    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")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-dnsimple/sdk/v3/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.String("3600"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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",
        });
    
    });
    
    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());
    
        }
    }
    
    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
    

    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[str] = None,
                   ttl: Optional[str] = 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 string
    The unique name of the resource.
    args ZoneRecordArgs
    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 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 string
    The unique name of the resource.
    args ZoneRecordArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ZoneRecordArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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 = "string",
        Ttl = "string",
    });
    
    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.String("string"),
    	Ttl:      pulumi.String("string"),
    })
    
    var zoneRecordResource = new ZoneRecord("zoneRecordResource", ZoneRecordArgs.builder()
        .name("string")
        .type("string")
        .value("string")
        .zoneName("string")
        .priority("string")
        .ttl("string")
        .build());
    
    zone_record_resource = dnsimple.ZoneRecord("zoneRecordResource",
        name="string",
        type="string",
        value="string",
        zone_name="string",
        priority="string",
        ttl="string")
    
    const zoneRecordResource = new dnsimple.ZoneRecord("zoneRecordResource", {
        name: "string",
        type: "string",
        value: "string",
        zoneName: "string",
        priority: "string",
        ttl: "string",
    });
    
    type: dnsimple:ZoneRecord
    properties:
        name: string
        priority: string
        ttl: string
        type: string
        value: string
        zoneName: string
    

    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

    The ZoneRecord resource accepts the following input properties:

    Name string
    The name of the record
    Type string
    The type of the record
    Value string
    The value of the record
    ZoneName string
    The domain to add the record to
    Priority string
    The priority of the record - only useful for some record types
    Ttl string
    The TTL of the record
    Name string
    The name of the record
    Type string
    The type of the record
    Value string
    The value of the record
    ZoneName string
    The domain to add the record to
    Priority string
    The priority of the record - only useful for some record types
    Ttl string
    The TTL of the record
    name String
    The name of the record
    type String
    The type of the record
    value String
    The value of the record
    zoneName String
    The domain to add the record to
    priority String
    The priority of the record - only useful for some record types
    ttl String
    The TTL of the record
    name string
    The name of the record
    type string
    The type of the record
    value string
    The value of the record
    zoneName string
    The domain to add the record to
    priority string
    The priority of the record - only useful for some record types
    ttl string
    The TTL of the record
    name str
    The name of the record
    type str
    The type of the record
    value str
    The value of the record
    zone_name str
    The domain to add the record to
    priority str
    The priority of the record - only useful for some record types
    ttl str
    The TTL of the record
    name String
    The name of the record
    type String
    The type of the record
    value String
    The value of the record
    zoneName String
    The domain to add the record to
    priority String
    The priority of the record - only useful for some record types
    ttl String
    The TTL of the record

    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.
    QualifiedName string
    The FQDN of the record
    ZoneId string
    The domain ID of the record
    Id string
    The provider-assigned unique ID for this managed resource.
    QualifiedName string
    The FQDN of the record
    ZoneId string
    The domain ID of the record
    id String
    The provider-assigned unique ID for this managed resource.
    qualifiedName String
    The FQDN of the record
    zoneId String
    The domain ID of the record
    id string
    The provider-assigned unique ID for this managed resource.
    qualifiedName string
    The FQDN of the record
    zoneId string
    The domain ID of the record
    id str
    The provider-assigned unique ID for this managed resource.
    qualified_name str
    The FQDN of the record
    zone_id str
    The domain ID of the record
    id String
    The provider-assigned unique ID for this managed resource.
    qualifiedName String
    The FQDN of the record
    zoneId String
    The domain 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,
            priority: Optional[str] = None,
            qualified_name: Optional[str] = None,
            ttl: Optional[str] = None,
            type: Optional[str] = None,
            value: 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)
    Resource lookup is not supported in YAML
    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:
    Name string
    The name of the record
    Priority string
    The priority of the record - only useful for some record types
    QualifiedName string
    The FQDN of the record
    Ttl string
    The TTL of the record
    Type string
    The type of the record
    Value string
    The value of the record
    ZoneId string
    The domain ID of the record
    ZoneName string
    The domain to add the record to
    Name string
    The name of the record
    Priority string
    The priority of the record - only useful for some record types
    QualifiedName string
    The FQDN of the record
    Ttl string
    The TTL of the record
    Type string
    The type of the record
    Value string
    The value of the record
    ZoneId string
    The domain ID of the record
    ZoneName string
    The domain to add the record to
    name String
    The name of the record
    priority String
    The priority of the record - only useful for some record types
    qualifiedName String
    The FQDN of the record
    ttl String
    The TTL of the record
    type String
    The type of the record
    value String
    The value of the record
    zoneId String
    The domain ID of the record
    zoneName String
    The domain to add the record to
    name string
    The name of the record
    priority string
    The priority of the record - only useful for some record types
    qualifiedName string
    The FQDN of the record
    ttl string
    The TTL of the record
    type string
    The type of the record
    value string
    The value of the record
    zoneId string
    The domain ID of the record
    zoneName string
    The domain to add the record to
    name str
    The name of the record
    priority str
    The priority of the record - only useful for some record types
    qualified_name str
    The FQDN of the record
    ttl str
    The TTL of the record
    type str
    The type of the record
    value str
    The value of the record
    zone_id str
    The domain ID of the record
    zone_name str
    The domain to add the record to
    name String
    The name of the record
    priority String
    The priority of the record - only useful for some record types
    qualifiedName String
    The FQDN of the record
    ttl String
    The TTL of the record
    type String
    The type of the record
    value String
    The value of the record
    zoneId String
    The domain ID of the record
    zoneName String
    The domain 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

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

    Importing record www.example.com with record ID 1234

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

    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.
    dnsimple logo
    DNSimple v3.4.3 published on Thursday, May 23, 2024 by Pulumi