Skip to content

Commit

Permalink
Merge pull request #8 from hashicorp/issue-6
Browse files Browse the repository at this point in the history
added option to specify a project for the dns zone
  • Loading branch information
amy-hashi authored Sep 25, 2019
2 parents 5a270d4 + 82e060c commit 6414a02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions primary.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ resource "google_compute_instance" "primary" {

data "google_dns_managed_zone" "dnszone" {
name = "${var.dns_zone}"
project = "${var.dns_project == "" ? var.project : var.dns_project}"
}

resource "google_dns_record_set" "primarydns" {
count = "${var.primary_count}"
name = "${var.prefix}-primary-${count.index}.${data.google_dns_managed_zone.dnszone.dns_name}"
type = "A"
ttl = 300
project = "${var.dns_project == "" ? var.project : var.dns_project}"

managed_zone = "${data.google_dns_managed_zone.dnszone.name}"

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ variable "zone" {
default = "us-central1-a"
}

variable "dns_project" {
type = "string"
description = "Name of project where the DNS zone resides"
default = ""
}

###################################################
# Resources
###################################################
Expand Down

0 comments on commit 6414a02

Please sign in to comment.