1. Packages
  2. Ibm Provider
  3. API Docs
  4. getDnsZones
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getDnsZones

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Retrieve details about a zone that you added to your private DNS service instance. For more information, see Managing DNS zones.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const dns = ibm.getResourceInstance({});
    const dsPdnszones = dns.then(dns => ibm.getDnsZones({
        instanceId: dns.guid,
    }));
    
    import pulumi
    import pulumi_ibm as ibm
    
    dns = ibm.get_resource_instance()
    ds_pdnszones = ibm.get_dns_zones(instance_id=dns.guid)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		dns, err := ibm.LookupResourceInstance(ctx, &ibm.LookupResourceInstanceArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ibm.GetDnsZones(ctx, &ibm.GetDnsZonesArgs{
    			InstanceId: dns.Guid,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var dns = Ibm.GetResourceInstance.Invoke();
    
        var dsPdnszones = Ibm.GetDnsZones.Invoke(new()
        {
            InstanceId = dns.Apply(getResourceInstanceResult => getResourceInstanceResult.Guid),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetResourceInstanceArgs;
    import com.pulumi.ibm.inputs.GetDnsZonesArgs;
    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 dns = IbmFunctions.getResourceInstance();
    
            final var dsPdnszones = IbmFunctions.getDnsZones(GetDnsZonesArgs.builder()
                .instanceId(dns.applyValue(getResourceInstanceResult -> getResourceInstanceResult.guid()))
                .build());
    
        }
    }
    
    variables:
      dns:
        fn::invoke:
          function: ibm:getResourceInstance
          arguments: {}
      dsPdnszones:
        fn::invoke:
          function: ibm:getDnsZones
          arguments:
            instanceId: ${dns.guid}
    

    Using getDnsZones

    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 getDnsZones(args: GetDnsZonesArgs, opts?: InvokeOptions): Promise<GetDnsZonesResult>
    function getDnsZonesOutput(args: GetDnsZonesOutputArgs, opts?: InvokeOptions): Output<GetDnsZonesResult>
    def get_dns_zones(id: Optional[str] = None,
                      instance_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetDnsZonesResult
    def get_dns_zones_output(id: Optional[pulumi.Input[str]] = None,
                      instance_id: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetDnsZonesResult]
    func GetDnsZones(ctx *Context, args *GetDnsZonesArgs, opts ...InvokeOption) (*GetDnsZonesResult, error)
    func GetDnsZonesOutput(ctx *Context, args *GetDnsZonesOutputArgs, opts ...InvokeOption) GetDnsZonesResultOutput

    > Note: This function is named GetDnsZones in the Go SDK.

    public static class GetDnsZones 
    {
        public static Task<GetDnsZonesResult> InvokeAsync(GetDnsZonesArgs args, InvokeOptions? opts = null)
        public static Output<GetDnsZonesResult> Invoke(GetDnsZonesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDnsZonesResult> getDnsZones(GetDnsZonesArgs args, InvokeOptions options)
    public static Output<GetDnsZonesResult> getDnsZones(GetDnsZonesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getDnsZones:getDnsZones
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    The GUID of the private DNS service instance.
    Id string
    InstanceId string
    The GUID of the private DNS service instance.
    Id string
    instanceId String
    The GUID of the private DNS service instance.
    id String
    instanceId string
    The GUID of the private DNS service instance.
    id string
    instance_id str
    The GUID of the private DNS service instance.
    id str
    instanceId String
    The GUID of the private DNS service instance.
    id String

    getDnsZones Result

    The following output properties are available:

    DnsZones List<GetDnsZonesDnsZone>
    (List) A List of zones that you added to your private DNS service instance.
    Id string
    InstanceId string
    (String) The ID of the private DNS service instance where you added the zone.
    DnsZones []GetDnsZonesDnsZone
    (List) A List of zones that you added to your private DNS service instance.
    Id string
    InstanceId string
    (String) The ID of the private DNS service instance where you added the zone.
    dnsZones List<GetDnsZonesDnsZone>
    (List) A List of zones that you added to your private DNS service instance.
    id String
    instanceId String
    (String) The ID of the private DNS service instance where you added the zone.
    dnsZones GetDnsZonesDnsZone[]
    (List) A List of zones that you added to your private DNS service instance.
    id string
    instanceId string
    (String) The ID of the private DNS service instance where you added the zone.
    dns_zones Sequence[GetDnsZonesDnsZone]
    (List) A List of zones that you added to your private DNS service instance.
    id str
    instance_id str
    (String) The ID of the private DNS service instance where you added the zone.
    dnsZones List<Property Map>
    (List) A List of zones that you added to your private DNS service instance.
    id String
    instanceId String
    (String) The ID of the private DNS service instance where you added the zone.

    Supporting Types

    GetDnsZonesDnsZone

    CreatedOn string
    (Timestamp) The date and time when the zone was added to the private DNS service instance.
    Description string
    (String) The description of the zone.
    InstanceId string
    The GUID of the private DNS service instance.
    Label string
    (String) The label of the zone.
    ModifiedOn string
    (Timestamp) The date and time when the zone was updated.
    Name string
    (String) The name of the zone.
    State string
    (String) The state of the zone.
    ZoneId string
    (String) The ID of the zone.
    CreatedOn string
    (Timestamp) The date and time when the zone was added to the private DNS service instance.
    Description string
    (String) The description of the zone.
    InstanceId string
    The GUID of the private DNS service instance.
    Label string
    (String) The label of the zone.
    ModifiedOn string
    (Timestamp) The date and time when the zone was updated.
    Name string
    (String) The name of the zone.
    State string
    (String) The state of the zone.
    ZoneId string
    (String) The ID of the zone.
    createdOn String
    (Timestamp) The date and time when the zone was added to the private DNS service instance.
    description String
    (String) The description of the zone.
    instanceId String
    The GUID of the private DNS service instance.
    label String
    (String) The label of the zone.
    modifiedOn String
    (Timestamp) The date and time when the zone was updated.
    name String
    (String) The name of the zone.
    state String
    (String) The state of the zone.
    zoneId String
    (String) The ID of the zone.
    createdOn string
    (Timestamp) The date and time when the zone was added to the private DNS service instance.
    description string
    (String) The description of the zone.
    instanceId string
    The GUID of the private DNS service instance.
    label string
    (String) The label of the zone.
    modifiedOn string
    (Timestamp) The date and time when the zone was updated.
    name string
    (String) The name of the zone.
    state string
    (String) The state of the zone.
    zoneId string
    (String) The ID of the zone.
    created_on str
    (Timestamp) The date and time when the zone was added to the private DNS service instance.
    description str
    (String) The description of the zone.
    instance_id str
    The GUID of the private DNS service instance.
    label str
    (String) The label of the zone.
    modified_on str
    (Timestamp) The date and time when the zone was updated.
    name str
    (String) The name of the zone.
    state str
    (String) The state of the zone.
    zone_id str
    (String) The ID of the zone.
    createdOn String
    (Timestamp) The date and time when the zone was added to the private DNS service instance.
    description String
    (String) The description of the zone.
    instanceId String
    The GUID of the private DNS service instance.
    label String
    (String) The label of the zone.
    modifiedOn String
    (Timestamp) The date and time when the zone was updated.
    name String
    (String) The name of the zone.
    state String
    (String) The state of the zone.
    zoneId String
    (String) The ID of the zone.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud