1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
provider "google" {
version = "~> 1.20.0"
}
resource "google_compute_instance" "tagged" {
count = 2
name = "tf-discover-${count.index}"
machine_type = "f1-micro"
tags = ["consul-server"]
boot_disk {
initialize_params {
image = "ubuntu-os-cloud/ubuntu-1404-trusty-v20160602"
}
}
network_interface {
network = "default"
access_config {
# Ephemeral
}
}
service_account {
scopes = ["https://www.googleapis.com/auth/compute.readonly"]
}
}
resource "google_compute_instance" "untagged" {
name = "tf-discover-untagged"
machine_type = "f1-micro"
tags = ["consul-not-matching"]
boot_disk {
initialize_params {
image = "ubuntu-os-cloud/ubuntu-1404-trusty-v20160602"
}
}
network_interface {
network = "default"
access_config {
# Ephemeral
}
}
service_account {
scopes = ["https://www.googleapis.com/auth/compute.readonly"]
}
}
|