devops-exercises/topics/gcp/exercises/instance_101/main.tf

21 lines
557 B
Terraform
Raw Normal View History

2022-10-23 12:02:53 +02:00
resource "google_compute_network" "vpc_network" {
name = "my-custom-mode-network"
auto_create_subnetworks = false
mtu = 1460
}
resource "google_compute_subnetwork" "default" {
name = "my-custom-subnet"
ip_cidr_range = "10.0.1.0/24"
region = "us-west1"
network = google_compute_network.vpc_network.id
}
resource "google_compute_instance" "default" {
name = "instance-1"
machine_type = "e2-micro"
zone = "us-west1-a"
labels = {
app = "db"
}
}