Managing SDK Properties

What is a property?

Properties are settings that govern the behavior of the gcloud CLI and other SDK tools.

Properties can be used to define a per-product or per-service setting such as the account used by the gcloud CLI and other Cloud SDK tools for authorization, the default region to be used when working with Google Compute Engine resources, or even the option to turn off automatic Cloud SDK component updates. Properties can also be used to define gcloud command-line tool preferences like verbosity level and prompt configuration for gcloud CLI commands.

Properties and flags

The gcloud CLI supports some global flags and command flags that have the same effect as SDK properties. For example, the gcloud CLI supports both the --project flag and project property. Properties allow you to maintain the same settings across command executions while flags affect command behavior on a per-invocation basis. Note that flags override properties when both are set.

Configurations

A configuration is a named set of SDK properties. The gcloud CLI uses a configuration named default as the initial active configuration; default is suitable for most use cases. However, you can also create additional configurations and switch between them as required.

Listing properties

To list the properties in the active configuration, run gcloud config list:

gcloud config list

The gcloud CLI returns the list of properties:

[compute]
region = us-east1
zone = us-east1-d
[core]
account = user@google.com
disable_usage_reporting = False
project = example-project
[metrics]
command_name = gcloud.config.list

Setting properties

To set a property in the active configuration, run gcloud config set:

gcloud config set project [PROJECT]

To set properties that are not in the core properties section, you must specify the section followed by a forward slash before the property name:

gcloud config set compute/zone us-east1-b

Unsetting properties

To unset a property in the active configuration, use gcloud config unset:

gcloud config unset disable_usage_reporting

Property types

SDK properties are organized into sections which group together related properties for convenience when you are viewing property lists.

Core properties

The core section contains configuration properties for the gcloud command.

Name Description
account User account or service account used by the gcloud CLI and other SDK tools for authorization.
custom_ca_certs_file Absolute path to the custom CA certificate file to use.
disable_color If set to True, prevents the gcloud CLI from printing messages in color to the terminal.
disable_file_logging If set to True, the gcloud CLI will not store logs to a file. This may be useful if disk space is limited.
disable_prompts If set to True, suppresses prompts for all gcloud CLI commands and assumes the default answer. If a command requires user input and a default cannot be used, the gcloud CLI reports an error. Equivalent to the global --quiet flag.
disable_usage_reporting If set to True, disables collection of anonymous statistics on SDK usage. You set this value when you install the SDK, but you can change it at any time.
log_http If set to True, enables writing of HTTP requests and responses to logs. If you want to see these messages in your terminal, adjust your verbosity setting using the verbosity property or global --verbosity flag.
max_log_days Maximum number of days to retain log files before deleting. If set to 0, turns off log garbage collection and does not delete log files. If unset, the default is 30 days.
pass_credentials_to_gsutil If set to True, passes the configured Cloud SDK authentication to gsutil.
project Project ID of the current Cloud Platform project. You can override this value using the global --project flag.
show_structured_logs Visibility and format of JSON-structured log messages written to standard error. If his property is disabled, logs will be formatted as text by default. Valid values are never, always, log, and terminal. If unset, default is never.
trace_token Token provided by Google support to route traces of service requests for investigation of issues.
user_output_enabled Enables printing of command output to standard output and standard error in the terminal. If set to False, output is suppressed.
verbosity Logging verbosity for gcloud CLI commands. The gcloud CLI supports the following standard verbosity levels:
  • debug
  • info
  • warning
  • error
  • critical
  • none
Equivalent to using the global --verbosity flag.

Component manager properties

The component_manager section contains properties used when managing SDK components.

Name Description
component_manager/additional_repositories Comma separated list of additional repositories to check for components. This property is automatically managed by the commands in the gcloud components repositories command group.
component_manager/disable_update_check If True, the SDK does not automatically check for updates.

App Engine properties

The app section contains properties that specify behavior for the gcloud app deploy command.

Name Description
app/stop_previous_version If True, stops the previously deployed version when deploying a new version of the application. If False, the older version must be stopped manually before deployment.

Compute Engine properties

The compute section contains properties used by gcloud CLI commands operating on Google Compute Engine resources.

Name Description
compute/region Default region to use when working with Compute Engine resources. If the --region flag is required by a gcloud CLI command but is not provided, this value is used.
compute/zone Default zone to use when working with Compute Engine resources. If the --zone flag is required by a gcloud CLI command but is not provided, this value is used.

Kubernetes Engine properties

The container section contains properties used by gcloud CLI commands that operate on Google Kubernetes Engine clusters.

Name Description
container/cluster Name of the cluster to use by default.

Network proxy properties

The proxy section contains properties related to the use of network proxies by the gcloud command.

Name Description
proxy/type Type of proxy server. Supported proxy types are:
  • http
  • http_no_tunnel
  • socks4
  • socks5
proxy/address Hostname or IP address of the proxy server.
proxy/port Port to use when connected to the proxy server.
proxy/username Username to use when connecting to the proxy server, if required.
proxy/password Password to use when connecting to the proxy server, if required.
proxy/rdns If True (default), DNS queries will not be performed locally, and instead, handed to the proxy to resolve.

What's next

Var denne side nyttig? Giv os en anmeldelse af den:

Send feedback om...

Cloud SDK Documentation