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

Fix dnssec keys lookup #1728

Merged
merged 3 commits into from
Oct 3, 2023
Merged
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
2 changes: 1 addition & 1 deletion blueprints/cloud-operations/dns-fine-grained-iam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,5 @@ module "test1" {
project_create = true
project_id = "test"
}
# tftest modules=9 resources=28
# tftest modules=9 resources=27
```
2 changes: 1 addition & 1 deletion blueprints/cloud-operations/dns-shared-vpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ module "test" {
shared_vpc_link = "https://www.googleapis.com/compute/v1/projects/test-dns/global/networks/default"
teams = ["team1", "team2"]
}
# tftest modules=9 resources=20
# tftest modules=9 resources=16
```
2 changes: 1 addition & 1 deletion blueprints/networking/decentralized-firewall/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ module "test" {
root_node = "organizations/0123456789"
}

# tftest modules=9 resources=56
# tftest modules=9 resources=54
```
2 changes: 1 addition & 1 deletion blueprints/networking/filtering-proxy-psc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ module "test" {
}
project_id = "test-project"
}
# tftest modules=13 resources=42
# tftest modules=13 resources=41
```
4 changes: 2 additions & 2 deletions blueprints/networking/filtering-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module "test1" {
prefix = "fabric"
root_node = "folders/123456789"
}
# tftest modules=14 resources=39
# tftest modules=14 resources=38
```

```hcl
Expand All @@ -58,5 +58,5 @@ module "test2" {
prefix = "fabric"
root_node = "folders/123456789"
}
# tftest modules=12 resources=33
# tftest modules=12 resources=32
```
2 changes: 1 addition & 1 deletion blueprints/networking/hub-and-spoke-vpn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,5 @@ module "test" {
project_id = "project-1"
}

# tftest modules=20 resources=84
# tftest modules=20 resources=79
```
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ module "test" {
}
project_id = "test-project"
}
# tftest modules=11 resources=45
# tftest modules=11 resources=44
```
2 changes: 1 addition & 1 deletion blueprints/networking/shared-vpc-gke/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ module "test" {
prefix = "test"
root_node = "organizations/0123456789"
}
# tftest modules=11 resources=46
# tftest modules=11 resources=45
```
6 changes: 3 additions & 3 deletions blueprints/serverless/cloud-run-corporate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ module "test" {
prj_onprem_id = "onprem-project-id"
}

# tftest modules=15 resources=52
# tftest modules=15 resources=50
```

```hcl
Expand All @@ -276,7 +276,7 @@ module "test" {
tf_identity = "[email protected]"
}

# tftest modules=15 resources=38
# tftest modules=15 resources=36
```

```hcl
Expand All @@ -295,5 +295,5 @@ module "test" {
custom_domain = "cloud-run-corporate.example.org"
}

# tftest modules=14 resources=47
# tftest modules=14 resources=45
```
12 changes: 6 additions & 6 deletions modules/dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module "private-dns" {
"roles/dns.admin" = ["group:[email protected]"]
}
}
# tftest modules=1 resources=5 inventory=private-zone.yaml
# tftest modules=1 resources=4 inventory=private-zone.yaml
```

### Forwarding Zone
Expand All @@ -45,7 +45,7 @@ module "private-dns" {
}
}
}
# tftest modules=1 resources=2 inventory=forwarding-zone.yaml
# tftest modules=1 resources=1 inventory=forwarding-zone.yaml
```

### Peering Zone
Expand All @@ -63,7 +63,7 @@ module "private-dns" {
}
}
}
# tftest modules=1 resources=2 inventory=peering-zone.yaml
# tftest modules=1 resources=1 inventory=peering-zone.yaml
```

### Routing Policies
Expand Down Expand Up @@ -99,7 +99,7 @@ module "private-dns" {
}
}
}
# tftest modules=1 resources=5 inventory=routing-policies.yaml
# tftest modules=1 resources=4 inventory=routing-policies.yaml
```

### Reverse Lookup Zone
Expand All @@ -116,7 +116,7 @@ module "private-dns" {
}
}
}
# tftest modules=1 resources=2 inventory=reverse-zone.yaml
# tftest modules=1 resources=1 inventory=reverse-zone.yaml
```

### Public Zone
Expand All @@ -137,7 +137,7 @@ module "public-dns" {
"roles/dns.admin" = ["group:[email protected]"]
}
}
# tftest modules=1 resources=4 inventory=public-zone.yaml
# tftest modules=1 resources=3 inventory=public-zone.yaml
```
<!-- BEGIN TFDOC -->
## Variables
Expand Down
4 changes: 3 additions & 1 deletion modules/dns/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ resource "google_dns_managed_zone_iam_binding" "iam_bindings" {
}

data "google_dns_keys" "dns_keys" {
count = try(var.zone_config.public.dnssec_config, null) != null ? 1 : 0
managed_zone = local.managed_zone.id
project = var.project_id
}

resource "google_dns_record_set" "dns_record_set" {
Expand Down Expand Up @@ -193,4 +195,4 @@ resource "google_dns_record_set" "dns_record_set" {
depends_on = [
google_dns_managed_zone.dns_managed_zone
]
}
}
4 changes: 2 additions & 2 deletions modules/dns/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@

output "dns_keys" {
description = "DNSKEY and DS records of DNSSEC-signed managed zones."
value = data.google_dns_keys.dns_keys
value = try(data.google_dns_keys.dns_keys, null)
}

output "domain" {
Expand Down
2 changes: 1 addition & 1 deletion modules/service-directory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ module "dns-sd" {
}
}
}
# tftest modules=2 resources=6 inventory=dns.yaml
# tftest modules=2 resources=5 inventory=dns.yaml
```
<!-- BEGIN TFDOC -->

Expand Down
4 changes: 2 additions & 2 deletions tests/fast/stages/s2_networking_a_peering/stage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,4 +14,4 @@

counts:
modules: 28
resources: 154
resources: 145
2 changes: 1 addition & 1 deletion tests/fast/stages/s2_networking_b_vpn/stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

counts:
modules: 30
resources: 191
resources: 182
2 changes: 1 addition & 1 deletion tests/fast/stages/s2_networking_c_nva/stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

counts:
modules: 42
resources: 201
resources: 192
2 changes: 1 addition & 1 deletion tests/fast/stages/s2_networking_d_separate_envs/stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

counts:
modules: 21
resources: 171
resources: 165
2 changes: 1 addition & 1 deletion tests/fast/stages/s2_networking_e_nva_bgp/stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

counts:
modules: 36
resources: 212
resources: 203
2 changes: 0 additions & 2 deletions tests/modules/dns/examples/peering-zone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ values:

counts:
google_dns_managed_zone: 1

outputs: {}
5 changes: 0 additions & 5 deletions tests/modules/dns/examples/public-zone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ values:
type: A

counts:
google_dns_keys: 1
google_dns_managed_zone: 1
google_dns_record_set: 1
google_dns_managed_zone_iam_binding: 1
modules: 1
resources: 4

outputs: {}
2 changes: 0 additions & 2 deletions tests/modules/dns/examples/reverse-zone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ values:

counts:
google_dns_managed_zone: 1

outputs: {}
Loading