-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimport-exercise.tf
57 lines (53 loc) · 1.56 KB
/
import-exercise.tf
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
54
55
56
57
# 3.2 Descomentar apenas quando for pedido
#resource "google_compute_network" "imported" {
# name = "${random_pet.this.id}-vpc"
# auto_create_subnetworks = false
#}
# 3.2 Descomentar apenas quando for pedido
#resource "google_compute_subnetwork" "imported" {
# name = "${random_pet.this.id}-subnet"
# region = var.region
# ip_cidr_range = "10.0.0.0/9"
# network = google_compute_network.imported.id
#}
# 3.3 Descomentar apenas quando for pedido
#resource "google_compute_firewall" "imported_iap" {
# name = "${random_pet.this.id}-fw-iap"
# network = google_compute_network.imported.name
# description = "Allow Ingress From iap for SSH and RDP"
# source_ranges = ["35.235.240.0/20"]
#
# allow {
# protocol = "tcp"
# ports = ["22", "3389"]
# }
# target_tags = ["allow-iap"]
#}
#resource "google_compute_instance" "vm2" {
# name = "${random_pet.this.id}-vm2"
# machine_type = "g1-small"
# zone = "${var.region}-b"
# tags = [ "allow-iap" ]
#
# boot_disk {
# initialize_params {
# image = "debian-cloud/debian-9"
# }
# }
#
# network_interface {
# subnetwork = google_compute_subnetwork.imported.self_link
# }
#
# # se virem isto, avisem-me que eu explico porque 😎
# depends_on = [
# google_compute_firewall.imported_iap
# ]
#}
#
#output "vm2" {
# value = {
# vm_name = google_compute_instance.vm2.name
# gcloud_cmd = "gcloud compute ssh ${google_compute_instance.vm2.name} --project=${google_compute_instance.vm2.project} --zone ${google_compute_instance.vm2.zone}"
# }
#}