Deleting a config

This page explains how to delete a Game Servers config.

Before you begin

Before you start, we recommend you familiarize yourself with key concepts in the Game Servers Overview. Make sure you have also performed the following tasks:

  • Ensure that you have enabled the Game Services API.
  • Enable Game Services API
  • Either choose a shell with gcloud CLI installed, or use an API client:
  • Cloud Shell

    To launch Cloud Shell, perform the following steps:

    1. Go to Google Cloud console.

      Google Cloud console

    2. From the upper-right corner of the console, click the Activate Cloud Shell button:

    A Cloud Shell session opens inside a frame lower on the console. You use this shell to run gcloud commands.

    Local shell

    Install the gcloud CLI.

    Verify that you have set desired default project for Google Cloud CLI (otherwise you need to specify flag --project explicitly for each command later):

    gcloud config list project

    If not you can run the following command to set a default project, replacing PROJECT_ID with your desired project ID :

    gcloud config set project PROJECT_ID

    Run the following command to verify your version of the Google Cloud CLI. Game Servers requires version 306.0.0 or higher of the gcloud CLI.

    gcloud version

    To update your installation, run the following command:

    gcloud components update

    curl / PowerShell

    To use the REST API with curl or Windows PowerShell, do the following:

    1. Create a service account.
    2. Download a private key as a JSON file.
    3. Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file that contains your service account key. This variable only applies to your current shell session, so if you open a new session, set the variable again.

    Client Library

    Google Cloud Game Servers can be controlled programmatically using a client library. See Client Libraries Overview for instructions on using the library and authenticating.

Deleting a config


  1. In the Google Cloud console, go to the Game Server Deployments page.

    Go to Game Servers

  2. Find a deployment in the table. In the last table column, click the ellipses and select List configs. You can view the active and inactive configs for the deployment from this page.

    You cannot delete an active config. To deactivate a config, click Manage Rollout and select another config for the rollout (see Updating a rollout's default config).

  3. In the Inactive configs table, find the config to delete. In the last table column, click the ellipses and select Remove config.


You can delete a Game Servers config using the Google Cloud CLI.

To delete a config:

  1. Run the following command and replace the placeholder values, such as configID and deploymentID, with appropriate values:

    gcloud game servers configs delete configID --deployment=deploymentID

The variable placeholders correspond to the following descriptions:

  • configID is the unique identifier that you specified for this config.
  • deploymentID is the unique identifier that you specified for the parent deployment.


Before using any of the request data, make the following replacements:

  • PROJECT_ID: your Google Cloud project ID listed in the IAM Settings
  • DEPLOYMENT_ID: the user-defined identifier for the deployment
  • CONFIG_ID: the user-defined identifier for the config

To send your request, expand one of these options:

You should receive a JSON response similar to the following:

  "name": "projects/PROJECT_ID/locations/global/operations/OPERATION_ID",
  "metadata": {
    "@type": "",
    "createTime": CREATE_TIME,
    "target": "projects/PROJECT_ID/locations/global/gameServerDeployments/DEPLOYMENT_ID/configs/CONFIG_ID",
    "verb": "delete",
    "requestedCancellation": false,
    "apiVersion": "v1"
  "done": false


To learn how to install and use the client library for Game Servers, see Game Servers client libraries.

using Google.Cloud.Gaming.V1;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;

public class DeleteConfigSample
    public void DeleteConfig(
        string projectId, string regionId, string deploymentId, string configId)
        // Create the client.
        GameServerConfigsServiceClient client = GameServerConfigsServiceClient.Create();

        DeleteGameServerConfigRequest request = new DeleteGameServerConfigRequest
            GameServerConfigName = GameServerConfigName.FromProjectLocationDeploymentConfig(projectId, regionId, deploymentId, configId)

        // Make the request.
        Operation<Empty, OperationMetadata> response = client.DeleteGameServerConfig(request);

        // Poll until the returned long-running operation is complete.


To learn how to install and use the client library for Game Servers, see Game Servers client libraries.

import (

	gaming ""
	gamingpb ""

// deleteGameServerConfig deletes a game server config.
func deleteGameServerConfig(w io.Writer, projectID, deploymentID, configID string) error {
	// projectID := "my-project"
	// deploymentID := "mydeployment"
	// configID := "myconfig"
	ctx := context.Background()
	client, err := gaming.NewGameServerConfigsClient(ctx)
	if err != nil {
		return fmt.Errorf("NewGameServerConfigsClient: %v", err)
	defer client.Close()

	req := &gamingpb.DeleteGameServerConfigRequest{
		Name: fmt.Sprintf("projects/%s/locations/global/gameServerDeployments/%s/configs/%s", projectID, deploymentID, configID),

	op, err := client.DeleteGameServerConfig(ctx, req)
	if err != nil {
		return fmt.Errorf("DeleteGameServerConfig: %v", err)
	err = op.Wait(ctx)
	if err != nil {
		return fmt.Errorf("Wait: %v", err)

	fmt.Fprintf(w, "Config deleted.")
	return nil


To learn how to install and use the client library for Game Servers, see Game Servers client libraries.

const {
} = require('@google-cloud/game-servers');

const client = new GameServerConfigsServiceClient();

async function deleteGameServerConfig() {
   * TODO(developer): Uncomment these variables before running the sample.
  // const projectId = 'Your Google Cloud Project ID';
  // const deploymentId = 'A unique ID for the Game Server Deployment';
  // const configId = 'A unique ID for the Game Server Config';
  const request = {
    // The full resource name
    name: client.gameServerConfigPath(

  const [operation] = await client.deleteGameServerConfig(request);
  await operation.promise();
  console.log(`Config with name ${} deleted.`);



To learn how to install and use the client library for Game Servers, see Game Servers client libraries.

def delete_config(project_id, deployment_id, config_id):
    """Deletes a game server config."""

    client = gaming.GameServerConfigsServiceClient()

    # Location is hard coded as global, as game server configs can
    # only be created in global.  This is done for all operations on
    # game server configs.
    request = game_server_configs.DeleteGameServerConfigRequest(

    operation = client.delete_game_server_config(request)
    print(f"Delete config operation: {}")

Verifying that your config has been deleted

Verify that you successfully deleted the config by listing your configs using the Google Cloud CLI.

To list all configs, run the following command:

gcloud game servers configs list

To list all configs in a deployment, run the following command and replace deploymentID with the parent deployment.

gcloud game servers configs list --deployment=deploymentID

Your deleted config no longer appears in the output of the command.

What's next

Learn about key concepts in the Game Servers overview.