Hetzner Cloud v1.26.0 published on Wednesday, Nov 5, 2025 by Pulumi
hcloud.getZoneRrset
Start a Neo task
Explain and create a hcloud.getZoneRrset resource
Provides details about a Hetzner Cloud Zone Resource Record Set (RRSet).
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 = hcloud.getZone({
name: "example.com",
});
const byId = example.then(example => hcloud.getZoneRrset({
zone: example.name,
id: "www/A",
}));
const byNameAndType = example.then(example => hcloud.getZoneRrset({
zone: example.name,
name: "www",
type: "A",
}));
const byLabel = example.then(example => hcloud.getZoneRrset({
zone: example.name,
withSelector: "key=value",
}));
import pulumi
import pulumi_hcloud as hcloud
example = hcloud.get_zone(name="example.com")
by_id = hcloud.get_zone_rrset(zone=example.name,
id="www/A")
by_name_and_type = hcloud.get_zone_rrset(zone=example.name,
name="www",
type="A")
by_label = hcloud.get_zone_rrset(zone=example.name,
with_selector="key=value")
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.LookupZone(ctx, &hcloud.LookupZoneArgs{
Name: pulumi.StringRef("example.com"),
}, nil)
if err != nil {
return err
}
_, err = hcloud.LookupZoneRrset(ctx, &hcloud.LookupZoneRrsetArgs{
Zone: example.Name,
Id: pulumi.StringRef("www/A"),
}, nil)
if err != nil {
return err
}
_, err = hcloud.LookupZoneRrset(ctx, &hcloud.LookupZoneRrsetArgs{
Zone: example.Name,
Name: pulumi.StringRef("www"),
Type: pulumi.StringRef("A"),
}, nil)
if err != nil {
return err
}
_, err = hcloud.LookupZoneRrset(ctx, &hcloud.LookupZoneRrsetArgs{
Zone: example.Name,
WithSelector: pulumi.StringRef("key=value"),
}, nil)
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 = HCloud.GetZone.Invoke(new()
{
Name = "example.com",
});
var byId = HCloud.GetZoneRrset.Invoke(new()
{
Zone = example.Apply(getZoneResult => getZoneResult.Name),
Id = "www/A",
});
var byNameAndType = HCloud.GetZoneRrset.Invoke(new()
{
Zone = example.Apply(getZoneResult => getZoneResult.Name),
Name = "www",
Type = "A",
});
var byLabel = HCloud.GetZoneRrset.Invoke(new()
{
Zone = example.Apply(getZoneResult => getZoneResult.Name),
WithSelector = "key=value",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hcloud.HcloudFunctions;
import com.pulumi.hcloud.inputs.GetZoneArgs;
import com.pulumi.hcloud.inputs.GetZoneRrsetArgs;
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) {
final var example = HcloudFunctions.getZone(GetZoneArgs.builder()
.name("example.com")
.build());
final var byId = HcloudFunctions.getZoneRrset(GetZoneRrsetArgs.builder()
.zone(example.name())
.id("www/A")
.build());
final var byNameAndType = HcloudFunctions.getZoneRrset(GetZoneRrsetArgs.builder()
.zone(example.name())
.name("www")
.type("A")
.build());
final var byLabel = HcloudFunctions.getZoneRrset(GetZoneRrsetArgs.builder()
.zone(example.name())
.withSelector("key=value")
.build());
}
}
variables:
example:
fn::invoke:
function: hcloud:getZone
arguments:
name: example.com
byId:
fn::invoke:
function: hcloud:getZoneRrset
arguments:
zone: ${example.name}
id: www/A
byNameAndType:
fn::invoke:
function: hcloud:getZoneRrset
arguments:
zone: ${example.name}
name: www
type: A
byLabel:
fn::invoke:
function: hcloud:getZoneRrset
arguments:
zone: ${example.name}
withSelector: key=value
Using getZoneRrset
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getZoneRrset(args: GetZoneRrsetArgs, opts?: InvokeOptions): Promise<GetZoneRrsetResult>
function getZoneRrsetOutput(args: GetZoneRrsetOutputArgs, opts?: InvokeOptions): Output<GetZoneRrsetResult>def get_zone_rrset(id: Optional[str] = None,
name: Optional[str] = None,
type: Optional[str] = None,
with_selector: Optional[str] = None,
zone: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetZoneRrsetResult
def get_zone_rrset_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
type: Optional[pulumi.Input[str]] = None,
with_selector: Optional[pulumi.Input[str]] = None,
zone: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetZoneRrsetResult]func LookupZoneRrset(ctx *Context, args *LookupZoneRrsetArgs, opts ...InvokeOption) (*LookupZoneRrsetResult, error)
func LookupZoneRrsetOutput(ctx *Context, args *LookupZoneRrsetOutputArgs, opts ...InvokeOption) LookupZoneRrsetResultOutput> Note: This function is named LookupZoneRrset in the Go SDK.
public static class GetZoneRrset
{
public static Task<GetZoneRrsetResult> InvokeAsync(GetZoneRrsetArgs args, InvokeOptions? opts = null)
public static Output<GetZoneRrsetResult> Invoke(GetZoneRrsetInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetZoneRrsetResult> getZoneRrset(GetZoneRrsetArgs args, InvokeOptions options)
public static Output<GetZoneRrsetResult> getZoneRrset(GetZoneRrsetArgs args, InvokeOptions options)
fn::invoke:
function: hcloud:index/getZoneRrset:getZoneRrset
arguments:
# arguments dictionaryThe following arguments are supported:
- Zone string
- ID or Name of the parent Zone.
- Id string
- ID of the Zone RRSet.
- Name string
- Name of the Zone RRSet.
- Type string
- Type of the Zone RRSet.
- With
Selector string - Filter results using a Label Selector.
- Zone string
- ID or Name of the parent Zone.
- Id string
- ID of the Zone RRSet.
- Name string
- Name of the Zone RRSet.
- Type string
- Type of the Zone RRSet.
- With
Selector string - Filter results using a Label Selector.
- zone String
- ID or Name of the parent Zone.
- id String
- ID of the Zone RRSet.
- name String
- Name of the Zone RRSet.
- type String
- Type of the Zone RRSet.
- with
Selector String - Filter results using a Label Selector.
- zone string
- ID or Name of the parent Zone.
- id string
- ID of the Zone RRSet.
- name string
- Name of the Zone RRSet.
- type string
- Type of the Zone RRSet.
- with
Selector string - Filter results using a Label Selector.
- zone str
- ID or Name of the parent Zone.
- id str
- ID of the Zone RRSet.
- name str
- Name of the Zone RRSet.
- type str
- Type of the Zone RRSet.
- with_
selector str - Filter results using a Label Selector.
- zone String
- ID or Name of the parent Zone.
- id String
- ID of the Zone RRSet.
- name String
- Name of the Zone RRSet.
- type String
- Type of the Zone RRSet.
- with
Selector String - Filter results using a Label Selector.
getZoneRrset Result
The following output properties are available:
- Change
Protection bool - Whether change protection is enabled.
- Labels Dictionary<string, string>
- User-defined labels (key-value pairs) for the resource.
- Records
List<Pulumi.
HCloud. Outputs. Get Zone Rrset Record> - Records of the Zone RRSet.
- Ttl int
- Time To Live (TTL) of the Zone RRSet.
- Zone string
- ID or Name of the parent Zone.
- Id string
- ID of the Zone RRSet.
- Name string
- Name of the Zone RRSet.
- Type string
- Type of the Zone RRSet.
- With
Selector string - Filter results using a Label Selector.
- Change
Protection bool - Whether change protection is enabled.
- Labels map[string]string
- User-defined labels (key-value pairs) for the resource.
- Records
[]Get
Zone Rrset Record - Records of the Zone RRSet.
- Ttl int
- Time To Live (TTL) of the Zone RRSet.
- Zone string
- ID or Name of the parent Zone.
- Id string
- ID of the Zone RRSet.
- Name string
- Name of the Zone RRSet.
- Type string
- Type of the Zone RRSet.
- With
Selector string - Filter results using a Label Selector.
- change
Protection Boolean - Whether change protection is enabled.
- labels Map<String,String>
- User-defined labels (key-value pairs) for the resource.
- records
List<Get
Zone Rrset Record> - Records of the Zone RRSet.
- ttl Integer
- Time To Live (TTL) of the Zone RRSet.
- zone String
- ID or Name of the parent Zone.
- id String
- ID of the Zone RRSet.
- name String
- Name of the Zone RRSet.
- type String
- Type of the Zone RRSet.
- with
Selector String - Filter results using a Label Selector.
- change
Protection boolean - Whether change protection is enabled.
- labels {[key: string]: string}
- User-defined labels (key-value pairs) for the resource.
- records
Get
Zone Rrset Record[] - Records of the Zone RRSet.
- ttl number
- Time To Live (TTL) of the Zone RRSet.
- zone string
- ID or Name of the parent Zone.
- id string
- ID of the Zone RRSet.
- name string
- Name of the Zone RRSet.
- type string
- Type of the Zone RRSet.
- with
Selector string - Filter results using a Label Selector.
- change_
protection bool - Whether change protection is enabled.
- labels Mapping[str, str]
- User-defined labels (key-value pairs) for the resource.
- records
Sequence[Get
Zone Rrset Record] - Records of the Zone RRSet.
- ttl int
- Time To Live (TTL) of the Zone RRSet.
- zone str
- ID or Name of the parent Zone.
- id str
- ID of the Zone RRSet.
- name str
- Name of the Zone RRSet.
- type str
- Type of the Zone RRSet.
- with_
selector str - Filter results using a Label Selector.
- change
Protection Boolean - Whether change protection is enabled.
- labels Map<String>
- User-defined labels (key-value pairs) for the resource.
- records List<Property Map>
- Records of the Zone RRSet.
- ttl Number
- Time To Live (TTL) of the Zone RRSet.
- zone String
- ID or Name of the parent Zone.
- id String
- ID of the Zone RRSet.
- name String
- Name of the Zone RRSet.
- type String
- Type of the Zone RRSet.
- with
Selector String - Filter results using a Label Selector.
Supporting Types
GetZoneRrsetRecord
Package Details
- Repository
- Hetzner Cloud pulumi/pulumi-hcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
hcloudTerraform Provider.
