ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud
ibm.getDnsZones
Explore with Pulumi AI
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 dictionaryThe following arguments are supported:
- Instance
Id string - The GUID of the private DNS service instance.
 - Id string
 
- Instance
Id string - The GUID of the private DNS service instance.
 - Id string
 
- instance
Id String - The GUID of the private DNS service instance.
 - id String
 
- instance
Id string - The GUID of the private DNS service instance.
 - id string
 
- instance_
id str - The GUID of the private DNS service instance.
 - id str
 
- instance
Id String - The GUID of the private DNS service instance.
 - id String
 
getDnsZones Result
The following output properties are available:
- Dns
Zones List<GetDns Zones Dns Zone>  - (List) A List of zones that you added to your private DNS service instance.
 - Id string
 - Instance
Id string - (String) The ID of the private DNS service instance where you added the zone.
 
- Dns
Zones []GetDns Zones Dns Zone  - (List) A List of zones that you added to your private DNS service instance.
 - Id string
 - Instance
Id string - (String) The ID of the private DNS service instance where you added the zone.
 
- dns
Zones List<GetDns Zones Dns Zone>  - (List) A List of zones that you added to your private DNS service instance.
 - id String
 - instance
Id String - (String) The ID of the private DNS service instance where you added the zone.
 
- dns
Zones GetDns Zones Dns Zone[]  - (List) A List of zones that you added to your private DNS service instance.
 - id string
 - instance
Id string - (String) The ID of the private DNS service instance where you added the zone.
 
- dns_
zones Sequence[GetDns Zones Dns Zone]  - (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.
 
- dns
Zones List<Property Map> - (List) A List of zones that you added to your private DNS service instance.
 - id String
 - instance
Id String - (String) The ID of the private DNS service instance where you added the zone.
 
Supporting Types
GetDnsZonesDnsZone    
- Created
On 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.
 - Instance
Id string - The GUID of the private DNS service instance.
 - Label string
 - (String) The label of the zone.
 - Modified
On 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.
 - Zone
Id string - (String) The ID of the zone.
 
- Created
On 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.
 - Instance
Id string - The GUID of the private DNS service instance.
 - Label string
 - (String) The label of the zone.
 - Modified
On 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.
 - Zone
Id string - (String) The ID of the zone.
 
- created
On 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.
 - instance
Id String - The GUID of the private DNS service instance.
 - label String
 - (String) The label of the zone.
 - modified
On 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.
 - zone
Id String - (String) The ID of the zone.
 
- created
On 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.
 - instance
Id string - The GUID of the private DNS service instance.
 - label string
 - (String) The label of the zone.
 - modified
On 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.
 - zone
Id 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.
 
- created
On 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.
 - instance
Id String - The GUID of the private DNS service instance.
 - label String
 - (String) The label of the zone.
 - modified
On 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.
 - zone
Id 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 
ibmTerraform Provider.