Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

Rdns

Provides a Hetzner Cloud Reverse DNS Entry to create, modify and reset reverse dns entries for Hetzner Cloud Floating IPs or servers.

Example Usage

using Pulumi;
using HCloud = Pulumi.HCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var node1 = new HCloud.Server("node1", new HCloud.ServerArgs
        {
            Image = "debian-9",
            ServerType = "cx11",
        });
        var master = new HCloud.Rdns("master", new HCloud.RdnsArgs
        {
            ServerId = node1.Id,
            IpAddress = node1.Ipv4Address,
            DnsPtr = "example.com",
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        node1, err := hcloud.NewServer(ctx, "node1", &hcloud.ServerArgs{
            Image:      pulumi.String("debian-9"),
            ServerType: pulumi.String("cx11"),
        })
        if err != nil {
            return err
        }
        _, err = hcloud.NewRdns(ctx, "master", &hcloud.RdnsArgs{
            ServerId:  node1.ID(),
            IpAddress: node1.Ipv4Address,
            DnsPtr:    pulumi.String("example.com"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_hcloud as hcloud

node1 = hcloud.Server("node1",
    image="debian-9",
    server_type="cx11")
master = hcloud.Rdns("master",
    server_id=node1.id,
    ip_address=node1.ipv4_address,
    dns_ptr="example.com")
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const node1 = new hcloud.Server("node1", {
    image: "debian-9",
    serverType: "cx11",
});
const master = new hcloud.Rdns("master", {
    serverId: node1.id,
    ipAddress: node1.ipv4Address,
    dnsPtr: "example.com",
});

Create a Rdns Resource

new Rdns(name: string, args: RdnsArgs, opts?: CustomResourceOptions);
def Rdns(resource_name: str, opts: Optional[ResourceOptions] = None, dns_ptr: Optional[str] = None, floating_ip_id: Optional[int] = None, ip_address: Optional[str] = None, server_id: Optional[int] = None)
func NewRdns(ctx *Context, name string, args RdnsArgs, opts ...ResourceOption) (*Rdns, error)
public Rdns(string name, RdnsArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RdnsArgs
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 RdnsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RdnsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Rdns Resource Properties

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

Inputs

The Rdns resource accepts the following input properties:

DnsPtr string

The DNS address the ip_address should resolve to.

IpAddress string

The IP address that should point to dns_ptr.

FloatingIpId int

The Floating IP the ip_address belongs to.

ServerId int

The server the ip_address belongs to.

DnsPtr string

The DNS address the ip_address should resolve to.

IpAddress string

The IP address that should point to dns_ptr.

FloatingIpId int

The Floating IP the ip_address belongs to.

ServerId int

The server the ip_address belongs to.

dnsPtr string

The DNS address the ip_address should resolve to.

ipAddress string

The IP address that should point to dns_ptr.

floatingIpId number

The Floating IP the ip_address belongs to.

serverId number

The server the ip_address belongs to.

dns_ptr str

The DNS address the ip_address should resolve to.

ip_address str

The IP address that should point to dns_ptr.

floating_ip_id int

The Floating IP the ip_address belongs to.

server_id int

The server the ip_address belongs to.

Outputs

All input properties are implicitly available as output properties. Additionally, the Rdns 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 Rdns Resource

Get an existing Rdns 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?: RdnsState, opts?: CustomResourceOptions): Rdns
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, dns_ptr: Optional[str] = None, floating_ip_id: Optional[int] = None, ip_address: Optional[str] = None, server_id: Optional[int] = None) -> Rdns
func GetRdns(ctx *Context, name string, id IDInput, state *RdnsState, opts ...ResourceOption) (*Rdns, error)
public static Rdns Get(string name, Input<string> id, RdnsState? 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:

DnsPtr string

The DNS address the ip_address should resolve to.

FloatingIpId int

The Floating IP the ip_address belongs to.

IpAddress string

The IP address that should point to dns_ptr.

ServerId int

The server the ip_address belongs to.

DnsPtr string

The DNS address the ip_address should resolve to.

FloatingIpId int

The Floating IP the ip_address belongs to.

IpAddress string

The IP address that should point to dns_ptr.

ServerId int

The server the ip_address belongs to.

dnsPtr string

The DNS address the ip_address should resolve to.

floatingIpId number

The Floating IP the ip_address belongs to.

ipAddress string

The IP address that should point to dns_ptr.

serverId number

The server the ip_address belongs to.

dns_ptr str

The DNS address the ip_address should resolve to.

floating_ip_id int

The Floating IP the ip_address belongs to.

ip_address str

The IP address that should point to dns_ptr.

server_id int

The server the ip_address belongs to.

Import

Reverse DNS entries can be imported using a compound ID with the following format<prefix (s for server/ f for floating ip)>-<server or floating ip ID>-<IP address> # import reverse dns entry on server with id 123, ip 192.168.100.1

 $ pulumi import hcloud:index/rdns:Rdns myrdns s-123-192.168.100.1

import reverse dns entry on floating ip with id 123, ip 2001:db8::1

 $ pulumi import hcloud:index/rdns:Rdns myrdns f-123-2001:db8::1

Package Details

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