Skip to content

Commit

Permalink
Added:labels as an argument and variable
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantin-recurly committed Oct 20, 2020
1 parent 7fe4983 commit 1adbb18
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ Functional examples are included in the [examples](./examples/) directory.
|------|-------------|:----:|:-----:|:-----:|
| default\_key\_specs\_key | Object containing default key signing specifications : algorithm, key_length, key_type, kind. Please see https://www.terraform.io/docs/providers/google/r/dns_managed_zone.html#dnssec_config for futhers details | any | `<map>` | no |
| default\_key\_specs\_zone | Object containing default zone signing specifications : algorithm, key_length, key_type, kind. Please see https://www.terraform.io/docs/providers/google/r/dns_managed_zone.html#dnssec_config for futhers details | any | `<map>` | no |
| description | domain description ( shown in console ) | string | `"domain managed by Terraform"` | no |
| description | zone description (shown in console) | string | `"Managed by Terraform"` | no |
| dnssec\_config | Object containing : kind, non_existence, state. Please see https://www.terraform.io/docs/providers/google/r/dns_managed_zone.html#dnssec_config for futhers details | any | `<map>` | no |
| domain | Zone domain, must end with a period. | string | n/a | yes |
| labels | A set of key/value label pairs to assign to this ManagedZone | map | `<map>` | no |
| name | Zone name, must be unique within the project. | string | n/a | yes |
| private\_visibility\_config\_networks | List of VPC self links that can see this zone. | list(string) | `<list>` | no |
| project\_id | Project id for the zone. | string | n/a | yes |
Expand Down
1 change: 1 addition & 0 deletions examples/forwarding-zone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module "dns-forwarding-zone" {
type = "forwarding"
name = var.name
domain = var.domain
labels = var.labels

private_visibility_config_networks = [var.network_self_link]
target_name_server_addresses = ["8.8.8.8", "8.8.4.4"]
Expand Down
9 changes: 9 additions & 0 deletions examples/forwarding-zone/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,12 @@ variable "domain" {
description = "Zone domain."
default = "foo.local."
}

variable "labels" {
type = map
description = "A set of key/value label pairs to assign to this ManagedZone"
default = {
owner = "foo"
version = "bar"
}
}
1 change: 1 addition & 0 deletions examples/peering-zone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ module "dns-peering-zone" {
domain = var.domain
private_visibility_config_networks = [var.network_self_link]
target_network = var.target_network_self_link
labels = var.labels
}
9 changes: 9 additions & 0 deletions examples/peering-zone/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,12 @@ variable "domain" {
description = "Zone domain."
default = "foo.local."
}

variable "labels" {
type = map
description = "A set of key/value label pairs to assign to this ManagedZone"
default = {
owner = "foo"
version = "bar"
}
}
1 change: 1 addition & 0 deletions examples/private-zone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module "dns-private-zone" {
type = "private"
name = var.name
domain = var.domain
labels = var.labels

private_visibility_config_networks = var.network_self_links

Expand Down
9 changes: 9 additions & 0 deletions examples/private-zone/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,12 @@ variable "domain" {
description = "Zone domain."
default = "foo.local."
}

variable "labels" {
type = map
description = "A set of key/value label pairs to assign to this ManagedZone"
default = {
owner = "foo"
version = "bar"
}
}
1 change: 1 addition & 0 deletions examples/public-zone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module "dns-public-zone" {
type = "public"
name = var.name
domain = var.domain
labels = var.labels

recordsets = [
{
Expand Down
9 changes: 9 additions & 0 deletions examples/public-zone/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@ variable "domain" {
description = "Zone domain."
default = "foo.example-invalid.org."
}

variable "labels" {
type = map
description = "A set of key/value label pairs to assign to this ManagedZone"
default = {
owner = "foo"
version = "bar"
}
}
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ resource "google_dns_managed_zone" "peering" {
name = var.name
dns_name = var.domain
description = var.description
labels = var.labels
visibility = "private"

private_visibility_config {
Expand All @@ -50,6 +51,7 @@ resource "google_dns_managed_zone" "forwarding" {
name = var.name
dns_name = var.domain
description = var.description
labels = var.labels
visibility = "private"

private_visibility_config {
Expand Down Expand Up @@ -77,6 +79,7 @@ resource "google_dns_managed_zone" "private" {
name = var.name
dns_name = var.domain
description = var.description
labels = var.labels
visibility = "private"

private_visibility_config {
Expand All @@ -95,6 +98,7 @@ resource "google_dns_managed_zone" "public" {
name = var.name
dns_name = var.domain
description = var.description
labels = var.labels
visibility = "public"

dynamic "dnssec_config" {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ variable "dnssec_config" {
default = {}
}

variable "labels" {
type = map
description = "A set of key/value label pairs to assign to this ManagedZone"
default = {}
}

variable "default_key_specs_key" {
description = "Object containing default key signing specifications : algorithm, key_length, key_type, kind. Please see https://www.terraform.io/docs/providers/google/r/dns_managed_zone.html#dnssec_config for futhers details"
type = any
Expand Down

0 comments on commit 1adbb18

Please sign in to comment.