hcloud.ZoneRrset
Provides a Hetzner Cloud Zone Resource Record Set (RRSet) resource.
This can be used to create, modify, and delete Zone RRSets.
See the Zone RRSets API documentation for more details.
Experimental: DNS API is in beta, breaking changes may occur within minor releases. See https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta for more details.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
const example = new hcloud.Zone("example", {
name: "example.com",
mode: "primary",
});
const exampleZoneRrset = new hcloud.ZoneRrset("example", {
zone: example.name,
name: "www",
type: "A",
ttl: 10800,
labels: {
key: "value",
},
records: [{
value: "201.78.10.45",
comment: "web server 1",
}],
changeProtection: false,
});
import pulumi
import pulumi_hcloud as hcloud
example = hcloud.Zone("example",
name="example.com",
mode="primary")
example_zone_rrset = hcloud.ZoneRrset("example",
zone=example.name,
name="www",
type="A",
ttl=10800,
labels={
"key": "value",
},
records=[{
"value": "201.78.10.45",
"comment": "web server 1",
}],
change_protection=False)
package main
import (
"github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := hcloud.NewZone(ctx, "example", &hcloud.ZoneArgs{
Name: pulumi.String("example.com"),
Mode: pulumi.String("primary"),
})
if err != nil {
return err
}
_, err = hcloud.NewZoneRrset(ctx, "example", &hcloud.ZoneRrsetArgs{
Zone: example.Name,
Name: pulumi.String("www"),
Type: pulumi.String("A"),
Ttl: pulumi.Int(10800),
Labels: pulumi.StringMap{
"key": pulumi.String("value"),
},
Records: hcloud.ZoneRrsetRecordArray{
&hcloud.ZoneRrsetRecordArgs{
Value: pulumi.String("201.78.10.45"),
Comment: pulumi.String("web server 1"),
},
},
ChangeProtection: pulumi.Bool(false),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;
return await Deployment.RunAsync(() =>
{
var example = new HCloud.Zone("example", new()
{
Name = "example.com",
Mode = "primary",
});
var exampleZoneRrset = new HCloud.ZoneRrset("example", new()
{
Zone = example.Name,
Name = "www",
Type = "A",
Ttl = 10800,
Labels =
{
{ "key", "value" },
},
Records = new[]
{
new HCloud.Inputs.ZoneRrsetRecordArgs
{
Value = "201.78.10.45",
Comment = "web server 1",
},
},
ChangeProtection = false,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hcloud.Zone;
import com.pulumi.hcloud.ZoneArgs;
import com.pulumi.hcloud.ZoneRrset;
import com.pulumi.hcloud.ZoneRrsetArgs;
import com.pulumi.hcloud.inputs.ZoneRrsetRecordArgs;
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) {
var example = new Zone("example", ZoneArgs.builder()
.name("example.com")
.mode("primary")
.build());
var exampleZoneRrset = new ZoneRrset("exampleZoneRrset", ZoneRrsetArgs.builder()
.zone(example.name())
.name("www")
.type("A")
.ttl(10800)
.labels(Map.of("key", "value"))
.records(ZoneRrsetRecordArgs.builder()
.value("201.78.10.45")
.comment("web server 1")
.build())
.changeProtection(false)
.build());
}
}
resources:
example:
type: hcloud:Zone
properties:
name: example.com
mode: primary
exampleZoneRrset:
type: hcloud:ZoneRrset
name: example
properties:
zone: ${example.name}
name: www
type: A
ttl: 10800
labels:
key: value
records:
- value: 201.78.10.45
comment: web server 1
changeProtection: false
Create ZoneRrset Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ZoneRrset(name: string, args: ZoneRrsetArgs, opts?: CustomResourceOptions);@overload
def ZoneRrset(resource_name: str,
args: ZoneRrsetArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ZoneRrset(resource_name: str,
opts: Optional[ResourceOptions] = None,
records: Optional[Sequence[ZoneRrsetRecordArgs]] = None,
type: Optional[str] = None,
zone: Optional[str] = None,
change_protection: Optional[bool] = None,
labels: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
ttl: Optional[int] = None)func NewZoneRrset(ctx *Context, name string, args ZoneRrsetArgs, opts ...ResourceOption) (*ZoneRrset, error)public ZoneRrset(string name, ZoneRrsetArgs args, CustomResourceOptions? opts = null)
public ZoneRrset(String name, ZoneRrsetArgs args)
public ZoneRrset(String name, ZoneRrsetArgs args, CustomResourceOptions options)
type: hcloud:ZoneRrset
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 ZoneRrsetArgs
- 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 ZoneRrsetArgs
- 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 ZoneRrsetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ZoneRrsetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ZoneRrsetArgs
- 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 zoneRrsetResource = new HCloud.ZoneRrset("zoneRrsetResource", new()
{
Records = new[]
{
new HCloud.Inputs.ZoneRrsetRecordArgs
{
Value = "string",
Comment = "string",
},
},
Type = "string",
Zone = "string",
ChangeProtection = false,
Labels =
{
{ "string", "string" },
},
Name = "string",
Ttl = 0,
});
example, err := hcloud.NewZoneRrset(ctx, "zoneRrsetResource", &hcloud.ZoneRrsetArgs{
Records: hcloud.ZoneRrsetRecordArray{
&hcloud.ZoneRrsetRecordArgs{
Value: pulumi.String("string"),
Comment: pulumi.String("string"),
},
},
Type: pulumi.String("string"),
Zone: pulumi.String("string"),
ChangeProtection: pulumi.Bool(false),
Labels: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
Ttl: pulumi.Int(0),
})
var zoneRrsetResource = new ZoneRrset("zoneRrsetResource", ZoneRrsetArgs.builder()
.records(ZoneRrsetRecordArgs.builder()
.value("string")
.comment("string")
.build())
.type("string")
.zone("string")
.changeProtection(false)
.labels(Map.of("string", "string"))
.name("string")
.ttl(0)
.build());
zone_rrset_resource = hcloud.ZoneRrset("zoneRrsetResource",
records=[{
"value": "string",
"comment": "string",
}],
type="string",
zone="string",
change_protection=False,
labels={
"string": "string",
},
name="string",
ttl=0)
const zoneRrsetResource = new hcloud.ZoneRrset("zoneRrsetResource", {
records: [{
value: "string",
comment: "string",
}],
type: "string",
zone: "string",
changeProtection: false,
labels: {
string: "string",
},
name: "string",
ttl: 0,
});
type: hcloud:ZoneRrset
properties:
changeProtection: false
labels:
string: string
name: string
records:
- comment: string
value: string
ttl: 0
type: string
zone: string
ZoneRrset 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 ZoneRrset resource accepts the following input properties:
- Records
List<Pulumi.
HCloud. Inputs. Zone Rrset Record> - Records of the Zone RRSet.
- Type string
- Type of the Zone RRSet.
- Zone string
- ID or Name of the parent Zone.
- Change
Protection bool - Whether change protection is enabled.
- Labels Dictionary<string, string>
- User-defined labels (key-value pairs) for the resource.
- Name string
- Name of the Zone RRSet.
- Ttl int
- Time To Live (TTL) of the Zone RRSet.
- Records
[]Zone
Rrset Record Args - Records of the Zone RRSet.
- Type string
- Type of the Zone RRSet.
- Zone string
- ID or Name of the parent Zone.
- Change
Protection bool - Whether change protection is enabled.
- Labels map[string]string
- User-defined labels (key-value pairs) for the resource.
- Name string
- Name of the Zone RRSet.
- Ttl int
- Time To Live (TTL) of the Zone RRSet.
- records
List<Zone
Rrset Record> - Records of the Zone RRSet.
- type String
- Type of the Zone RRSet.
- zone String
- ID or Name of the parent Zone.
- change
Protection Boolean - Whether change protection is enabled.
- labels Map<String,String>
- User-defined labels (key-value pairs) for the resource.
- name String
- Name of the Zone RRSet.
- ttl Integer
- Time To Live (TTL) of the Zone RRSet.
- records
Zone
Rrset Record[] - Records of the Zone RRSet.
- type string
- Type of the Zone RRSet.
- zone string
- ID or Name of the parent Zone.
- change
Protection boolean - Whether change protection is enabled.
- labels {[key: string]: string}
- User-defined labels (key-value pairs) for the resource.
- name string
- Name of the Zone RRSet.
- ttl number
- Time To Live (TTL) of the Zone RRSet.
- records
Sequence[Zone
Rrset Record Args] - Records of the Zone RRSet.
- type str
- Type of the Zone RRSet.
- zone str
- ID or Name of the parent Zone.
- change_
protection bool - Whether change protection is enabled.
- labels Mapping[str, str]
- User-defined labels (key-value pairs) for the resource.
- name str
- Name of the Zone RRSet.
- ttl int
- Time To Live (TTL) of the Zone RRSet.
- records List<Property Map>
- Records of the Zone RRSet.
- type String
- Type of the Zone RRSet.
- zone String
- ID or Name of the parent Zone.
- change
Protection Boolean - Whether change protection is enabled.
- labels Map<String>
- User-defined labels (key-value pairs) for the resource.
- name String
- Name of the Zone RRSet.
- ttl Number
- Time To Live (TTL) of the Zone RRSet.
Outputs
All input properties are implicitly available as output properties. Additionally, the ZoneRrset 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 string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ZoneRrset Resource
Get an existing ZoneRrset 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?: ZoneRrsetState, opts?: CustomResourceOptions): ZoneRrset@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
change_protection: Optional[bool] = None,
labels: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
records: Optional[Sequence[ZoneRrsetRecordArgs]] = None,
ttl: Optional[int] = None,
type: Optional[str] = None,
zone: Optional[str] = None) -> ZoneRrsetfunc GetZoneRrset(ctx *Context, name string, id IDInput, state *ZoneRrsetState, opts ...ResourceOption) (*ZoneRrset, error)public static ZoneRrset Get(string name, Input<string> id, ZoneRrsetState? state, CustomResourceOptions? opts = null)public static ZoneRrset get(String name, Output<String> id, ZoneRrsetState state, CustomResourceOptions options)resources: _: type: hcloud:ZoneRrset get: id: ${id}- 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.
- Change
Protection bool - Whether change protection is enabled.
- Labels Dictionary<string, string>
- User-defined labels (key-value pairs) for the resource.
- Name string
- Name of the Zone RRSet.
- Records
List<Pulumi.
HCloud. Inputs. Zone Rrset Record> - Records of the Zone RRSet.
- Ttl int
- Time To Live (TTL) of the Zone RRSet.
- Type string
- Type of the Zone RRSet.
- Zone string
- ID or Name of the parent Zone.
- Change
Protection bool - Whether change protection is enabled.
- Labels map[string]string
- User-defined labels (key-value pairs) for the resource.
- Name string
- Name of the Zone RRSet.
- Records
[]Zone
Rrset Record Args - Records of the Zone RRSet.
- Ttl int
- Time To Live (TTL) of the Zone RRSet.
- Type string
- Type of the Zone RRSet.
- Zone string
- ID or Name of the parent Zone.
- change
Protection Boolean - Whether change protection is enabled.
- labels Map<String,String>
- User-defined labels (key-value pairs) for the resource.
- name String
- Name of the Zone RRSet.
- records
List<Zone
Rrset Record> - Records of the Zone RRSet.
- ttl Integer
- Time To Live (TTL) of the Zone RRSet.
- type String
- Type of the Zone RRSet.
- zone String
- ID or Name of the parent Zone.
- change
Protection boolean - Whether change protection is enabled.
- labels {[key: string]: string}
- User-defined labels (key-value pairs) for the resource.
- name string
- Name of the Zone RRSet.
- records
Zone
Rrset Record[] - Records of the Zone RRSet.
- ttl number
- Time To Live (TTL) of the Zone RRSet.
- type string
- Type of the Zone RRSet.
- zone string
- ID or Name of the parent Zone.
- change_
protection bool - Whether change protection is enabled.
- labels Mapping[str, str]
- User-defined labels (key-value pairs) for the resource.
- name str
- Name of the Zone RRSet.
- records
Sequence[Zone
Rrset Record Args] - Records of the Zone RRSet.
- ttl int
- Time To Live (TTL) of the Zone RRSet.
- type str
- Type of the Zone RRSet.
- zone str
- ID or Name of the parent Zone.
- change
Protection Boolean - Whether change protection is enabled.
- labels Map<String>
- User-defined labels (key-value pairs) for the resource.
- name String
- Name of the Zone RRSet.
- records List<Property Map>
- Records of the Zone RRSet.
- ttl Number
- Time To Live (TTL) of the Zone RRSet.
- type String
- Type of the Zone RRSet.
- zone String
- ID or Name of the parent Zone.
Supporting Types
ZoneRrsetRecord, ZoneRrsetRecordArgs
Import
In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:
terraform
import {
to = hcloud_zone_rrset.example
id = “$ZONE_ID_OR_NAME/$RRSET_NAME/$RRSET_TYPE”
}
import {
to = hcloud_zone_rrset.example
id = “$ZONE_ID_OR_NAME/$RRSET_ID”
}
The pulumi import command can be used, for example:
$ pulumi import hcloud:index/zoneRrset:ZoneRrset example "$ZONE_ID_OR_NAME/$RRSET_NAME/$RRSET_TYPE"
$ pulumi import hcloud:index/zoneRrset:ZoneRrset example "$ZONE_ID_OR_NAME/$RRSET_ID"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Hetzner Cloud pulumi/pulumi-hcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
hcloudTerraform Provider.
