Skip to content

Instantly share code, notes, and snippets.

@Videl
Created July 21, 2019 16:09
Show Gist options
  • Save Videl/e5f1821323cef766ae23af512991347e to your computer and use it in GitHub Desktop.
Save Videl/e5f1821323cef766ae23af512991347e to your computer and use it in GitHub Desktop.
provider "google" {
credentials = "${file("account.json")}"
project = "#####fill it out#####"
region = "europe-west1"
zone = "europe-west1-b"
}
resource "google_compute_firewall" "tsm-allow-dns" {
name = "firewall-dns"
network = "${google_compute_network.default.name}"
allow {
protocol = "tcp"
ports = ["53", "22"]
}
allow {
protocol = "udp"
ports = ["53"]
}
#source_tags = ["dns", "ssh"]
}
resource "google_compute_network" "default" {
name = "dns-network"
}
resource "google_compute_instance" "vm_instance" {
name = "coredns-config-test"
machine_type = "f1-micro"
boot_disk {
initialize_params {
image = "debian-cloud/debian-9"
}
}
network_interface {
# A default network is created for all GCP projects
network = "${google_compute_network.default.name}"
#network = "default"
access_config {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment