diff --git a/examples/ibm-private-dns/main.tf b/examples/ibm-private-dns/main.tf index 2a09d86998..4c197ec155 100644 --- a/examples/ibm-private-dns/main.tf +++ b/examples/ibm-private-dns/main.tf @@ -40,9 +40,8 @@ resource "ibm_dns_permitted_network" "test-pdns-permitted-network-nw" { data "ibm_dns_permitted_networks" "test" { - depends_on = [ibm_dns_permitted_network.test-pdns-permitted-network-nw] - instance_id = ibm_dns_zone.test-pdns-zone.instance_id - zone_id = ibm_dns_zone.test-pdns-zone.zone_id + instance_id = ibm_dns_permitted_network.test-pdns-permitted-network-nw.instance_id + zone_id = ibm_dns_permitted_network.test-pdns-permitted-network-nw.zone_id } output "dns_permitted_nw_output" { diff --git a/ibm/data_source_ibm_private_dns_permitted_network_test.go b/ibm/data_source_ibm_private_dns_permitted_network_test.go index 0ff5f10dee..d823f83c6e 100644 --- a/ibm/data_source_ibm_private_dns_permitted_network_test.go +++ b/ibm/data_source_ibm_private_dns_permitted_network_test.go @@ -46,6 +46,7 @@ func testAccCheckIBMpDNSPermittedNetworksDataSourceConfig(riname, vpcname, zonen resource "ibm_is_vpc" "test_pdns_vpc" { name = "%s" + resource_group = data.ibm_resource_group.rg.id } resource "ibm_dns_zone" "test-pdns-zone" { @@ -62,8 +63,7 @@ func testAccCheckIBMpDNSPermittedNetworksDataSourceConfig(riname, vpcname, zonen } data "ibm_dns_permitted_networks" "test" { - depends_on = [ibm_dns_permitted_network.test-pdns-permitted-network-nw] - instance_id = ibm_dns_zone.test-pdns-zone.instance_id - zone_id = ibm_dns_zone.test-pdns-zone.zone_id + instance_id = ibm_dns_permitted_network.test-pdns-permitted-network-nw.instance_id + zone_id = ibm_dns_permitted_network.test-pdns-permitted-network-nw.zone_id }`, riname, vpcname, zonename) } diff --git a/website/docs/d/pdns_permitted_networks.html.markdown b/website/docs/d/pdns_permitted_networks.html.markdown index 89ed681980..0e1d2bd91a 100644 --- a/website/docs/d/pdns_permitted_networks.html.markdown +++ b/website/docs/d/pdns_permitted_networks.html.markdown @@ -16,9 +16,39 @@ Import the details of an existing IBM Cloud Infrastructure private domain name s ```hcl +data "ibm_resource_group" "rg" { + name = "default" +} + +resource "ibm_is_vpc" "test_pdns_vpc" { + name = "test-pdns-vpc" + resource_group = data.ibm_resource_group.rg.id +} + +resource "ibm_resource_instance" "test-pdns-instance" { + name = "test-pdns" + resource_group_id = data.ibm_resource_group.rg.id + location = "global" + service = "dns-svcs" + plan = "standard-dns" +} + +resource "ibm_dns_zone" "test-pdns-zone" { + name = "test.com" + instance_id = ibm_resource_instance.test-pdns-instance.guid + description = "testdescription" + label = "testlabel-updated" +} + +resource "ibm_dns_permitted_network" "test-pdns-permitted-network-nw" { + instance_id = ibm_resource_instance.test-pdns-instance.guid + zone_id = ibm_dns_zone.test-pdns-zone.zone_id + vpc_crn = ibm_is_vpc.test_pdns_vpc.crn +} + data "ibm_dns_permitted_networks" "test" { - instance_id = ibm_dns_zone.test-pdns-zone.instance_id - zone_id = ibm_dns_zone.test-pdns-zone.zone_id + instance_id = ibm_dns_permitted_network.test-pdns-permitted-network-nw.instance_id + zone_id = ibm_dns_permitted_network.test-pdns-permitted-network-nw.zone_id } ``` @@ -26,7 +56,7 @@ data "ibm_dns_permitted_networks" "test" { The following arguments are supported: -* `instance_id` - (Required, string) The resource instance id of the private DNS on which zones were created. +* `instance_id` - (Required, string) The resource instance id of the private DNS on which permitted networks were created. * `zone_id` - (Required, string) The resource zone id of the private DNS on which permitted networks were created. ## Attribute Reference