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; }
}
Inherited Members
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class DnsRecord : CustomResource
Constructors
View SourceDnsRecord(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 SourceDomain
The domain to add the record to.
Declaration
public Output<string> Domain { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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>> |
Fqdn
The FQDN of the record
Declaration
public Output<string> Fqdn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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>> |
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>> |
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> |
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> |
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> |
Value
The value of the record.
Declaration
public Output<string> Value { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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 SourceGet(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 |