Skip to content

Commit

Permalink
Private DNS resource record related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshan1 authored and hkantare committed Apr 15, 2020
1 parent 16b1a7c commit 11dfeae
Show file tree
Hide file tree
Showing 6 changed files with 908 additions and 2 deletions.
76 changes: 74 additions & 2 deletions examples/ibm-private-dns/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ provider "ibm" {
}

resource "ibm_is_vpc" "test_pdns_vpc" {
depends_on = [data.ibm_resource_group.rg]
name = "test-pdns-vpc"
resource_group = data.ibm_resource_group.rg.id
}

resource "ibm_resource_instance" "test-pdns-instance" {
depends_on = [ibm_is_vpc.test_pdns_vpc]
name = "test-pdns"
resource_group_id = data.ibm_resource_group.rg.id
location = "global"
Expand All @@ -26,15 +28,85 @@ resource "ibm_resource_instance" "test-pdns-instance" {
}

resource "ibm_dns_zone" "test-pdns-zone" {
depends_on = [ibm_resource_instance.test-pdns-instance]
name = "test.com"
instance_id = ibm_resource_instance.test-pdns-instance.guid
description = "testdescription"
label = "testlabel"
label = "testlabel-updated"
}

resource "ibm_dns_permitted_network" "test-pdns-permitted-network-nw" {
depends_on = [ibm_dns_zone.test-pdns-zone]
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.resource_crn
type = "vpc"
}

resource "ibm_dns_resource_record" "test-pdns-resource-record-a" {
depends_on = [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
type = "A"
name = "testA"
rdata = "1.2.3.4"
}

resource "ibm_dns_resource_record" "test-pdns-resource-record-aaaa" {
depends_on = [ibm_dns_resource_record.test-pdns-resource-record-a]
instance_id = ibm_resource_instance.test-pdns-instance.guid
zone_id = ibm_dns_zone.test-pdns-zone.zone_id
type = "AAAA"
name = "testAAAA"
rdata = "2001:0db8:0012:0001:3c5e:7354:0000:5db5"
}

resource "ibm_dns_resource_record" "test-pdns-resource-record-cname" {
depends_on = [ibm_dns_resource_record.test-pdns-resource-record-aaaa]
instance_id = ibm_resource_instance.test-pdns-instance.guid
zone_id = ibm_dns_zone.test-pdns-zone.zone_id
type = "CNAME"
name = "testCNAME"
rdata = "test.com"
}

resource "ibm_dns_resource_record" "test-pdns-resource-record-ptr" {
depends_on = [ibm_dns_resource_record.test-pdns-resource-record-cname]
instance_id = ibm_resource_instance.test-pdns-instance.guid
zone_id = ibm_dns_zone.test-pdns-zone.zone_id
type = "PTR"
name = "1.2.3.4"
rdata = "testA.test.com"
}

resource "ibm_dns_resource_record" "test-pdns-resource-record-mx" {
depends_on = [ibm_dns_resource_record.test-pdns-resource-record-ptr]
instance_id = ibm_resource_instance.test-pdns-instance.guid
zone_id = ibm_dns_zone.test-pdns-zone.zone_id
type = "MX"
name = "testMX"
rdata = "mailserver.test.com"
preference = 10
}

resource "ibm_dns_resource_record" "test-pdns-resource-record-srv" {
depends_on = [ibm_dns_resource_record.test-pdns-resource-record-mx]
instance_id = ibm_resource_instance.test-pdns-instance.guid
zone_id = ibm_dns_zone.test-pdns-zone.zone_id
type = "SRV"
name = "testSRV"
rdata = "tester.com"
priority = 100
weight = 100
port = 8000
service = "_sip"
protocol = "udp"
}

resource "ibm_dns_resource_record" "test-pdns-resource-record-txt" {
depends_on = [ibm_dns_resource_record.test-pdns-resource-record-srv]
instance_id = ibm_resource_instance.test-pdns-instance.guid
zone_id = ibm_dns_zone.test-pdns-zone.zone_id
type = "TXT"
name = "testTXT"
rdata = "textinformation"
}
1 change: 1 addition & 0 deletions ibm/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ func Provider() terraform.ResourceProvider {
//Private DNS related resources
"ibm_dns_zone": resourceIBMPrivateDNSZone(),
"ibm_dns_permitted_network": resourceIBMPrivateDNSPermittedNetwork(),
"ibm_dns_resource_record": resourceIBMPrivateDNSResourceRecord(),
},

ConfigureFunc: providerConfigure,
Expand Down
Loading

0 comments on commit 11dfeae

Please sign in to comment.