1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. dns
  5. getManagedZones
Google Cloud Classic v7.20.0 published on Wednesday, Apr 24, 2024 by Pulumi

gcp.dns.getManagedZones

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.20.0 published on Wednesday, Apr 24, 2024 by Pulumi

    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/v7/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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:dns/getManagedZones:getManagedZones
      arguments:
        # arguments dictionary

    The 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<GetManagedZonesManagedZone>
    A list of managed zones.
    Project string
    Id string
    ManagedZones []GetManagedZonesManagedZone
    A list of managed zones.
    Project string
    id String
    managedZones List<GetManagedZonesManagedZone>
    A list of managed zones.
    project String
    id string
    managedZones GetManagedZonesManagedZone[]
    A list of managed zones.
    project string
    id String
    managedZones List<Property Map>
    A list of managed zones.
    project String

    Supporting Types

    GetManagedZonesManagedZone

    Description string
    DnsName string
    Id string
    ManagedZoneId int
    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
    ManagedZoneId int
    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
    managedZoneId Integer
    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
    managedZoneId number
    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_id int
    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
    managedZoneId Number
    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-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.20.0 published on Wednesday, Apr 24, 2024 by Pulumi