-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
1dede68
commit d405b65
Showing
17 changed files
with
425 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Table: gcp_dns_managed_zone | ||
|
||
A DNS zone is used to host the DNS records for a particular domain. To start hosting your domain in Azure DNS, you need to create a DNS zone for that domain name. Each DNS record for your domain is then created inside this DNS zone. | ||
|
||
## Examples | ||
|
||
### Basic info | ||
|
||
```sql | ||
select | ||
name, | ||
id, | ||
dns_name, | ||
creation_time, | ||
visibility | ||
from | ||
gcp_dns_managed_zone; | ||
``` | ||
|
||
### List public zones with DNSSEC disabled | ||
|
||
```sql | ||
select | ||
name, | ||
id, | ||
dns_name, | ||
dnssec_config_state, | ||
visibility | ||
from | ||
gcp_dns_managed_zone | ||
where | ||
visibility = 'public' | ||
and dnssec_config_state <> 'on'; | ||
``` |
Empty file.
21 changes: 21 additions & 0 deletions
21
gcp-test/tests/gcp_dns_managed_zone/test-get-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[ | ||
{ | ||
"description": "Test managed zone to validate the table outcome.", | ||
"dns_name": "turbot.com.", | ||
"kind": "dns#managedZone", | ||
"labels": { | ||
"name": "{{ resourceName }}" | ||
}, | ||
"location": "global", | ||
"name": "{{ resourceName }}", | ||
"name_servers": ["ns-gcp-private.googledomains.com."], | ||
"private_visibility_config_networks": [ | ||
{ | ||
"kind": "dns#managedZonePrivateVisibilityConfigNetwork", | ||
"networkUrl": "{{ output.network.value }}" | ||
} | ||
], | ||
"project": "{{ output.project_id.value }}", | ||
"visibility": "private" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select name, dns_name, description, kind, visibility, private_visibility_config_networks, labels, name_servers, location, project | ||
from gcp.gcp_dns_managed_zone | ||
where name = '{{ resourceName }}'; |
1 change: 1 addition & 0 deletions
1
gcp-test/tests/gcp_dns_managed_zone/test-invalid-name-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
null |
3 changes: 3 additions & 0 deletions
3
gcp-test/tests/gcp_dns_managed_zone/test-invalid-name-query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select name, id, description | ||
from gcp.gcp_dns_managed_zone | ||
where name = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
{ | ||
"description": "Test managed zone to validate the table outcome.", | ||
"name": "{{ resourceName }}" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select name, description | ||
from gcp.gcp_dns_managed_zone | ||
where akas::text = '["{{ output.resource_aka.value }}"]'; |
1 change: 1 addition & 0 deletions
1
gcp-test/tests/gcp_dns_managed_zone/test-not-found-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select name, id, kind, description | ||
from gcp.gcp_dns_managed_zone | ||
where name = 'dummy-{{ resourceName }}' |
9 changes: 9 additions & 0 deletions
9
gcp-test/tests/gcp_dns_managed_zone/test-turbot-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ | ||
{ | ||
"akas": ["{{ output.resource_aka.value }}"], | ||
"tags": { | ||
"name": "{{ resourceName }}" | ||
}, | ||
"title": "{{ resourceName }}" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select title, tags, akas | ||
from gcp.gcp_dns_managed_zone | ||
where name = '{{ resourceName }}'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
|
||
variable "resource_name" { | ||
type = string | ||
default = "turbot-test-20200125-create-update" | ||
description = "Name of the resource used throughout the test." | ||
} | ||
|
||
variable "gcp_project" { | ||
type = string | ||
default = "niteowl-aaa" | ||
description = "GCP project used for the test." | ||
} | ||
|
||
variable "gcp_region" { | ||
type = string | ||
default = "us-east1" | ||
description = "GCP region used for the test." | ||
} | ||
|
||
variable "gcp_zone" { | ||
type = string | ||
default = "us-east1-b" | ||
} | ||
|
||
provider "google" { | ||
project = var.gcp_project | ||
region = var.gcp_region | ||
zone = var.gcp_zone | ||
} | ||
|
||
data "google_client_config" "current" {} | ||
|
||
data "null_data_source" "resource" { | ||
inputs = { | ||
scope = "gcp://cloudresourcemanager.googleapis.com/projects/${data.google_client_config.current.project}" | ||
} | ||
} | ||
|
||
resource "google_dns_managed_zone" "named_test_resource" { | ||
name = var.resource_name | ||
dns_name = "turbot.com." | ||
description = "Test managed zone to validate the table outcome." | ||
labels = { | ||
name = var.resource_name | ||
} | ||
|
||
visibility = "private" | ||
|
||
private_visibility_config { | ||
networks { | ||
network_url = google_compute_network.named_test_resource.id | ||
} | ||
} | ||
} | ||
|
||
resource "google_compute_network" "named_test_resource" { | ||
name = var.resource_name | ||
auto_create_subnetworks = false | ||
} | ||
|
||
output "resource_aka" { | ||
value = "gcp://dns.googleapis.com/${google_dns_managed_zone.named_test_resource.id}" | ||
} | ||
|
||
output "resource_name" { | ||
value = var.resource_name | ||
} | ||
|
||
output "resource_id" { | ||
value = google_dns_managed_zone.named_test_resource.id | ||
} | ||
|
||
output "network" { | ||
value = google_compute_network.named_test_resource.self_link | ||
} | ||
|
||
output "project_id" { | ||
value = var.gcp_project | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.