agones.dev/agones@v1.53.0/examples/terraform-submodules/aks/module.tf (about)

     1  // Copyright 2019 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 agones_version="1.17.0"]
    18  
    19  terraform {
    20    required_version = ">= 1.0.0"
    21  }
    22  
    23  // Install latest version of agones
    24  variable "agones_version" {
    25    default = ""
    26  }
    27  
    28  variable "client_id" {
    29    default = ""
    30  
    31  }
    32  variable "client_secret" {
    33    default = ""
    34  }
    35  
    36  variable "cluster_name" {
    37    default = "test-cluster"
    38  }
    39  
    40  variable "disk_size" {
    41    default = 30
    42  }
    43  
    44  variable "feature_gates" {
    45    default = ""
    46  }
    47  
    48  variable "log_level" {
    49    default = "info"
    50  }
    51  
    52  variable "machine_type" {
    53    default = "Standard_D2_v2"
    54  }
    55  
    56  variable "node_count" {
    57    default = 4
    58  }
    59  
    60  variable "resource_group_location" {
    61    default = "East US"
    62  }
    63  
    64  variable "resource_group_name" {
    65    default = "agonesRG"
    66  }
    67  
    68  module "aks_cluster" {
    69    // ***************************************************************************************************
    70    // Update ?ref= to the agones release you are installing. For example, ?ref=release-1.17.0 corresponds
    71    // to Agones version 1.17.0
    72    // ***************************************************************************************************
    73    source = "git::https://github.com/googleforgames/agones.git//install/terraform/modules/aks/?ref=main"
    74  
    75    client_id               = var.client_id
    76    client_secret           = var.client_secret
    77    cluster_name            = var.cluster_name
    78    disk_size               = var.disk_size
    79    machine_type            = var.machine_type
    80    node_count              = var.node_count
    81    resource_group_location = var.resource_group_location
    82    resource_group_name     = var.resource_group_name
    83  }
    84  
    85  module "helm_agones" {
    86    // ***************************************************************************************************
    87    // Update ?ref= to the agones release you are installing. For example, ?ref=release-1.17.0 corresponds
    88    // to Agones version 1.17.0
    89    // ***************************************************************************************************
    90    source = "git::https://github.com/googleforgames/agones.git//install/terraform/modules/helm3/?ref=main"
    91  
    92    agones_version         = var.agones_version
    93    cluster_ca_certificate = module.aks_cluster.cluster_ca_certificate
    94    feature_gates          = var.feature_gates
    95    host                   = module.aks_cluster.host
    96    log_level              = var.log_level
    97    token                  = module.aks_cluster.token
    98    values_file            = ""
    99  }
   100  
   101  output "cluster_ca_certificate" {
   102    value = module.aks_cluster.cluster_ca_certificate
   103  }
   104  
   105  output "host" {
   106    value = module.aks_cluster.host
   107  }
   108  
   109  output "token" {
   110    value = module.aks_cluster.token
   111  }