gcloud beta spanner instance-configs create Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud beta spanner instance-configs create - create a Cloud Spanner instance configuration
- SYNOPSIS
gcloud beta spanner instance-configs createINSTANCE_CONFIG(--base-config=BASE_CONFIG--replicas=location=LOCATION,type=TYPE:[…] | [--clone-config=INSTANCE_CONFIG:--add-replicas=location=LOCATION,type=TYPE:[…]--skip-replicas=location=LOCATION,type=TYPE:[…]])[--async][--display-name=DISPLAY_NAME][--etag=ETAG][--labels=[KEY=VALUE,…]][--validate-only][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(BETA)Create a Cloud Spanner instance configuration.- EXAMPLES
- To create a custom Cloud Spanner instance configuration based on an existingGoogle-managed configuration (
nam3) by adding aREAD_ONLYtype replica in locationus-east4, run:gcloudbetaspannerinstance-configscreatecustom-instance-config--clone-config=nam3--add-replicas=location=us-east4,type=READ_ONLYTo create a custom Cloud Spanner instance configuration based on another customconfiguration (
custom-instance-config) by adding aREAD_ONLYtype replica in locationus-east1andremoving aREAD_ONLYtype replica in locationus-east4, run:gcloudbetaspannerinstance-configscreatecustom-instance-config1--clone-config=custom-instance-config--add-replicas=location=us-east1,type=READ_ONLY--skip-replicas=location=us-east4,type=READ_ONLY - POSITIONAL ARGUMENTS
INSTANCE_CONFIG- Cloud Spanner instance configuration. The 'custom-' prefix is required to avoidname conflicts with Google-managed configurations.
- REQUIRED FLAGS
- Exactly one of these must be specified:
- Command-line flags to setup a custom instance configuration replicas:
--base-config=BASE_CONFIG- The name of the Google-managed instance configuration, based on which yourcustom configuration is created.
This flag argument must be specified if any of the other arguments in this groupare specified.
--replicas=location=LOCATION,type=TYPE:[…]- The geographic placement of nodes in this instance configuration and theirreplication types.
location- The location of the serving resources, e.g. "us-central1".
type- The type of replica.
Items in the list are separated by ":". The allowed values and formats are asfollows.
READ_ONLY- Read-only replicas only support reads (not writes). Read-only replicas:
- Maintain a full copy of your data.
- Serve reads.
- Do not participate in voting to commit writes.
- Are not eligible to become a leader.
READ_WRITE- Read-write replicas support both reads and writes. These replicas:
- Maintain a full copy of your data.
- Serve reads.
- Can vote whether to commit a write.
- Participate in leadership election.
- Are eligible to become a leader.
WITNESS- Witness replicas don't support reads but do participate in voting to commitwrites. Witness replicas:
- Do not maintain a full copy of data.
- Do not serve reads.
- Vote whether to commit writes.
- Participate in leader election but are not eligible to become leader.
This flag argument must be specified if any of the other arguments in this groupare specified.
- Command-line flags to setup a custom instance configuration using clone options:
--clone-config=INSTANCE_CONFIG- The ID of the instance config, based on which this configuration is created. Theclone is an independent copy of this config. Available configurations can befound by running "gcloud spanner instance-configs list"
This flag argument must be specified if any of the other arguments in this groupare specified.
--add-replicas=location=LOCATION,type=TYPE:[…]- Add new replicas while cloning from the source config.
--skip-replicas=location=LOCATION,type=TYPE:[…]- Skip replicas from the source config while cloning. Each replica in the listmust exist in the source config replicas list.
- Command-line flags to setup a custom instance configuration replicas:
- Exactly one of these must be specified:
- OPTIONAL FLAGS
--async- Return immediately, without waiting for the operation in progress to complete.
--display-name=DISPLAY_NAME- The name of this instance configuration as it appears in UIs. Must specify thisoption if creating an instance-config with --replicas.
--etag=ETAG- Used for optimistic concurrency control.
--labels=[KEY=VALUE,…]- List of label KEY=VALUE pairs to add.
Keys must start with a lowercase character and contain only hyphens(
-), underscores (_), lowercase characters, andnumbers. Values must contain only hyphens (-), underscores(_), lowercase characters, and numbers. --validate-only- If specified, validate that the creation will succeed without creating theinstance configuration.
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - NOTES
- This command is currently in beta and might change without notice. Thesevariants are also available:
gcloudspannerinstance-configscreategcloudalphaspannerinstance-configscreate
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-07 UTC.