Fix dnssec keys lookup (#1728)

* Fix dnssec keys lookup

* Fix DNS examples

* Fix FAST and blueprints resource counts
This commit is contained in:
Julio Castillo 2023-10-03 21:37:21 +02:00 committed by GitHub
parent 789328ff5a
commit 4b15605711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 30 additions and 37 deletions

View File

@ -128,5 +128,5 @@ module "test1" {
project_create = true project_create = true
project_id = "test" project_id = "test"
} }
# tftest modules=9 resources=28 # tftest modules=9 resources=27
``` ```

View File

@ -51,5 +51,5 @@ module "test" {
shared_vpc_link = "https://www.googleapis.com/compute/v1/projects/test-dns/global/networks/default" shared_vpc_link = "https://www.googleapis.com/compute/v1/projects/test-dns/global/networks/default"
teams = ["team1", "team2"] teams = ["team1", "team2"]
} }
# tftest modules=9 resources=20 # tftest modules=9 resources=16
``` ```

View File

@ -51,5 +51,5 @@ module "test" {
root_node = "organizations/0123456789" root_node = "organizations/0123456789"
} }
# tftest modules=9 resources=56 # tftest modules=9 resources=54
``` ```

View File

@ -40,5 +40,5 @@ module "test" {
} }
project_id = "test-project" project_id = "test-project"
} }
# tftest modules=13 resources=42 # tftest modules=13 resources=41
``` ```

View File

@ -47,7 +47,7 @@ module "test1" {
prefix = "fabric" prefix = "fabric"
root_node = "folders/123456789" root_node = "folders/123456789"
} }
# tftest modules=14 resources=39 # tftest modules=14 resources=38
``` ```
```hcl ```hcl
@ -58,5 +58,5 @@ module "test2" {
prefix = "fabric" prefix = "fabric"
root_node = "folders/123456789" root_node = "folders/123456789"
} }
# tftest modules=12 resources=33 # tftest modules=12 resources=32
``` ```

View File

@ -114,5 +114,5 @@ module "test" {
project_id = "project-1" project_id = "project-1"
} }
# tftest modules=20 resources=84 # tftest modules=20 resources=79
``` ```

View File

@ -45,5 +45,5 @@ module "test" {
} }
project_id = "test-project" project_id = "test-project"
} }
# tftest modules=11 resources=45 # tftest modules=11 resources=44
``` ```

View File

@ -80,5 +80,5 @@ module "test" {
prefix = "test" prefix = "test"
root_node = "organizations/0123456789" root_node = "organizations/0123456789"
} }
# tftest modules=11 resources=46 # tftest modules=11 resources=45
``` ```

View File

@ -252,7 +252,7 @@ module "test" {
prj_onprem_id = "onprem-project-id" prj_onprem_id = "onprem-project-id"
} }
# tftest modules=15 resources=52 # tftest modules=15 resources=50
``` ```
```hcl ```hcl
@ -276,7 +276,7 @@ module "test" {
tf_identity = "user@example.org" tf_identity = "user@example.org"
} }
# tftest modules=15 resources=38 # tftest modules=15 resources=36
``` ```
```hcl ```hcl
@ -295,5 +295,5 @@ module "test" {
custom_domain = "cloud-run-corporate.example.org" custom_domain = "cloud-run-corporate.example.org"
} }
# tftest modules=14 resources=47 # tftest modules=14 resources=45
``` ```

View File

@ -27,7 +27,7 @@ module "private-dns" {
"roles/dns.admin" = ["group:dns-administrators@myorg.com"] "roles/dns.admin" = ["group:dns-administrators@myorg.com"]
} }
} }
# tftest modules=1 resources=5 inventory=private-zone.yaml # tftest modules=1 resources=4 inventory=private-zone.yaml
``` ```
### Forwarding Zone ### Forwarding Zone
@ -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 ### Peering Zone
@ -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 ### Routing Policies
@ -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 ### Reverse Lookup Zone
@ -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 ### Public Zone
@ -137,7 +137,7 @@ module "public-dns" {
"roles/dns.admin" = ["group:dns-administrators@myorg.com"] "roles/dns.admin" = ["group:dns-administrators@myorg.com"]
} }
} }
# tftest modules=1 resources=4 inventory=public-zone.yaml # tftest modules=1 resources=3 inventory=public-zone.yaml
``` ```
<!-- BEGIN TFDOC --> <!-- BEGIN TFDOC -->
## Variables ## Variables

View File

@ -158,7 +158,9 @@ resource "google_dns_managed_zone_iam_binding" "iam_bindings" {
} }
data "google_dns_keys" "dns_keys" { data "google_dns_keys" "dns_keys" {
count = try(var.zone_config.public.dnssec_config, null) != null ? 1 : 0
managed_zone = local.managed_zone.id managed_zone = local.managed_zone.id
project = var.project_id
} }
resource "google_dns_record_set" "dns_record_set" { resource "google_dns_record_set" "dns_record_set" {
@ -193,4 +195,4 @@ resource "google_dns_record_set" "dns_record_set" {
depends_on = [ depends_on = [
google_dns_managed_zone.dns_managed_zone google_dns_managed_zone.dns_managed_zone
] ]
} }

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2022 Google LLC * Copyright 2023 Google LLC
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
output "dns_keys" { output "dns_keys" {
description = "DNSKEY and DS records of DNSSEC-signed managed zones." 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" { output "domain" {

View File

@ -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 --> <!-- BEGIN TFDOC -->

View File

@ -1,4 +1,4 @@
# Copyright 2022 Google LLC # Copyright 2023 Google LLC
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -14,4 +14,4 @@
counts: counts:
modules: 28 modules: 28
resources: 154 resources: 145

View File

@ -14,4 +14,4 @@
counts: counts:
modules: 30 modules: 30
resources: 191 resources: 182

View File

@ -14,4 +14,4 @@
counts: counts:
modules: 42 modules: 42
resources: 201 resources: 192

View File

@ -14,4 +14,4 @@
counts: counts:
modules: 21 modules: 21
resources: 171 resources: 165

View File

@ -14,4 +14,4 @@
counts: counts:
modules: 36 modules: 36
resources: 212 resources: 203

View File

@ -30,5 +30,3 @@ values:
counts: counts:
google_dns_managed_zone: 1 google_dns_managed_zone: 1
outputs: {}

View File

@ -29,11 +29,6 @@ values:
type: A type: A
counts: counts:
google_dns_keys: 1
google_dns_managed_zone: 1 google_dns_managed_zone: 1
google_dns_record_set: 1 google_dns_record_set: 1
google_dns_managed_zone_iam_binding: 1 google_dns_managed_zone_iam_binding: 1
modules: 1
resources: 4
outputs: {}

View File

@ -23,5 +23,3 @@ values:
counts: counts:
google_dns_managed_zone: 1 google_dns_managed_zone: 1
outputs: {}