mirror of
https://github.com/ghndrx/GSP662.git
synced 2026-02-10 06:54:58 +00:00
.
This commit is contained in:
@@ -1,23 +1,29 @@
|
|||||||
# modules/backend/main.tf
|
provider "google" {
|
||||||
|
|
||||||
module "network" {
|
|
||||||
source = "../network"
|
|
||||||
project = var.project_id
|
project = var.project_id
|
||||||
|
region = var.region
|
||||||
|
}
|
||||||
|
|
||||||
|
data "google_compute_image" "debian" {
|
||||||
|
family = "debian-10"
|
||||||
|
project = "debian-cloud"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "google_compute_instance" "backend" {
|
resource "google_compute_instance" "backend" {
|
||||||
name = "backend"
|
name = "backend"
|
||||||
machine_type = "f1-micro"
|
machine_type = "e2-small"
|
||||||
zone = "${var.region}-f"
|
zone = var.region
|
||||||
|
|
||||||
boot_disk {
|
boot_disk {
|
||||||
initialize_params {
|
initialize_params {
|
||||||
image = "debian-cloud/debian-9"
|
image = data.google_compute_image.debian.self_link
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
network_interface {
|
network_interface {
|
||||||
network = module.network.network_name
|
subnetwork = module.network.subnet_name
|
||||||
|
access_config {
|
||||||
|
// Include this section to give the VM an external ip address
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
metadata_startup_script = module.network.startup_script
|
metadata_startup_script = module.network.startup_script
|
||||||
|
|||||||
Reference in New Issue
Block a user