42 lines
780 B
HCL
42 lines
780 B
HCL
terraform {
|
|
required_providers {
|
|
google = {
|
|
source = "hashicorp/google"
|
|
version = "6.27.0"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "google" {
|
|
# Configuration options
|
|
project = "network-getting-started"
|
|
region = "europe-central2"
|
|
zone = "europe-central2-b"
|
|
}
|
|
|
|
data "google_project" "project" {
|
|
project_id = "network-getting-started"
|
|
}
|
|
|
|
resource "google_compute_instance" "vm_1" {
|
|
name = "tftest-vm"
|
|
machine_type = "e2-micro"
|
|
can_ip_forward = false
|
|
description = "Terraform test instance"
|
|
|
|
boot_disk {
|
|
initialize_params {
|
|
image = "debian-cloud/debian-12"
|
|
}
|
|
}
|
|
|
|
network_interface {
|
|
network = "dom-lab-vpc"
|
|
subnetwork = "pl-hub"
|
|
}
|
|
|
|
metadata = {
|
|
ssh-keys = "${var.ssh[0].public_key} ${var.ssh[0].ssh_user}"
|
|
}
|
|
}
|