agones.dev/agones@v1.53.0/build/terraform/e2e/gke-standard/module.tf (about)

     1  // Copyright 2023 Google LLC All Rights Reserved.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  
    16  // Run:
    17  //  terraform apply -var project="<YOUR_GCP_ProjectID>"
    18  
    19  terraform {
    20    required_version = ">= 1.0.0"
    21    required_providers {
    22      google = {
    23        source  = "hashicorp/google"
    24        version = "~> 4.25.0"
    25      }
    26      helm = {
    27        source  = "hashicorp/helm"
    28        version = "~> 2.3"
    29      }
    30    }
    31  }
    32  
    33  variable "project" {}
    34  variable "kubernetesVersion" {}
    35  variable "location" {}
    36  variable "releaseChannel" {}
    37  
    38  variable "machineType" {
    39    default = "e2-standard-4"
    40  }
    41  
    42  variable "initialNodeCount" {
    43    default = 10
    44  }
    45  
    46  variable "overrideName" {
    47    default = ""
    48  }
    49  
    50  module "gke_cluster" {
    51    source = "../../../../install/terraform/modules/gke"
    52  
    53    cluster = {
    54      "name"                          = var.overrideName != "" ? var.overrideName : format("standard-e2e-test-cluster-%s", replace(var.kubernetesVersion, ".", "-"))
    55      "location"                      = var.location
    56      "releaseChannel"                = var.releaseChannel
    57      "machineType"                   = var.machineType
    58      "initialNodeCount"              = var.initialNodeCount
    59      "enableImageStreaming"          = true
    60      "project"                       = var.project
    61      "kubernetesVersion"             = var.kubernetesVersion
    62      "maintenanceExclusionStartTime" = timestamp()
    63      "maintenanceExclusionEndTime"   = timeadd(timestamp(), "2640h") # 110 days
    64    }
    65  
    66    udpFirewall = false // firewall is created at the project module level
    67  }