Skip to content

Commit

Permalink
Gcp cloud dns (#128)
Browse files Browse the repository at this point in the history
* Added example for Cloud DNS private managed zone

* terraform fmt whitespace fix

* Added google_dns_managed_zone to index

* made sh scripts executable

* updated dns - separate private and public examples

* whitespace fix

* made scripts executable
  • Loading branch information
melihc1 authored Jan 12, 2022
1 parent d8dca59 commit 2800f45
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 0 deletions.
1 change: 1 addition & 0 deletions INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
| `google_compute_instance` | [google, gcp_instance](google/google_compute_instance/simple) |
| `google_compute_network` | [google](google/google_compute_network/simple) |
| `google_container_cluster` | [google, GKE](google/google_container_cluster/simple) <p/> [separate_node_pool](google/google_container_cluster/separate_node_pool) <p/> [cluster_and_deployment](google/google_container_cluster/cluster_and_deployment) <p/> [vpc_native_cluster](google/google_container_cluster/vpc_native_cluster) <p/> [autopilot](google/google_container_cluster/autopilot) |
| `google_dns_managed_zone` | [google, public](google/google_dns_managed_zone/public) <p/> [private](google/google_dns_managed_zone/private) |
| `google_storage_bucket` | [google, gcs_bucket](google/google_storage_bucket/simple) |
| `helm_release` | [simple](helm/helm_release/simple) <p/> [values_from_file](helm/helm_release/values_from_file) |
| `inline` | [aws, remote-exec](aws/aws_instance/remote-exec/inline/) |
Expand Down
2 changes: 2 additions & 0 deletions google/google_dns_managed_zone/private/destroy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
../../../bin/destroy.sh google
32 changes: 32 additions & 0 deletions google/google_dns_managed_zone/private/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Summary: Creates a private DNS managed zone

# Documentation: https://www.terraform.io/docs/language/settings/index.html
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = "~> 3.0"
}
}
}

# Documentation: https://www.terraform.io/docs/language/providers/requirements.html
provider "google" {
project = var.project_id
region = "us-central1"
zone = "us-central1-a"
}

# Documentation: https://www.terraform.io/docs/language/values/variables.html
variable "project_id" {
type = string
}

# DNS Managed Zone
# Documentation: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/dns_managed_zone
resource "google_dns_managed_zone" "changeme_private_zone" {
name = "changeme-private-zone"
dns_name = "changeme-private-zone.com."
visibility = "private"
}
2 changes: 2 additions & 0 deletions google/google_dns_managed_zone/private/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
../../../bin/apply.sh google
2 changes: 2 additions & 0 deletions google/google_dns_managed_zone/public/destroy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
../../../bin/destroy.sh google
31 changes: 31 additions & 0 deletions google/google_dns_managed_zone/public/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Summary: Creates a public DNS managed zone

# Documentation: https://www.terraform.io/docs/language/settings/index.html
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = "~> 3.0"
}
}
}

# Documentation: https://www.terraform.io/docs/language/providers/requirements.html
provider "google" {
project = var.project_id
region = "us-central1"
zone = "us-central1-a"
}

# Documentation: https://www.terraform.io/docs/language/values/variables.html
variable "project_id" {
type = string
}

# DNS Managed Zone
# Documentation: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/dns_managed_zone
resource "google_dns_managed_zone" "changeme_public_zone" {
name = "changeme-public-zone"
dns_name = "changeme-public-zone.com."
}
2 changes: 2 additions & 0 deletions google/google_dns_managed_zone/public/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
../../../bin/apply.sh google

0 comments on commit 2800f45

Please sign in to comment.