Skip to content

Commit

Permalink
Fix to pdns permitted network test datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
VaishnaviGopal authored and hkantare committed May 26, 2020
1 parent a5dcfe0 commit ca54bc8
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 9 deletions.
5 changes: 2 additions & 3 deletions examples/ibm-private-dns/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
6 changes: 3 additions & 3 deletions ibm/data_source_ibm_private_dns_permitted_network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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)
}
36 changes: 33 additions & 3 deletions website/docs/d/pdns_permitted_networks.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,47 @@ 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
}
```

## Argument Reference

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
Expand Down

0 comments on commit ca54bc8

Please sign in to comment.