Viewing docs for Google Cloud v9.23.0
published on Thursday, May 7, 2026 by Pulumi
published on Thursday, May 7, 2026 by Pulumi
Viewing docs for Google Cloud v9.23.0
published on Thursday, May 7, 2026 by Pulumi
published on Thursday, May 7, 2026 by Pulumi
Get a list of DNS record sets within a Google Cloud DNS managed zone. This data source allows you to list all record sets or filter them by name and type.
To get more information about Cloud DNS Record Sets, see:
Note: Filtering by
typewhennameis not set is performed client-side.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const envDnsZone = gcp.dns.getManagedZone({
name: "my-zone-name",
});
const example = envDnsZone.then(envDnsZone => gcp.dns.getRecordSets({
managedZone: envDnsZone.name,
type: "A",
}));
import pulumi
import pulumi_gcp as gcp
env_dns_zone = gcp.dns.get_managed_zone(name="my-zone-name")
example = gcp.dns.get_record_sets(managed_zone=env_dns_zone.name,
type="A")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
envDnsZone, err := dns.LookupManagedZone(ctx, &dns.LookupManagedZoneArgs{
Name: "my-zone-name",
}, nil)
if err != nil {
return err
}
_, err = dns.GetRecordSets(ctx, &dns.GetRecordSetsArgs{
ManagedZone: envDnsZone.Name,
Type: pulumi.StringRef("A"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var envDnsZone = Gcp.Dns.GetManagedZone.Invoke(new()
{
Name = "my-zone-name",
});
var example = Gcp.Dns.GetRecordSets.Invoke(new()
{
ManagedZone = envDnsZone.Apply(getManagedZoneResult => getManagedZoneResult.Name),
Type = "A",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.dns.DnsFunctions;
import com.pulumi.gcp.dns.inputs.GetManagedZoneArgs;
import com.pulumi.gcp.dns.inputs.GetRecordSetsArgs;
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 envDnsZone = DnsFunctions.getManagedZone(GetManagedZoneArgs.builder()
.name("my-zone-name")
.build());
final var example = DnsFunctions.getRecordSets(GetRecordSetsArgs.builder()
.managedZone(envDnsZone.name())
.type("A")
.build());
}
}
variables:
envDnsZone:
fn::invoke:
function: gcp:dns:getManagedZone
arguments:
name: my-zone-name
example:
fn::invoke:
function: gcp:dns:getRecordSets
arguments:
managedZone: ${envDnsZone.name}
type: A
Using getRecordSets
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 getRecordSets(args: GetRecordSetsArgs, opts?: InvokeOptions): Promise<GetRecordSetsResult>
function getRecordSetsOutput(args: GetRecordSetsOutputArgs, opts?: InvokeOptions): Output<GetRecordSetsResult>def get_record_sets(managed_zone: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRecordSetsResult
def get_record_sets_output(managed_zone: pulumi.Input[Optional[str]] = None,
name: pulumi.Input[Optional[str]] = None,
project: pulumi.Input[Optional[str]] = None,
type: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRecordSetsResult]func GetRecordSets(ctx *Context, args *GetRecordSetsArgs, opts ...InvokeOption) (*GetRecordSetsResult, error)
func GetRecordSetsOutput(ctx *Context, args *GetRecordSetsOutputArgs, opts ...InvokeOption) GetRecordSetsResultOutput> Note: This function is named GetRecordSets in the Go SDK.
public static class GetRecordSets
{
public static Task<GetRecordSetsResult> InvokeAsync(GetRecordSetsArgs args, InvokeOptions? opts = null)
public static Output<GetRecordSetsResult> Invoke(GetRecordSetsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRecordSetsResult> getRecordSets(GetRecordSetsArgs args, InvokeOptions options)
public static Output<GetRecordSetsResult> getRecordSets(GetRecordSetsArgs args, InvokeOptions options)
fn::invoke:
function: gcp:dns/getRecordSets:getRecordSets
arguments:
# arguments dictionaryThe following arguments are supported:
- Managed
Zone string - The name of the managed zone to fetch the record sets from.
- Name string
- The name of the record set to filter by.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Type string
- The type of the record set to filter by.
- Managed
Zone string - The name of the managed zone to fetch the record sets from.
- Name string
- The name of the record set to filter by.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Type string
- The type of the record set to filter by.
- managed
Zone String - The name of the managed zone to fetch the record sets from.
- name String
- The name of the record set to filter by.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- type String
- The type of the record set to filter by.
- managed
Zone string - The name of the managed zone to fetch the record sets from.
- name string
- The name of the record set to filter by.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- type string
- The type of the record set to filter by.
- managed_
zone str - The name of the managed zone to fetch the record sets from.
- name str
- The name of the record set to filter by.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- type str
- The type of the record set to filter by.
- managed
Zone String - The name of the managed zone to fetch the record sets from.
- name String
- The name of the record set to filter by.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- type String
- The type of the record set to filter by.
getRecordSets Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Managed
Zone string - Rrsets
List<Get
Record Sets Rrset> - A list of record sets in the selected managed zone matching the filter. Structure is defined below.
- Name string
- The name of the record set.
- Project string
- Type string
- The type of the record set.
- Id string
- The provider-assigned unique ID for this managed resource.
- Managed
Zone string - Rrsets
[]Get
Record Sets Rrset - A list of record sets in the selected managed zone matching the filter. Structure is defined below.
- Name string
- The name of the record set.
- Project string
- Type string
- The type of the record set.
- id String
- The provider-assigned unique ID for this managed resource.
- managed
Zone String - rrsets
List<Get
Record Sets Rrset> - A list of record sets in the selected managed zone matching the filter. Structure is defined below.
- name String
- The name of the record set.
- project String
- type String
- The type of the record set.
- id string
- The provider-assigned unique ID for this managed resource.
- managed
Zone string - rrsets
Get
Record Sets Rrset[] - A list of record sets in the selected managed zone matching the filter. Structure is defined below.
- name string
- The name of the record set.
- project string
- type string
- The type of the record set.
- id str
- The provider-assigned unique ID for this managed resource.
- managed_
zone str - rrsets
Sequence[Get
Record Sets Rrset] - A list of record sets in the selected managed zone matching the filter. Structure is defined below.
- name str
- The name of the record set.
- project str
- type str
- The type of the record set.
- id String
- The provider-assigned unique ID for this managed resource.
- managed
Zone String - rrsets List<Property Map>
- A list of record sets in the selected managed zone matching the filter. Structure is defined below.
- name String
- The name of the record set.
- project String
- type String
- The type of the record set.
Supporting Types
GetRecordSetsRrset
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.
Viewing docs for Google Cloud v9.23.0
published on Thursday, May 7, 2026 by Pulumi
published on Thursday, May 7, 2026 by Pulumi
