Google Cloud v8.22.0 published on Thursday, Mar 13, 2025 by Pulumi
gcp.dns.getManagedZones
Explore with Pulumi AI
Provides access to a list of zones within Google Cloud DNS. For more information see the official documentation and API.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const zones = gcp.dns.getManagedZones({
    project: "my-project-id",
});
import pulumi
import pulumi_gcp as gcp
zones = gcp.dns.get_managed_zones(project="my-project-id")
package main
import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/dns"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dns.GetManagedZones(ctx, &dns.GetManagedZonesArgs{
			Project: pulumi.StringRef("my-project-id"),
		}, 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 zones = Gcp.Dns.GetManagedZones.Invoke(new()
    {
        Project = "my-project-id",
    });
});
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.GetManagedZonesArgs;
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 zones = DnsFunctions.getManagedZones(GetManagedZonesArgs.builder()
            .project("my-project-id")
            .build());
    }
}
variables:
  zones:
    fn::invoke:
      function: gcp:dns:getManagedZones
      arguments:
        project: my-project-id
Using getManagedZones
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 getManagedZones(args: GetManagedZonesArgs, opts?: InvokeOptions): Promise<GetManagedZonesResult>
function getManagedZonesOutput(args: GetManagedZonesOutputArgs, opts?: InvokeOptions): Output<GetManagedZonesResult>def get_managed_zones(project: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetManagedZonesResult
def get_managed_zones_output(project: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetManagedZonesResult]func GetManagedZones(ctx *Context, args *GetManagedZonesArgs, opts ...InvokeOption) (*GetManagedZonesResult, error)
func GetManagedZonesOutput(ctx *Context, args *GetManagedZonesOutputArgs, opts ...InvokeOption) GetManagedZonesResultOutput> Note: This function is named GetManagedZones in the Go SDK.
public static class GetManagedZones 
{
    public static Task<GetManagedZonesResult> InvokeAsync(GetManagedZonesArgs args, InvokeOptions? opts = null)
    public static Output<GetManagedZonesResult> Invoke(GetManagedZonesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetManagedZonesResult> getManagedZones(GetManagedZonesArgs args, InvokeOptions options)
public static Output<GetManagedZonesResult> getManagedZones(GetManagedZonesArgs args, InvokeOptions options)
fn::invoke:
  function: gcp:dns/getManagedZones:getManagedZones
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Project string
- The ID of the project containing Google Cloud DNS zones. If this is not provided the default project will be used.
- Project string
- The ID of the project containing Google Cloud DNS zones. If this is not provided the default project will be used.
- project String
- The ID of the project containing Google Cloud DNS zones. If this is not provided the default project will be used.
- project string
- The ID of the project containing Google Cloud DNS zones. If this is not provided the default project will be used.
- project str
- The ID of the project containing Google Cloud DNS zones. If this is not provided the default project will be used.
- project String
- The ID of the project containing Google Cloud DNS zones. If this is not provided the default project will be used.
getManagedZones Result
The following output properties are available:
- Id string
- ManagedZones List<GetManaged Zones Managed Zone> 
- A list of managed zones.
- Project string
- Id string
- ManagedZones []GetManaged Zones Managed Zone 
- A list of managed zones.
- Project string
- id String
- managedZones List<GetManaged Zones Managed Zone> 
- A list of managed zones.
- project String
- id string
- managedZones GetManaged Zones Managed Zone[] 
- A list of managed zones.
- project string
- id str
- managed_zones Sequence[GetManaged Zones Managed Zone] 
- A list of managed zones.
- project str
- id String
- managedZones List<Property Map>
- A list of managed zones.
- project String
Supporting Types
GetManagedZonesManagedZone    
- Description string
- DnsName string
- Id string
- ManagedZone stringId 
- NameServers List<string>
- Visibility string
- Name string
- Project string
- The ID of the project containing Google Cloud DNS zones. If this is not provided the default project will be used.
- Description string
- DnsName string
- Id string
- ManagedZone stringId 
- NameServers []string
- Visibility string
- Name string
- Project string
- The ID of the project containing Google Cloud DNS zones. If this is not provided the default project will be used.
- description String
- dnsName String
- id String
- managedZone StringId 
- nameServers List<String>
- visibility String
- name String
- project String
- The ID of the project containing Google Cloud DNS zones. If this is not provided the default project will be used.
- description string
- dnsName string
- id string
- managedZone stringId 
- nameServers string[]
- visibility string
- name string
- project string
- The ID of the project containing Google Cloud DNS zones. If this is not provided the default project will be used.
- description str
- dns_name str
- id str
- managed_zone_ strid 
- name_servers Sequence[str]
- visibility str
- name str
- project str
- The ID of the project containing Google Cloud DNS zones. If this is not provided the default project will be used.
- description String
- dnsName String
- id String
- managedZone StringId 
- nameServers List<String>
- visibility String
- name String
- project String
- The ID of the project containing Google Cloud DNS zones. If this is not provided the default project will be used.
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.