ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud
ibm.getDnsPermittedNetworks
Explore with Pulumi AI
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:
- Instance
Id string - The GUID of the private DNS service instance where you created permitted networks.
- Zone
Id string - The ID of the zone where you added the permitted networks.
- Id string
- Instance
Id string - The GUID of the private DNS service instance where you created permitted networks.
- Zone
Id string - The ID of the zone where you added the permitted networks.
- Id string
- instance
Id String - The GUID of the private DNS service instance where you created permitted networks.
- zone
Id String - The ID of the zone where you added the permitted networks.
- id String
- instance
Id string - The GUID of the private DNS service instance where you created permitted networks.
- zone
Id 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
- instance
Id String - The GUID of the private DNS service instance where you created permitted networks.
- zone
Id String - The ID of the zone where you added the permitted networks.
- id String
getDnsPermittedNetworks Result
The following output properties are available:
- Dns
Permitted List<GetNetworks Dns Permitted Networks Dns Permitted Network> - Id string
- Instance
Id string - (String) The ID of the private DNS service instance where you created permitted networks.
- Zone
Id string - (String) The ID of the zone where you added the permitted network.
- Dns
Permitted []GetNetworks Dns Permitted Networks Dns Permitted Network - Id string
- Instance
Id string - (String) The ID of the private DNS service instance where you created permitted networks.
- Zone
Id string - (String) The ID of the zone where you added the permitted network.
- dns
Permitted List<GetNetworks Dns Permitted Networks Dns Permitted Network> - id String
- instance
Id String - (String) The ID of the private DNS service instance where you created permitted networks.
- zone
Id String - (String) The ID of the zone where you added the permitted network.
- dns
Permitted GetNetworks Dns Permitted Networks Dns Permitted Network[] - id string
- instance
Id string - (String) The ID of the private DNS service instance where you created permitted networks.
- zone
Id string - (String) The ID of the zone where you added the permitted network.
- dns_
permitted_ Sequence[Getnetworks Dns Permitted Networks Dns Permitted Network] - 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.
- dns
Permitted List<Property Map>Networks - id String
- instance
Id String - (String) The ID of the private DNS service instance where you created permitted networks.
- zone
Id String - (String) The ID of the zone where you added the permitted network.
Supporting Types
GetDnsPermittedNetworksDnsPermittedNetwork
- Created
On string - (Timestamp) The date and time when the permitted network was created.
- Instance
Id string - The GUID of the private DNS service instance where you created permitted networks.
- Modified
On string - (Timestamp) The date and time when the permitted network was updated.
- Permitted
Network Dictionary<string, string> - (List of VPCs) A list of VPC CRNs that are associated with the permitted network.
- Permitted
Network stringId - (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.
- Zone
Id string - The ID of the zone where you added the permitted networks.
- Created
On string - (Timestamp) The date and time when the permitted network was created.
- Instance
Id string - The GUID of the private DNS service instance where you created permitted networks.
- Modified
On string - (Timestamp) The date and time when the permitted network was updated.
- Permitted
Network map[string]string - (List of VPCs) A list of VPC CRNs that are associated with the permitted network.
- Permitted
Network stringId - (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.
- Zone
Id string - The ID of the zone where you added the permitted networks.
- created
On String - (Timestamp) The date and time when the permitted network was created.
- instance
Id String - The GUID of the private DNS service instance where you created permitted networks.
- modified
On String - (Timestamp) The date and time when the permitted network was updated.
- permitted
Network Map<String,String> - (List of VPCs) A list of VPC CRNs that are associated with the permitted network.
- permitted
Network StringId - (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.
- zone
Id String - The ID of the zone where you added the permitted networks.
- created
On string - (Timestamp) The date and time when the permitted network was created.
- instance
Id string - The GUID of the private DNS service instance where you created permitted networks.
- modified
On string - (Timestamp) The date and time when the permitted network was updated.
- permitted
Network {[key: string]: string} - (List of VPCs) A list of VPC CRNs that are associated with the permitted network.
- permitted
Network stringId - (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.
- zone
Id 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_ strid - (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.
- created
On String - (Timestamp) The date and time when the permitted network was created.
- instance
Id String - The GUID of the private DNS service instance where you created permitted networks.
- modified
On String - (Timestamp) The date and time when the permitted network was updated.
- permitted
Network Map<String> - (List of VPCs) A list of VPC CRNs that are associated with the permitted network.
- permitted
Network StringId - (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.
- zone
Id 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.