Show / Hide Table of Contents

Class DnsRecord

Provides a DigitalOcean DNS record resource.

Example Usage

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
public MyStack()
{
    var @default = new DigitalOcean.Domain("default", new DigitalOcean.DomainArgs
    {
        Name = "example.com",
    });
    // Add an A record to the domain for www.example.com.
    var www = new DigitalOcean.DnsRecord("www", new DigitalOcean.DnsRecordArgs
    {
        Domain = @default.Name,
        Type = "A",
        Value = "192.168.0.11",
    });
    // Add a MX record for the example.com domain itself.
    var mx = new DigitalOcean.DnsRecord("mx", new DigitalOcean.DnsRecordArgs
    {
        Domain = @default.Name,
        Type = "MX",
        Priority = 10,
        Value = "mail.example.com.",
    });
    this.WwwFqdn = www.Fqdn;
    this.MxFqdn = mx.Fqdn;
}

[Output("wwwFqdn")]
public Output<string> WwwFqdn { get; set; }
[Output("mxFqdn")]
public Output<string> MxFqdn { get; set; }
}
Inheritance
System.Object
Resource
CustomResource
DnsRecord
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class DnsRecord : CustomResource

Constructors

View Source

DnsRecord(String, DnsRecordArgs, CustomResourceOptions)

Create a DnsRecord resource with the given unique name, arguments, and options.

Declaration
public DnsRecord(string name, DnsRecordArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

DnsRecordArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Domain

The domain to add the record to.

Declaration
public Output<string> Domain { get; }
Property Value
Type Description
Output<System.String>
View Source

Flags

The flags of the record. Only valid when type is CAA. Must be between 0 and 255.

Declaration
public Output<int?> Flags { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

Fqdn

The FQDN of the record

Declaration
public Output<string> Fqdn { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

The name of the record. Use @ for records on domain's name itself.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Port

The port of the record. Only valid when type is SRV. Must be between 1 and 65535.

Declaration
public Output<int?> Port { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

Priority

The priority of the record. Only valid when type is MX or SRV. Must be between 0 and 65535.

Declaration
public Output<int?> Priority { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

Tag

The tag of the record. Only valid when type is CAA. Must be one of issue, issuewild, or iodef.

Declaration
public Output<string> Tag { get; }
Property Value
Type Description
Output<System.String>
View Source

Ttl

The time to live for the record, in seconds. Must be at least 0.

Declaration
public Output<int> Ttl { get; }
Property Value
Type Description
Output<System.Int32>
View Source

Type

The type of record. Must be one of A, AAAA, CAA, CNAME, MX, NS, TXT, or SRV.

Declaration
public Output<string> Type { get; }
Property Value
Type Description
Output<System.String>
View Source

Value

The value of the record.

Declaration
public Output<string> Value { get; }
Property Value
Type Description
Output<System.String>
View Source

Weight

The weight of the record. Only valid when type is SRV. Must be between 0 and 65535.

Declaration
public Output<int?> Weight { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>

Methods

View Source

Get(String, Input<String>, DnsRecordState, CustomResourceOptions)

Get an existing DnsRecord resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static DnsRecord Get(string name, Input<string> id, DnsRecordState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

DnsRecordState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
DnsRecord
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.