Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dns e2e #1944

Merged
merged 3 commits into from
Dec 23, 2023
Merged

Dns e2e #1944

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions modules/dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For DNSSEC configuration, refer to the [`dns_managed_zone` documentation](https:
```hcl
module "private-dns" {
source = "./fabric/modules/dns"
project_id = "myproject"
project_id = var.project_id
name = "test-example"
zone_config = {
domain = "test.example."
Expand All @@ -24,18 +24,18 @@ module "private-dns" {
"A myhost" = { ttl = 600, records = ["10.0.0.120"] }
}
iam = {
"roles/dns.admin" = ["group:dns-administrators@myorg.com"]
"roles/dns.admin" = ["group:${var.group_email}"]
}
}
# tftest modules=1 resources=4 inventory=private-zone.yaml
# tftest modules=1 resources=4 inventory=private-zone.yaml e2e
```

### Forwarding Zone

```hcl
module "private-dns" {
source = "./fabric/modules/dns"
project_id = "myproject"
project_id = var.project_id
name = "test-example"
zone_config = {
domain = "test.example."
Expand All @@ -45,15 +45,15 @@ module "private-dns" {
}
}
}
# tftest modules=1 resources=1 inventory=forwarding-zone.yaml
# tftest modules=1 resources=1 inventory=forwarding-zone.yaml e2e
```

### Peering Zone

```hcl
module "private-dns" {
source = "./fabric/modules/dns"
project_id = "myproject"
project_id = var.project_id
name = "test-example"
zone_config = {
domain = "."
Expand All @@ -71,7 +71,7 @@ module "private-dns" {
```hcl
module "private-dns" {
source = "./fabric/modules/dns"
project_id = "myproject"
project_id = var.project_id
name = "test-example"
zone_config = {
domain = "test.example."
Expand Down Expand Up @@ -99,15 +99,15 @@ module "private-dns" {
}
}
}
# tftest modules=1 resources=4 inventory=routing-policies.yaml
# tftest modules=1 resources=4 inventory=routing-policies.yaml e2e
```

### Reverse Lookup Zone

```hcl
module "private-dns" {
source = "./fabric/modules/dns"
project_id = "myproject"
project_id = var.project_id
name = "test-example"
zone_config = {
domain = "0.0.10.in-addr.arpa."
Expand All @@ -116,28 +116,28 @@ module "private-dns" {
}
}
}
# tftest modules=1 resources=1 inventory=reverse-zone.yaml
# tftest modules=1 resources=1 inventory=reverse-zone.yaml e2e
```

### Public Zone

```hcl
module "public-dns" {
source = "./fabric/modules/dns"
project_id = "myproject"
name = "example"
project_id = var.project_id
name = "test-example"
zone_config = {
domain = "example.com."
domain = "test.example."
public = {}
}
recordsets = {
"A myhost" = { ttl = 300, records = ["127.0.0.1"] }
}
iam = {
"roles/dns.admin" = ["group:dns-administrators@myorg.com"]
"roles/dns.admin" = ["group:${var.group_email}"]
}
}
# tftest modules=1 resources=3 inventory=public-zone.yaml
# tftest modules=1 resources=3 inventory=public-zone.yaml e2e
```
<!-- BEGIN TFDOC -->
## Variables
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/dns/examples/forwarding-zone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ values:
- gke_clusters: []
networks:
- network_url: projects/xxx/global/networks/aaa
project: myproject
project: project-id
visibility: private

counts:
Expand Down
12 changes: 11 additions & 1 deletion tests/modules/dns/examples/peering-zone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@

values:
module.private-dns.google_dns_managed_zone.dns_managed_zone[0]:
cloud_logging_config:
- enable_logging: false
description: Terraform managed.
dns_name: .
dnssec_config: []
force_destroy: false
forwarding_config: []
labels: null
name: test-example
peering_config:
- target_network:
Expand All @@ -25,8 +30,13 @@ values:
- gke_clusters: []
networks:
- network_url: projects/xxx/global/networks/aaa
project: myproject
project: project-id
reverse_lookup: false
service_directory_config: []
timeouts: null
visibility: private

counts:
google_dns_managed_zone: 1
modules: 1
resources: 1
6 changes: 3 additions & 3 deletions tests/modules/dns/examples/private-zone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ values:
- gke_clusters: []
networks:
- network_url: projects/xxx/global/networks/aaa
project: myproject
project: project-id
visibility: private
module.private-dns.google_dns_record_set.dns_record_set["A localhost"]:
managed_zone: test-example
name: localhost.test.example.
project: myproject
project: project-id
routing_policy: []
rrdatas:
- 127.0.0.1
Expand All @@ -38,7 +38,7 @@ values:
module.private-dns.google_dns_record_set.dns_record_set["A myhost"]:
managed_zone: test-example
name: myhost.test.example.
project: myproject
project: project-id
routing_policy: []
rrdatas:
- 10.0.0.120
Expand Down
12 changes: 6 additions & 6 deletions tests/modules/dns/examples/public-zone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

values:
module.public-dns.google_dns_managed_zone.dns_managed_zone[0]:
dns_name: example.com.
name: example
project: myproject
dns_name: test.example.
name: test-example
project: project-id
visibility: public
module.public-dns.google_dns_record_set.dns_record_set["A myhost"]:
managed_zone: example
name: myhost.example.com.
project: myproject
managed_zone: test-example
name: myhost.test.example.
project: project-id
routing_policy: []
rrdatas:
- 127.0.0.1
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/dns/examples/reverse-zone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ values:
description: Terraform managed.
dns_name: 0.0.10.in-addr.arpa.
name: test-example
project: myproject
project: project-id
reverse_lookup: true
visibility: private

Expand Down
8 changes: 4 additions & 4 deletions tests/modules/dns/examples/routing-policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ values:
module.private-dns.google_dns_managed_zone.dns_managed_zone[0]:
dns_name: test.example.
name: test-example
project: myproject
project: project-id
module.private-dns.google_dns_record_set.dns_record_set["A geo"]:
managed_zone: test-example
name: geo.test.example.
project: myproject
project: project-id
routing_policy:
- enable_geo_fencing: null
geo:
Expand All @@ -44,7 +44,7 @@ values:
module.private-dns.google_dns_record_set.dns_record_set["A regular"]:
managed_zone: test-example
name: regular.test.example.
project: myproject
project: project-id
routing_policy: []
rrdatas:
- 10.20.0.1
Expand All @@ -53,7 +53,7 @@ values:
module.private-dns.google_dns_record_set.dns_record_set["A wrr"]:
managed_zone: test-example
name: wrr.test.example.
project: myproject
project: project-id
routing_policy:
- enable_geo_fencing: null
geo: []
Expand Down