mirror of
https://github.com/ghndrx/tf-variable-demo.git
synced 2026-02-10 06:54:57 +00:00
26 lines
502 B
HCL
26 lines
502 B
HCL
resource "google_compute_instance_template" "template" {
|
|
name_prefix = "instance-template-"
|
|
project = var.project_id
|
|
region = var.region
|
|
|
|
machine_type = var.instance_type
|
|
disk {
|
|
source_image = var.image_name
|
|
auto_delete = true
|
|
boot = true
|
|
}
|
|
|
|
network_interface {
|
|
network = "default"
|
|
access_config {
|
|
// Ephemeral public IP address
|
|
}
|
|
}
|
|
|
|
metadata_startup_script = var.startup_script
|
|
|
|
lifecycle {
|
|
create_before_destroy = true
|
|
}
|
|
|
|
} |