forked from ContainerSolutions/terraform-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
34 lines (29 loc) · 992 Bytes
/
main.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
# Summary: Creates a GKE (Google Kubernetes Engine) Autopilot cluster.
# Documentation: https://www.terraform.io/docs/language/settings/index.html
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = "~> 3.0"
}
}
}
# Documentation: https://www.terraform.io/docs/language/values/variables.html
variable "project_id" {
type = string
}
# Documentation: https://www.terraform.io/docs/language/providers/requirements.html
provider "google" {
project = var.project_id
region = "us-central1"
zone = "us-central1-a"
}
# GKE
# Documentation: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster
resource "google_container_cluster" "changeme_autopilot_cluster" {
name = "changeme-autopilot-cluster"
location = "us-central1"
# Documentation: https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview
enable_autopilot = true
}