Game Server Config Args
data class GameServerConfigArgs(val configId: Output<String>? = null, val deploymentId: Output<String>? = null, val description: Output<String>? = null, val fleetConfigs: Output<List<GameServerConfigFleetConfigArgs>>? = null, val labels: Output<Map<String, String>>? = null, val location: Output<String>? = null, val project: Output<String>? = null, val scalingConfigs: Output<List<GameServerConfigScalingConfigArgs>>? = null) : ConvertibleToJava<GameServerConfigArgs>
A game server config resource. Configs are global and immutable. To get more information about GameServerConfig, see:
How-to Guides
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());
}
}
Content copied to clipboard
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}}
Content copied to clipboard
$ pulumi import gcp:gameservices/gameServerConfig:GameServerConfig default {{project}}/{{location}}/{{deployment_id}}/{{config_id}}
Content copied to clipboard
$ pulumi import gcp:gameservices/gameServerConfig:GameServerConfig default {{location}}/{{deployment_id}}/{{config_id}}
Content copied to clipboard
Constructors
Link copied to clipboard
fun GameServerConfigArgs(configId: Output<String>? = null, deploymentId: Output<String>? = null, description: Output<String>? = null, fleetConfigs: Output<List<GameServerConfigFleetConfigArgs>>? = null, labels: Output<Map<String, String>>? = null, location: Output<String>? = null, project: Output<String>? = null, scalingConfigs: Output<List<GameServerConfigScalingConfigArgs>>? = null)