Skip to content

Commit

Permalink
updating documentation and tests following last comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pchanvallon committed Jan 12, 2023
1 parent f92735b commit 1006473
Showing 1 changed file with 2 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,71 +30,11 @@ func TestAccPrivateDNSResolverForwardingRuleDataSource_basic(t *testing.T) {

func (d PrivateDNSResolverForwardingRuleDataSource) basic(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "test" {
name = "acctest-rg-%[2]d"
location = "%[1]s"
}
resource "azurerm_virtual_network" "test" {
name = "acctest-rg-%[2]d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
address_space = ["10.0.0.0/16"]
}
resource "azurerm_subnet" "test" {
name = "outbounddns"
resource_group_name = azurerm_resource_group.test.name
virtual_network_name = azurerm_virtual_network.test.name
address_prefixes = ["10.0.0.64/28"]
delegation {
name = "Microsoft.Network.dnsResolvers"
service_delegation {
actions = ["Microsoft.Network/virtualNetworks/subnets/join/action"]
name = "Microsoft.Network/dnsResolvers"
}
}
}
resource "azurerm_private_dns_resolver" "test" {
name = "acctest-dr-%[2]d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
virtual_network_id = azurerm_virtual_network.test.id
}
resource "azurerm_private_dns_resolver_outbound_endpoint" "test" {
name = "acctest-droe-%[2]d"
private_dns_resolver_id = azurerm_private_dns_resolver.test.id
location = azurerm_private_dns_resolver.test.location
subnet_id = azurerm_subnet.test.id
}
resource "azurerm_private_dns_resolver_dns_forwarding_ruleset" "test" {
name = "acctest-drdfr-%[2]d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
private_dns_resolver_outbound_endpoint_ids = [azurerm_private_dns_resolver_outbound_endpoint.test.id]
}
resource "azurerm_private_dns_resolver_forwarding_rule" "test" {
name = "acctest-drfr-%[2]d"
dns_forwarding_ruleset_id = azurerm_private_dns_resolver_dns_forwarding_ruleset.test.id
domain_name = "onprem.local."
target_dns_servers {
ip_address = "10.10.0.1"
port = 53
}
}
%s
data "azurerm_private_dns_resolver_forwarding_rule" "test" {
name = azurerm_private_dns_resolver_forwarding_rule.test.name
dns_forwarding_ruleset_id = azurerm_private_dns_resolver_dns_forwarding_ruleset.test.id
}
`, data.Locations.Primary, data.RandomInteger)
`, PrivateDNSResolverForwardingRuleResource{}.basic(data))
}

0 comments on commit 1006473

Please sign in to comment.