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

ibm.getDnsPermittedNetworks

Explore with Pulumi AI

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

    Retrieve details about permitted networks for a zone that is associated with the private DNS service instance. For more information, see managing permitted networks.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const rg = ibm.getResourceGroup({
        name: "default",
    });
    const testPdnsVpc = new ibm.IsVpc("testPdnsVpc", {resourceGroup: rg.then(rg => rg.id)});
    const test_pdns_instance = new ibm.ResourceInstance("test-pdns-instance", {
        resourceGroupId: rg.then(rg => rg.id),
        location: "global",
        service: "dns-svcs",
        plan: "standard-dns",
    });
    const test_pdns_zone = new ibm.DnsZone("test-pdns-zone", {
        instanceId: test_pdns_instance.guid,
        description: "testdescription",
        label: "testlabel-updated",
    });
    const test_pdns_permitted_network_nw = new ibm.DnsPermittedNetwork("test-pdns-permitted-network-nw", {
        instanceId: test_pdns_instance.guid,
        zoneId: test_pdns_zone.zoneId,
        vpcCrn: testPdnsVpc.crn,
    });
    const test = ibm.getDnsPermittedNetworksOutput({
        instanceId: test_pdns_permitted_network_nw.instanceId,
        zoneId: test_pdns_permitted_network_nw.zoneId,
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    rg = ibm.get_resource_group(name="default")
    test_pdns_vpc = ibm.IsVpc("testPdnsVpc", resource_group=rg.id)
    test_pdns_instance = ibm.ResourceInstance("test-pdns-instance",
        resource_group_id=rg.id,
        location="global",
        service="dns-svcs",
        plan="standard-dns")
    test_pdns_zone = ibm.DnsZone("test-pdns-zone",
        instance_id=test_pdns_instance.guid,
        description="testdescription",
        label="testlabel-updated")
    test_pdns_permitted_network_nw = ibm.DnsPermittedNetwork("test-pdns-permitted-network-nw",
        instance_id=test_pdns_instance.guid,
        zone_id=test_pdns_zone.zone_id,
        vpc_crn=test_pdns_vpc.crn)
    test = ibm.get_dns_permitted_networks_output(instance_id=test_pdns_permitted_network_nw.instance_id,
        zone_id=test_pdns_permitted_network_nw.zone_id)
    
    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 {
    		rg, err := ibm.LookupResourceGroup(ctx, &ibm.LookupResourceGroupArgs{
    			Name: pulumi.StringRef("default"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		testPdnsVpc, err := ibm.NewIsVpc(ctx, "testPdnsVpc", &ibm.IsVpcArgs{
    			ResourceGroup: pulumi.String(rg.Id),
    		})
    		if err != nil {
    			return err
    		}
    		test_pdns_instance, err := ibm.NewResourceInstance(ctx, "test-pdns-instance", &ibm.ResourceInstanceArgs{
    			ResourceGroupId: pulumi.String(rg.Id),
    			Location:        pulumi.String("global"),
    			Service:         pulumi.String("dns-svcs"),
    			Plan:            pulumi.String("standard-dns"),
    		})
    		if err != nil {
    			return err
    		}
    		test_pdns_zone, err := ibm.NewDnsZone(ctx, "test-pdns-zone", &ibm.DnsZoneArgs{
    			InstanceId:  test_pdns_instance.Guid,
    			Description: pulumi.String("testdescription"),
    			Label:       pulumi.String("testlabel-updated"),
    		})
    		if err != nil {
    			return err
    		}
    		test_pdns_permitted_network_nw, err := ibm.NewDnsPermittedNetwork(ctx, "test-pdns-permitted-network-nw", &ibm.DnsPermittedNetworkArgs{
    			InstanceId: test_pdns_instance.Guid,
    			ZoneId:     test_pdns_zone.ZoneId,
    			VpcCrn:     testPdnsVpc.Crn,
    		})
    		if err != nil {
    			return err
    		}
    		_ = ibm.GetDnsPermittedNetworksOutput(ctx, ibm.GetDnsPermittedNetworksOutputArgs{
    			InstanceId: test_pdns_permitted_network_nw.InstanceId,
    			ZoneId:     test_pdns_permitted_network_nw.ZoneId,
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var rg = Ibm.GetResourceGroup.Invoke(new()
        {
            Name = "default",
        });
    
        var testPdnsVpc = new Ibm.IsVpc("testPdnsVpc", new()
        {
            ResourceGroup = rg.Apply(getResourceGroupResult => getResourceGroupResult.Id),
        });
    
        var test_pdns_instance = new Ibm.ResourceInstance("test-pdns-instance", new()
        {
            ResourceGroupId = rg.Apply(getResourceGroupResult => getResourceGroupResult.Id),
            Location = "global",
            Service = "dns-svcs",
            Plan = "standard-dns",
        });
    
        var test_pdns_zone = new Ibm.DnsZone("test-pdns-zone", new()
        {
            InstanceId = test_pdns_instance.Guid,
            Description = "testdescription",
            Label = "testlabel-updated",
        });
    
        var test_pdns_permitted_network_nw = new Ibm.DnsPermittedNetwork("test-pdns-permitted-network-nw", new()
        {
            InstanceId = test_pdns_instance.Guid,
            ZoneId = test_pdns_zone.ZoneId,
            VpcCrn = testPdnsVpc.Crn,
        });
    
        var test = Ibm.GetDnsPermittedNetworks.Invoke(new()
        {
            InstanceId = test_pdns_permitted_network_nw.InstanceId,
            ZoneId = test_pdns_permitted_network_nw.ZoneId,
        });
    
    });
    
    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.GetResourceGroupArgs;
    import com.pulumi.ibm.IsVpc;
    import com.pulumi.ibm.IsVpcArgs;
    import com.pulumi.ibm.ResourceInstance;
    import com.pulumi.ibm.ResourceInstanceArgs;
    import com.pulumi.ibm.DnsZone;
    import com.pulumi.ibm.DnsZoneArgs;
    import com.pulumi.ibm.DnsPermittedNetwork;
    import com.pulumi.ibm.DnsPermittedNetworkArgs;
    import com.pulumi.ibm.inputs.GetDnsPermittedNetworksArgs;
    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 rg = IbmFunctions.getResourceGroup(GetResourceGroupArgs.builder()
                .name("default")
                .build());
    
            var testPdnsVpc = new IsVpc("testPdnsVpc", IsVpcArgs.builder()
                .resourceGroup(rg.applyValue(getResourceGroupResult -> getResourceGroupResult.id()))
                .build());
    
            var test_pdns_instance = new ResourceInstance("test-pdns-instance", ResourceInstanceArgs.builder()
                .resourceGroupId(rg.applyValue(getResourceGroupResult -> getResourceGroupResult.id()))
                .location("global")
                .service("dns-svcs")
                .plan("standard-dns")
                .build());
    
            var test_pdns_zone = new DnsZone("test-pdns-zone", DnsZoneArgs.builder()
                .instanceId(test_pdns_instance.guid())
                .description("testdescription")
                .label("testlabel-updated")
                .build());
    
            var test_pdns_permitted_network_nw = new DnsPermittedNetwork("test-pdns-permitted-network-nw", DnsPermittedNetworkArgs.builder()
                .instanceId(test_pdns_instance.guid())
                .zoneId(test_pdns_zone.zoneId())
                .vpcCrn(testPdnsVpc.crn())
                .build());
    
            final var test = IbmFunctions.getDnsPermittedNetworks(GetDnsPermittedNetworksArgs.builder()
                .instanceId(test_pdns_permitted_network_nw.instanceId())
                .zoneId(test_pdns_permitted_network_nw.zoneId())
                .build());
    
        }
    }
    
    resources:
      testPdnsVpc:
        type: ibm:IsVpc
        properties:
          resourceGroup: ${rg.id}
      test-pdns-instance:
        type: ibm:ResourceInstance
        properties:
          resourceGroupId: ${rg.id}
          location: global
          service: dns-svcs
          plan: standard-dns
      test-pdns-zone:
        type: ibm:DnsZone
        properties:
          instanceId: ${["test-pdns-instance"].guid}
          description: testdescription
          label: testlabel-updated
      test-pdns-permitted-network-nw:
        type: ibm:DnsPermittedNetwork
        properties:
          instanceId: ${["test-pdns-instance"].guid}
          zoneId: ${["test-pdns-zone"].zoneId}
          vpcCrn: ${testPdnsVpc.crn}
    variables:
      rg:
        fn::invoke:
          function: ibm:getResourceGroup
          arguments:
            name: default
      test:
        fn::invoke:
          function: ibm:getDnsPermittedNetworks
          arguments:
            instanceId: ${["test-pdns-permitted-network-nw"].instanceId}
            zoneId: ${["test-pdns-permitted-network-nw"].zoneId}
    

    Using getDnsPermittedNetworks

    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 getDnsPermittedNetworks(args: GetDnsPermittedNetworksArgs, opts?: InvokeOptions): Promise<GetDnsPermittedNetworksResult>
    function getDnsPermittedNetworksOutput(args: GetDnsPermittedNetworksOutputArgs, opts?: InvokeOptions): Output<GetDnsPermittedNetworksResult>
    def get_dns_permitted_networks(id: Optional[str] = None,
                                   instance_id: Optional[str] = None,
                                   zone_id: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetDnsPermittedNetworksResult
    def get_dns_permitted_networks_output(id: Optional[pulumi.Input[str]] = None,
                                   instance_id: Optional[pulumi.Input[str]] = None,
                                   zone_id: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetDnsPermittedNetworksResult]
    func GetDnsPermittedNetworks(ctx *Context, args *GetDnsPermittedNetworksArgs, opts ...InvokeOption) (*GetDnsPermittedNetworksResult, error)
    func GetDnsPermittedNetworksOutput(ctx *Context, args *GetDnsPermittedNetworksOutputArgs, opts ...InvokeOption) GetDnsPermittedNetworksResultOutput

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

    public static class GetDnsPermittedNetworks 
    {
        public static Task<GetDnsPermittedNetworksResult> InvokeAsync(GetDnsPermittedNetworksArgs args, InvokeOptions? opts = null)
        public static Output<GetDnsPermittedNetworksResult> Invoke(GetDnsPermittedNetworksInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDnsPermittedNetworksResult> getDnsPermittedNetworks(GetDnsPermittedNetworksArgs args, InvokeOptions options)
    public static Output<GetDnsPermittedNetworksResult> getDnsPermittedNetworks(GetDnsPermittedNetworksArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getDnsPermittedNetworks:getDnsPermittedNetworks
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    The GUID of the private DNS service instance where you created permitted networks.
    ZoneId string
    The ID of the zone where you added the permitted networks.
    Id string
    InstanceId string
    The GUID of the private DNS service instance where you created permitted networks.
    ZoneId string
    The ID of the zone where you added the permitted networks.
    Id string
    instanceId String
    The GUID of the private DNS service instance where you created permitted networks.
    zoneId String
    The ID of the zone where you added the permitted networks.
    id String
    instanceId string
    The GUID of the private DNS service instance where you created permitted networks.
    zoneId string
    The ID of the zone where you added the permitted networks.
    id string
    instance_id str
    The GUID of the private DNS service instance where you created permitted networks.
    zone_id str
    The ID of the zone where you added the permitted networks.
    id str
    instanceId String
    The GUID of the private DNS service instance where you created permitted networks.
    zoneId String
    The ID of the zone where you added the permitted networks.
    id String

    getDnsPermittedNetworks Result

    The following output properties are available:

    DnsPermittedNetworks List<GetDnsPermittedNetworksDnsPermittedNetwork>
    Id string
    InstanceId string
    (String) The ID of the private DNS service instance where you created permitted networks.
    ZoneId string
    (String) The ID of the zone where you added the permitted network.
    DnsPermittedNetworks []GetDnsPermittedNetworksDnsPermittedNetwork
    Id string
    InstanceId string
    (String) The ID of the private DNS service instance where you created permitted networks.
    ZoneId string
    (String) The ID of the zone where you added the permitted network.
    dnsPermittedNetworks List<GetDnsPermittedNetworksDnsPermittedNetwork>
    id String
    instanceId String
    (String) The ID of the private DNS service instance where you created permitted networks.
    zoneId String
    (String) The ID of the zone where you added the permitted network.
    dnsPermittedNetworks GetDnsPermittedNetworksDnsPermittedNetwork[]
    id string
    instanceId string
    (String) The ID of the private DNS service instance where you created permitted networks.
    zoneId string
    (String) The ID of the zone where you added the permitted network.
    dns_permitted_networks Sequence[GetDnsPermittedNetworksDnsPermittedNetwork]
    id str
    instance_id str
    (String) The ID of the private DNS service instance where you created permitted networks.
    zone_id str
    (String) The ID of the zone where you added the permitted network.
    dnsPermittedNetworks List<Property Map>
    id String
    instanceId String
    (String) The ID of the private DNS service instance where you created permitted networks.
    zoneId String
    (String) The ID of the zone where you added the permitted network.

    Supporting Types

    GetDnsPermittedNetworksDnsPermittedNetwork

    CreatedOn string
    (Timestamp) The date and time when the permitted network was created.
    InstanceId string
    The GUID of the private DNS service instance where you created permitted networks.
    ModifiedOn string
    (Timestamp) The date and time when the permitted network was updated.
    PermittedNetwork Dictionary<string, string>
    (List of VPCs) A list of VPC CRNs that are associated with the permitted network.
    PermittedNetworkId string
    (String) The ID of the permitted network.
    State string
    (String) The state of the permitted network.
    Type string
    (String) The type of the permitted network.
    ZoneId string
    The ID of the zone where you added the permitted networks.
    CreatedOn string
    (Timestamp) The date and time when the permitted network was created.
    InstanceId string
    The GUID of the private DNS service instance where you created permitted networks.
    ModifiedOn string
    (Timestamp) The date and time when the permitted network was updated.
    PermittedNetwork map[string]string
    (List of VPCs) A list of VPC CRNs that are associated with the permitted network.
    PermittedNetworkId string
    (String) The ID of the permitted network.
    State string
    (String) The state of the permitted network.
    Type string
    (String) The type of the permitted network.
    ZoneId string
    The ID of the zone where you added the permitted networks.
    createdOn String
    (Timestamp) The date and time when the permitted network was created.
    instanceId String
    The GUID of the private DNS service instance where you created permitted networks.
    modifiedOn String
    (Timestamp) The date and time when the permitted network was updated.
    permittedNetwork Map<String,String>
    (List of VPCs) A list of VPC CRNs that are associated with the permitted network.
    permittedNetworkId String
    (String) The ID of the permitted network.
    state String
    (String) The state of the permitted network.
    type String
    (String) The type of the permitted network.
    zoneId String
    The ID of the zone where you added the permitted networks.
    createdOn string
    (Timestamp) The date and time when the permitted network was created.
    instanceId string
    The GUID of the private DNS service instance where you created permitted networks.
    modifiedOn string
    (Timestamp) The date and time when the permitted network was updated.
    permittedNetwork {[key: string]: string}
    (List of VPCs) A list of VPC CRNs that are associated with the permitted network.
    permittedNetworkId string
    (String) The ID of the permitted network.
    state string
    (String) The state of the permitted network.
    type string
    (String) The type of the permitted network.
    zoneId string
    The ID of the zone where you added the permitted networks.
    created_on str
    (Timestamp) The date and time when the permitted network was created.
    instance_id str
    The GUID of the private DNS service instance where you created permitted networks.
    modified_on str
    (Timestamp) The date and time when the permitted network was updated.
    permitted_network Mapping[str, str]
    (List of VPCs) A list of VPC CRNs that are associated with the permitted network.
    permitted_network_id str
    (String) The ID of the permitted network.
    state str
    (String) The state of the permitted network.
    type str
    (String) The type of the permitted network.
    zone_id str
    The ID of the zone where you added the permitted networks.
    createdOn String
    (Timestamp) The date and time when the permitted network was created.
    instanceId String
    The GUID of the private DNS service instance where you created permitted networks.
    modifiedOn String
    (Timestamp) The date and time when the permitted network was updated.
    permittedNetwork Map<String>
    (List of VPCs) A list of VPC CRNs that are associated with the permitted network.
    permittedNetworkId String
    (String) The ID of the permitted network.
    state String
    (String) The state of the permitted network.
    type String
    (String) The type of the permitted network.
    zoneId String
    The ID of the zone where you added the permitted networks.

    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