gcloud sql instances create <INSTANCE>

Creates a new Cloud SQL instance

Arguments

NameDescription
INSTANCECloud SQL instance ID

Options

NameDescription
--account <ACCOUNT>Google Cloud Platform user account to use for invocation. Overrides the default *core/account* property value for this command invocation
--activation-policy <ACTIVATION_POLICY>Activation policy for this instance. This specifies when the instance should be activated and is applicable only when the instance state is `RUNNABLE`. The default is `on-demand`. More information on activation policies can be found here: https://cloud.google.com/sql/faq#activation_policy. _ACTIVATION_POLICY_ must be one of: *always*, *never*, *on-demand*
--assign-ipAssign a public IP address to the instance. This is a public, externally available IPv4 address that you can use to connect to your instance when properly authorized. Use --assign-ip to enable a public IP and --no-assign-ip to disable it. Use *--assign-ip* to enable and *--no-assign-ip* to disable
--asyncReturn immediately, without waiting for the operation in progress to complete
--authorized-networks <NETWORK>The list of external networks that are allowed to connect to the instance. Specified in CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24)
--availability-type <AVAILABILITY_TYPE>Specifies level of availability. _AVAILABILITY_TYPE_ must be one of: + *regional*::: Provides high availability and is recommended for production instances; instance automatically fails over to another zone within your selected region. *zonal*::: Provides no failover capability. This is the default. ::: +
--backupEnables daily backup. Enabled by default, use *--no-backup* to disable
--backup-location <BACKUP_LOCATION>Choose where to store your backups. Backups are stored in the closest multi-region location to you by default. Only customize if needed
--backup-start-time <BACKUP_START_TIME>Start time of daily backups, specified in the 24 hour format - HH:MM, in the UTC timezone
--billing-project <BILLING_PROJECT>The Google Cloud Platform project that will be charged quota for operations performed in gcloud. If you need to operate on one project, but need quota against a different project, you can use this flag to specify the billing project. If both `billing/quota_project` and `--billing-project` are specified, `--billing-project` takes precedence. Run `$ gcloud config set --help` to see more information about `billing/quota_project`
--collation <COLLATION>Cloud SQL server-level collation setting, which specifies the set of rules for comparing characters in a character set
--configuration <CONFIGURATION>The configuration to use for this command invocation. For more information on how to use configurations, run: `gcloud topic configurations`. You can also use the CLOUDSDK_ACTIVE_CONFIG_NAME environment variable to set the equivalent of this flag for a terminal session
--cpu <CPU>Whole number value indicating how many cores are desired in the machine. Both --cpu and --memory must be specified if a custom machine type is desired, and the --tier flag must be omitted
--database-flags <FLAG=VALUE>Comma-separated list of database flags to set on the instance. Use an equals sign to separate flag name and value. Flags without values, like skip_grant_tables, can be written out without a value after, e.g., `skip_grant_tables=`. Use on/off for booleans. View the Instance Resource API for allowed flags. (e.g., `--database-flags max_allowed_packet=55555,skip_grant_tables=,log_output=1`)
--database-version <DATABASE_VERSION>The database engine type and version. If left unspecified, the API defaults will be used. _DATABASE_VERSION_ must be one of: *MYSQL_5_6*, *MYSQL_5_7*, *MYSQL_8_0*, *POSTGRES_9_6*, *POSTGRES_10*, *POSTGRES_11*, *POSTGRES_12*, *POSTGRES_13*, *SQLSERVER_2017_EXPRESS*, *SQLSERVER_2017_WEB*, *SQLSERVER_2017_STANDARD*, *SQLSERVER_2017_ENTERPRISE*
--deny-maintenance-period-end-date <DENY_MAINTENANCE_PERIOD_END_DATE>Date when the deny maintenance period ends, that is ``2021-01-10"
--deny-maintenance-period-start-date <DENY_MAINTENANCE_PERIOD_START_DATE>Date when the deny maintenance period begins, that is ``2020-11-01"
--deny-maintenance-period-time <DENY_MAINTENANCE_PERIOD_TIME>Time when the deny maintenance period starts or ends, that is ``05:00:00"
--disk-encryption-key <DISK_ENCRYPTION_KEY>ID of the key or fully qualified identifier for the key
--disk-encryption-key-keyring <DISK_ENCRYPTION_KEY_KEYRING>The KMS keyring of the key
--disk-encryption-key-location <DISK_ENCRYPTION_KEY_LOCATION>The Cloud location for the key
--disk-encryption-key-project <DISK_ENCRYPTION_KEY_PROJECT>The Cloud project for the key
--enable-bin-logAllows for data recovery from a specific point in time, down to a fraction of a second. Must have automatic backups enabled to use. Make sure storage can support at least 7 days of logs
--enable-point-in-time-recoveryAllows for data recovery from a specific point in time, down to a fraction of a second, via write-ahead logs. Must have automatic backups enabled to use. Make sure storage can support at least 7 days of logs
--failover-replica-name <FAILOVER_REPLICA_NAME>Also create a failover replica with the specified name
--flags-file <YAML_FILE>A YAML or JSON file that specifies a *--flag*:*value* dictionary. Useful for specifying complex flag values with special characters that work with any command interpreter. Additionally, each *--flags-file* arg is replaced by its constituent flags. See $ gcloud topic flags-file for more information
--flatten <KEY>Flatten _name_[] output resource slices in _KEY_ into separate records for each item in each slice. Multiple keys and slices may be specified. This also flattens keys for *--format* and *--filter*. For example, *--flatten=abc.def* flattens *abc.def[].ghi* references to *abc.def.ghi*. A resource record containing *abc.def[]* with N elements will expand to N records in the flattened output. This flag interacts with other flags that are applied in this order: *--flatten*, *--sort-by*, *--filter*, *--limit*
--format <FORMAT>Set the format for printing command output resources. The default is a command-specific human-friendly output format. The supported formats are: `config`, `csv`, `default`, `diff`, `disable`, `flattened`, `get`, `json`, `list`, `multi`, `none`, `object`, `table`, `text`, `value`, `yaml`. For more details run $ gcloud topic formats
--gce-zone <GCE_ZONE>(DEPRECATED) Preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.). + Flag `--gce-zone` is deprecated and will be removed by release 255.0.0. Use `--zone` instead
--helpDisplay detailed help
--impersonate-service-account <SERVICE_ACCOUNT_EMAIL>For this gcloud invocation, all API requests will be made as the given service account instead of the currently selected account. This is done without needing to create, download, and activate a key for the account. In order to perform operations as the service account, your currently selected account must have an IAM role that includes the iam.serviceAccounts.getAccessToken permission for the service account. The roles/iam.serviceAccountTokenCreator role has this permission or you may create a custom role. Overrides the default *auth/impersonate_service_account* property value for this command invocation
--insights-config-query-insights-enabledEnable query insights feature to provide query and query plan analytics. To disable this feature, use `--no-insights-config-query-insights-enabled` instead
--insights-config-query-string-length <INSIGHTS_CONFIG_QUERY_STRING_LENGTH>Query string length in bytes to be stored by the query insights feature. Default length is 1024 bytes. Allowed range: 256 to 4500 bytes
--insights-config-record-application-tagsAllow application tags to be recorded by the query insights feature. To disable application tag recording, use `--no-insights-record-application-tags` flag instead
--insights-config-record-client-addressAllow the client address to be recorded by the query insights feature. To disable client address recording, use `--no-insights-config-record-client-address` instead
--log-httpLog all HTTP server requests and responses to stderr. Overrides the default *core/log_http* property value for this command invocation
--maintenance-release-channel <MAINTENANCE_RELEASE_CHANNEL>Which channel's updates to apply during the maintenance window. If not specified, Cloud SQL chooses the timing of updates to your instance. _MAINTENANCE_RELEASE_CHANNEL_ must be one of: + *preview*::: Preview updates release prior to production updates. You may wish to use the preview channel for dev/test applications so that you can preview their compatibility with your application prior to the production release. *production*::: Production updates are stable and recommended for applications in production. ::: +
--maintenance-window-day <MAINTENANCE_WINDOW_DAY>Day of week for maintenance window, in UTC time zone. _MAINTENANCE_WINDOW_DAY_ must be one of: *SUN*, *MON*, *TUE*, *WED*, *THU*, *FRI*, *SAT*
--maintenance-window-hour <MAINTENANCE_WINDOW_HOUR>Hour of day for maintenance window, in UTC time zone
--master-instance-name <MASTER_INSTANCE_NAME>Name of the instance which will act as master in the replication setup. The newly created instance will be a read replica of the specified master instance
--memory <MEMORY>Whole number value indicating how much memory is desired in the machine. A size unit should be provided (eg. 3072MiB or 9GiB) - if no units are specified, GiB is assumed. Both --cpu and --memory must be specified if a custom machine type is desired, and the --tier flag must be omitted
--project <PROJECT_ID>The Google Cloud Platform project ID to use for this invocation. If omitted, then the current project is assumed; the current project can be listed using `gcloud config list --format='text(core.project)'` and can be set using `gcloud config set project PROJECTID`. + `--project` and its fallback `core/project` property play two roles in the invocation. It specifies the project of the resource to operate on. It also specifies the project for API enablement check, quota, and billing. To specify a different project for quota and billing, use `--billing-project` or `billing/quota_project` property
--quietDisable all interactive prompts when running gcloud commands. If input is required, defaults will be used, or an error will be raised. Overrides the default core/disable_prompts property value for this command invocation. This is equivalent to setting the environment variable `CLOUDSDK_CORE_DISABLE_PROMPTS` to 1
--region <REGION>Regional location (e.g. asia-east1, us-east1). See the full list of regions at https://cloud.google.com/sql/docs/instance-locations
--replica-type <REPLICA_TYPE>The type of replica to create. _REPLICA_TYPE_ must be one of: *READ*, *FAILOVER*
--replication <REPLICATION>Type of replication this instance uses. The default is synchronous. _REPLICATION_ must be one of: *synchronous*, *asynchronous*
--require-sslSpecified if users connecting over IP must use SSL
--retained-backups-count <RETAINED_BACKUPS_COUNT>How many backups to keep. The valid range is between 1 and 365. The default value is 7 if not specified. Applicable only if --no-backups is not specified
--retained-transaction-log-days <RETAINED_TRANSACTION_LOG_DAYS>How many days of transaction logs to keep. The valid range is between 1 and 7. The default value is 7 if not specified. Only valid when point in time recovery is enabled. Keeping more days of transaction logs requires bigger storage size
--root-password <ROOT_PASSWORD>Root Cloud SQL user's password
--storage-auto-increaseStorage size can be increased, but it cannot be decreased; storage increases are permanent for the life of the instance. With this setting enabled, a spike in storage requirements can result in permanently increased storage costs for your instance. However, if an instance runs out of available space, it can result in the instance going offline, dropping existing connections. This setting is enabled by default
--storage-size <STORAGE_SIZE>Amount of storage allocated to the instance. Must be an integer number of GB. The default is 10GB. Information on storage limits can be found here: https://cloud.google.com/sql/docs/quotas#storage_limits
--storage-type <STORAGE_TYPE>The storage type for the instance. The default is SSD. _STORAGE_TYPE_ must be one of: *SSD*, *HDD*
--tier <TIER>The tier for this instance. For Second Generation instances, TIER is the instance's machine type (e.g., db-n1-standard-1). For PostgreSQL instances, only shared-core machine types (e.g., db-f1-micro) apply. A complete list of tiers is available here: https://cloud.google.com/sql/pricing
--trace-token <TRACE_TOKEN>Token used to route traces of service requests for investigation of issues. Overrides the default *core/trace_token* property value for this command invocation
--user-output-enabledPrint user intended output to the console. Overrides the default *core/user_output_enabled* property value for this command invocation. Use *--no-user-output-enabled* to disable
--verbosity <VERBOSITY>Override the default verbosity for this command. Overrides the default *core/verbosity* property value for this command invocation. _VERBOSITY_ must be one of: *debug*, *info*, *warning*, *error*, *critical*, *none*
--zone <ZONE>Preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.)