GameServerConfig

class GameServerConfig : KotlinCustomResource

A game server config resource. Configs are global and immutable. To get more information about GameServerConfig, see:

Example Usage

Game Service Config Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.gameservices.GameServerDeployment;
import com.pulumi.gcp.gameservices.GameServerDeploymentArgs;
import com.pulumi.gcp.gameservices.GameServerConfig;
import com.pulumi.gcp.gameservices.GameServerConfigArgs;
import com.pulumi.gcp.gameservices.inputs.GameServerConfigFleetConfigArgs;
import com.pulumi.gcp.gameservices.inputs.GameServerConfigScalingConfigArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var defaultGameServerDeployment = new GameServerDeployment("defaultGameServerDeployment", GameServerDeploymentArgs.builder()
.deploymentId("tf-test-deployment")
.description("a deployment description")
.build());
var defaultGameServerConfig = new GameServerConfig("defaultGameServerConfig", GameServerConfigArgs.builder()
.configId("tf-test-config")
.deploymentId(defaultGameServerDeployment.deploymentId())
.description("a config description")
.fleetConfigs(GameServerConfigFleetConfigArgs.builder()
.name("something-unique")
.fleetSpec(serializeJson(
jsonObject(
jsonProperty("replicas", 1),
jsonProperty("scheduling", "Packed"),
jsonProperty("template", jsonObject(
jsonProperty("metadata", jsonObject(
jsonProperty("name", "tf-test-game-server-template")
)),
jsonProperty("spec", jsonObject(
jsonProperty("ports", jsonArray(jsonObject(
jsonProperty("name", "default"),
jsonProperty("portPolicy", "Dynamic"),
jsonProperty("containerPort", 7654),
jsonProperty("protocol", "UDP")
))),
jsonProperty("template", jsonObject(
jsonProperty("spec", jsonObject(
jsonProperty("containers", jsonArray(jsonObject(
jsonProperty("name", "simple-udp-server"),
jsonProperty("image", "gcr.io/agones-images/udp-server:0.14")
)))
))
))
))
))
)))
.build())
.scalingConfigs(GameServerConfigScalingConfigArgs.builder()
.name("scaling-config-name")
.fleetAutoscalerSpec(serializeJson(
jsonObject(
jsonProperty("policy", jsonObject(
jsonProperty("type", "Webhook"),
jsonProperty("webhook", jsonObject(
jsonProperty("service", jsonObject(
jsonProperty("name", "autoscaler-webhook-service"),
jsonProperty("namespace", "default"),
jsonProperty("path", "scale")
))
))
))
)))
.selectors(GameServerConfigScalingConfigSelectorArgs.builder()
.labels(Map.of("one", "two"))
.build())
.schedules(GameServerConfigScalingConfigScheduleArgs.builder()
.cronJobDuration("3.500s")
.cronSpec("0 0 * * 0")
.build())
.build())
.build());
}
}

Import

GameServerConfig can be imported using any of these accepted formats

$ pulumi import gcp:gameservices/gameServerConfig:GameServerConfig default projects/{{project}}/locations/{{location}}/gameServerDeployments/{{deployment_id}}/configs/{{config_id}}
$ pulumi import gcp:gameservices/gameServerConfig:GameServerConfig default {{project}}/{{location}}/{{deployment_id}}/{{config_id}}
$ pulumi import gcp:gameservices/gameServerConfig:GameServerConfig default {{location}}/{{deployment_id}}/{{config_id}}

Properties

Link copied to clipboard
val configId: Output<String>

A unique id for the deployment config.

Link copied to clipboard
val deploymentId: Output<String>

A unique id for the deployment.

Link copied to clipboard
val description: Output<String>?

The description of the game server config.

Link copied to clipboard

The fleet config contains list of fleet specs. In the Single Cloud, there will be only one. Structure is documented below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val labels: Output<Map<String, String>>?

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

Link copied to clipboard
val location: Output<String>?

Location of the Deployment.

Link copied to clipboard
val name: Output<String>

The name of the FleetConfig.

Link copied to clipboard
val project: Output<String>

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Optional. This contains the autoscaling settings. Structure is documented below.

Link copied to clipboard
val urn: Output<String>