» google_game_services_game_server_config

A game server config resource. Configs are global and immutable.

To get more information about GameServerConfig, see:

» Example Usage - Game Service Config Basic

resource "google_game_services_game_server_deployment" "default" {
  provider = google-beta

  deployment_id  = "tf-test-deployment"
  description = "a deployment description"

resource "google_game_services_game_server_config" "default" {
  provider = google-beta

  config_id     = "tf-test-config"
  deployment_id = google_game_services_game_server_deployment.default.deployment_id
  description   = "a config description"

  fleet_configs {
    name       = "something-unique"
    fleet_spec = jsonencode({ "replicas" : 1, "scheduling" : "Packed", "template" : { "metadata" : { "name" : "tf-test-game-server-template" }, "spec" : { "template" : { "spec" : { "containers" : [{ "name" : "simple-udp-server", "image" : "gcr.io/agones-images/udp-server:0.14" }] } } } } })

  scaling_configs {
    name = "scaling-config-name"
    fleet_autoscaler_spec = jsonencode({"policy": {"type": "Webhook","webhook": {"service": {"name": "autoscaler-webhook-service","namespace": "default","path": "scale"}}}})
    selectors {
      labels = {
        "one" : "two"

    schedules {
      cron_job_duration = "3.500s"
      cron_spec         = "0 0 * * 0"

» Argument Reference

The following arguments are supported:

  • config_id - (Required) A unique id for the deployment config.

  • deployment_id - (Required) A unique id for the deployment.

  • fleet_configs - (Required) The fleet config contains list of fleet specs. In the Single Cloud, there will be only one. Structure is documented below.

The fleet_configs block supports:

  • fleet_spec - (Required) The fleet spec, which is sent to Agones to configure fleet. The spec can be passed as inline json but it is recommended to use a file reference instead. File references can contain the json or yaml format of the fleet spec. Eg:

    • fleet_spec = jsonencode(yamldecode(file("fleet_configs.yaml")))
    • fleet_spec = file("fleet_configs.json") The format of the spec can be found : https://agones.dev/site/docs/reference/fleet/.
  • name - (Required) The name of the FleetConfig.

  • location - (Optional) Location of the Deployment.

  • description - (Optional) The description of the game server config.

  • labels - (Optional) The labels associated with this game server config. Each label is a key-value pair.

  • scaling_configs - (Optional) Optional. This contains the autoscaling settings. Structure is documented below.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

The scaling_configs block supports:

  • name - (Required) The name of the ScalingConfig

  • fleet_autoscaler_spec - (Required) Fleet autoscaler spec, which is sent to Agones. Example spec can be found : https://agones.dev/site/docs/reference/fleetautoscaler/

  • selectors - (Optional) Labels used to identify the clusters to which this scaling config applies. A cluster is subject to this scaling config if its labels match any of the selector entries. Structure is documented below.

  • schedules - (Optional) The schedules to which this scaling config applies. Structure is documented below.

The selectors block supports:

  • labels - (Optional) Set of labels to group by.

The schedules block supports:

  • start_time - (Optional) The start time of the event. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

  • end_time - (Optional) The end time of the event. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

  • cron_job_duration - (Optional) The duration for the cron job event. The duration of the event is effective after the cron job's start time. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

  • cron_spec - (Optional) The cron definition of the scheduled event. See https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as defined by the realm.

» Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{{project}}/locations/{{location}}/gameServerDeployments/{{deployment_id}}/configs/{{config_id}}

  • name - The resource name of the game server config, in the form: projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}/configs/{config_id}.

» Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 4 minutes.
  • delete - Default is 4 minutes.

» Import

GameServerConfig can be imported using any of these accepted formats:

$ terraform import -provider=google-beta google_game_services_game_server_config.default projects/{{project}}/locations/{{location}}/gameServerDeployments/{{deployment_id}}/configs/{{name}}
$ terraform import -provider=google-beta google_game_services_game_server_config.default {{project}}/{{location}}/{{deployment_id}}/{{name}}
$ terraform import -provider=google-beta google_game_services_game_server_config.default {{location}}/{{deployment_id}}/{{name}}

» User Project Overrides

This resource supports User Project Overrides.