Created
July 21, 2019 16:09
-
-
Save Videl/e5f1821323cef766ae23af512991347e to your computer and use it in GitHub Desktop.
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
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