gcloud composer environments update

NAME
gcloud composer environments update - update properties of a Cloud Composer environment
SYNOPSIS
gcloud composer environments update(ENVIRONMENT :--location=LOCATION)(--airflow-database-retention-days=AIRFLOW_DATABASE_RETENTION_DAYS    |--cloud-sql-machine-type=CLOUD_SQL_MACHINE_TYPE    |--disable-high-resilience    |--disable-logs-in-cloud-logging-only    |--disable-private-environment    |--enable-high-resilience    |--enable-logs-in-cloud-logging-only    |--enable-private-environment    |--environment-size=ENVIRONMENT_SIZE    |--node-count=NODE_COUNT    |--support-web-server-plugins    |--web-server-machine-type=WEB_SERVER_MACHINE_TYPE    |--airflow-version=AIRFLOW_VERSION    |--image-version=IMAGE_VERSION    |--clear-maintenance-window    |--maintenance-window-end=MAINTENANCE_WINDOW_END--maintenance-window-recurrence=MAINTENANCE_WINDOW_RECURRENCE--maintenance-window-start=MAINTENANCE_WINDOW_START    |--disable-cloud-data-lineage-integration    |--enable-cloud-data-lineage-integration    |--disable-master-authorized-networks--enable-master-authorized-networks--master-authorized-networks=[NETWORK,…]    |--disable-private-builds-only    |--enable-private-builds-only    |--disable-scheduled-snapshot-creation    |--enable-scheduled-snapshot-creation--snapshot-creation-schedule=SNAPSHOT_CREATION_SCHEDULE--snapshot-location=SNAPSHOT_LOCATION--snapshot-schedule-timezone=SNAPSHOT_SCHEDULE_TIMEZONE    |--disable-vpc-connectivity    |--network-attachment=NETWORK_ATTACHMENT    | [--network=NETWORK :--subnetwork=SUBNETWORK]    |--max-workers=MAX_WORKERS--min-workers=MIN_WORKERS--scheduler-count=SCHEDULER_COUNT--scheduler-cpu=SCHEDULER_CPU--scheduler-memory=SCHEDULER_MEMORY--scheduler-storage=SCHEDULER_STORAGE--web-server-cpu=WEB_SERVER_CPU--web-server-memory=WEB_SERVER_MEMORY--web-server-storage=WEB_SERVER_STORAGE--worker-cpu=WORKER_CPU--worker-memory=WORKER_MEMORY--worker-storage=WORKER_STORAGE--dag-processor-count=DAG_PROCESSOR_COUNT--dag-processor-cpu=DAG_PROCESSOR_CPU--dag-processor-memory=DAG_PROCESSOR_MEMORY--dag-processor-storage=DAG_PROCESSOR_STORAGE--disable-triggerer    |--enable-triggerer--triggerer-count=TRIGGERER_COUNT--triggerer-cpu=TRIGGERER_CPU--triggerer-memory=TRIGGERER_MEMORY    |--update-airflow-configs=[KEY=VALUE,…]--clear-airflow-configs    |--remove-airflow-configs=[KEY,…]    |--update-env-variables=[NAME=VALUE,…]--clear-env-variables    |--remove-env-variables=[NAME,…]    |--update-labels=[KEY=VALUE,…]--clear-labels    |--remove-labels=[KEY,…]    |--update-pypi-packages-from-file=UPDATE_PYPI_PACKAGES_FROM_FILE    |--update-pypi-package=PACKAGE[EXTRAS_LIST]VERSION_SPECIFIER--clear-pypi-packages    |--remove-pypi-packages=[PACKAGE,…]    |--update-web-server-allow-ip=[description=DESCRIPTION],[ip_range=IP_RANGE]    |--web-server-allow-all    |--web-server-deny-all)[--async][GCLOUD_WIDE_FLAG]
DESCRIPTION
Update properties of a Cloud Composer environment.
EXAMPLES
To update the Cloud Composer environment namedenv-1 to have 8 Airflow workers, and nothave theproduction label, run:
gcloudcomposerenvironmentsupdateenv-1--node-count=8--remove-labels=production
POSITIONAL ARGUMENTS
Environment resource - The environment to update. The arguments in this groupcan be used to specify the attributes of this resource. (NOTE) Some attributesare not given arguments in this group but can be set in other ways.

To set theproject attribute:

  • provide the argumentenvironment on the command line with a fullyspecified name;
  • provide the argument--project on the command line;
  • set the propertycore/project.

This must be specified.

ENVIRONMENT
ID of the environment or fully qualified identifier for the environment.

To set theenvironment attribute:

  • provide the argumentenvironment on the command line.

This positional argument must be specified if any of the other arguments in thisgroup are specified.

--location=LOCATION
Region where Composer environment runs or in which to create the environment.

To set thelocation attribute:

  • provide the argumentenvironment on the command line with a fullyspecified name;
  • provide the argument--location on the command line;
  • set the propertycomposer/location.
REQUIRED FLAGS
The update type.

Exactly one of these must be specified:

--airflow-database-retention-days=AIRFLOW_DATABASE_RETENTION_DAYS
The number of days for the Airflow database retention period. If set to 0, theAirflow database retention mechanism will be disabled.
--cloud-sql-machine-type=CLOUD_SQL_MACHINE_TYPE
Cloud SQL machine type used by the Airflow database. The list of availablemachine types is available here:https://cloud.google.com/composer/pricing#db-machine-types.
--disable-high-resilience
Disable high resilience, supported for Composer 2 Environments.
--disable-logs-in-cloud-logging-only
Disable logs in cloud logging only, supported for Composer 2 Environments.
--disable-private-environment
Enable internet connection from any Composer component, supported in Composer 3environments or greater.
--enable-high-resilience
Enable high resilience, supported for Composer 2 Environments.
--enable-logs-in-cloud-logging-only
Enable logs in cloud logging only, supported for Composer 2 Environments.
--enable-private-environment
Disable internet connection from any Composer component, supported in Composer 3environments or greater.
--environment-size=ENVIRONMENT_SIZE
Size of the environment. Unspecified means that the default option will bechosen.ENVIRONMENT_SIZE must be one of:extra-large,large,medium,small,unspecified.
--node-count=NODE_COUNT
The new number of nodes running the environment. Must be >= 3.
--support-web-server-plugins
Enable the support for web server plugins, supported in Composer 3 or greater.
--web-server-machine-type=WEB_SERVER_MACHINE_TYPE
machine type used by the Airflow web server. The list of available machine typesis available here:https://cloud.google.com/composer/pricing.
Or at most one of these can be specified:
Group of arguments for performing in-place environment upgrades.
--airflow-version=AIRFLOW_VERSION
Upgrade the environment to a later Apache Airflow version in-place.

Must be of the formX[.Y[.Z]], where[] denotesoptional fragments. Examples:2,2.3,2.3.4.

The Apache Airflow version is a semantic version or an alias in the form ofmajor or major.minor version numbers, resolved to the latest matching ApacheAirflow version supported in the current Cloud Composer version. The resolvedversion is stored in the upgraded environment.

--image-version=IMAGE_VERSION
Upgrade the environment to a later version in-place.

The image version encapsulates the versions of both Cloud Composer and ApacheAirflow. Must be of the formcomposer-A[.B.C[-D.E]]-airflow-X[.Y[.Z]], where[]denotes optional fragments.

Examples:composer-2-airflow-2,composer-2-airflow-2.2,composer-2.1.2-airflow-2.3.4.

The Cloud Composer portion of the image version is a semantic version or analias in the form of major version number orlatest, resolved tothe current Cloud Composer version. The Apache Airflow portion of the imageversion is a semantic version or an alias in the form of major or major.minorversion numbers, resolved to the latest matching Apache Airflow versionsupported in the given Cloud Composer version. The resolved versions are storedin the upgraded environment.

Or at most one of these can be specified:
Group of arguments for setting the maintenance window value during update.
--clear-maintenance-window
Clears the maintenance window settings. Can be specified for Composer 3 orgreater.
Or at least one of these can be specified:
Group of arguments for setting the maintenance window value.
--maintenance-window-end=MAINTENANCE_WINDOW_END
End time of the mantenance window in the form of the full date. Only the time ofthe day is used as a reference for an ending time of the window with a providedrecurrence. Specified date must take place after the one specified as a startdate, the difference between will be used as a length of a single maintenancewindow. See $gcloud topicdatetimes for information on time formats.

This flag argument must be specified if any of the other arguments in this groupare specified.

--maintenance-window-recurrence=MAINTENANCE_WINDOW_RECURRENCE
An RFC 5545 RRULE, specifying how the maintenance window will recur. The minimumrequirement for the length of the maintenance window is 12 hours a week. OnlyFREQ=DAILY and FREQ=WEEKLY rules are supported.

This flag argument must be specified if any of the other arguments in this groupare specified.

--maintenance-window-start=MAINTENANCE_WINDOW_START
Start time of the mantenance window in the form of the full date. Only the timeof the day is used as a reference for a starting time of the window with aprovided recurrence. See $gcloud topic datetimes forinformation on time formats.

This flag argument must be specified if any of the other arguments in this groupare specified.

Or at least one of these can be specified:
Group of arguments for setting Cloud Data Lineage integration configuration inComposer 2.
At most one of these can be specified:
--disable-cloud-data-lineage-integration
Disable Cloud Data Lineage integration, supported for Composer 2 Environments.
--enable-cloud-data-lineage-integration
Enable Cloud Data Lineage integration, supported for Composer 2 Environments.
Or at least one of these can be specified:
Group of arguments for setting master authorized networks configuration.
--disable-master-authorized-networks
DisableMasterAuthorized Networks feature in the Composer Environment's GKE cluster.
--enable-master-authorized-networks
EnableMasterAuthorized Networks feature in the Composer Environment's GKE cluster.
--master-authorized-networks=[NETWORK,…]
Comma separated Master Authorized Networks specified in CIDR notation.

Cannot be specified unless--enable-master-authorized-networks isalso specified.

Or at most one of these can be specified:
--disable-private-builds-only
Builds performed during operations that install Python packages have an accessto the internet, supported in Composer 3 or greater.
--enable-private-builds-only
Builds performed during operations that install Python packages have onlyprivate connectivity to Google services, supported in Composer 3 or greater.
Or at most one of these can be specified:
Group of arguments used during update of scheduled snapshots settings inComposer 2.0.32 or greater.
--disable-scheduled-snapshot-creation
Disables automated snapshots creation. Can be specified for Composer 2.0.32 orgreater.
Or at least one of these can be specified:
Group of arguments for setting scheduled snapshots settings in Composer 2.0.32or greater.
--enable-scheduled-snapshot-creation
When specified, snapshots of the environment will be created according to aschedule. Can be specified for Composer 2.0.32 or greater.

This flag argument must be specified if any of the other arguments in this groupare specified.

--snapshot-creation-schedule=SNAPSHOT_CREATION_SCHEDULE
Cron expression specifying when snapshots of the environment should be created.Can be specified for Composer 2.0.32 or greater.

This flag argument must be specified if any of the other arguments in this groupare specified.

--snapshot-location=SNAPSHOT_LOCATION
The Cloud Storage location for storing automatically created snapshots. Can bespecified for Composer 2.0.32 or greater.

This flag argument must be specified if any of the other arguments in this groupare specified.

--snapshot-schedule-timezone=SNAPSHOT_SCHEDULE_TIMEZONE
Timezone that sets the context to interpret snapshot_creation_schedule. Can bespecified for Composer 2.0.32 or greater.

This flag argument must be specified if any of the other arguments in this groupare specified.

Or at most one of these can be specified:
--disable-vpc-connectivity
Disable connectivity with a user's VPC network, supported in Composer 3environments or greater.
--network-attachment=NETWORK_ATTACHMENT
Cloud Composer Network Attachment, which provides connectivity with a user's VPCnetwork, supported in Composer 3 environments or greater.
Or at least one of these can be specified:
Virtual Private Cloud networking
--network=NETWORK
The Compute Engine Network to which the environment will be connected. If a'Custom Subnet Network' is provided,--subnetwork must be specifiedas well.

This flag argument must be specified if any of the other arguments in this groupare specified.

--subnetwork=SUBNETWORK
TheCompute EngineSubnetwork to which the environment will be connected.
Or at least one of these can be specified:
Group of arguments for setting workloads configuration in Composer 2.X orgreater (--scheduler-count flag is available for Composer 1.X as well).
--max-workers=MAX_WORKERS
Maximum number of workers in the Environment.
--min-workers=MIN_WORKERS
Minimum number of workers in the Environment.
--scheduler-count=SCHEDULER_COUNT
Number of schedulers, supported in the Environments with Airflow 2.0.1 andlater.
--scheduler-cpu=SCHEDULER_CPU
CPU allocated to Airflow scheduler.
--scheduler-memory=SCHEDULER_MEMORY
Memory allocated to Airflow scheduler, ex. 600MB, 3GB, 2. If units are notprovided, defaults to GB.
--scheduler-storage=SCHEDULER_STORAGE
Storage allocated to Airflow scheduler, ex. 600MB, 3GB, 2. If units are notprovided, defaults to GB.
--web-server-cpu=WEB_SERVER_CPU
CPU allocated to each Airflow web server
--web-server-memory=WEB_SERVER_MEMORY
Memory allocated to Airflow web server, ex. 600MB, 3GB, 2. If units are notprovided, defaults to GB.
--web-server-storage=WEB_SERVER_STORAGE
Storage allocated to Airflow web server, ex. 600MB, 3GB, 2. If units are notprovided, defaults to GB.
--worker-cpu=WORKER_CPU
CPU allocated to each Airflow worker
--worker-memory=WORKER_MEMORY
Memory allocated to Airflow worker, ex. 600MB, 3GB, 2. If units are notprovided, defaults to GB.
--worker-storage=WORKER_STORAGE
Storage allocated to Airflow worker, ex. 600MB, 3GB, 2. If units are notprovided, defaults to GB.
Group of arguments for setting dag processor settings in Composer 3 or greater.
--dag-processor-count=DAG_PROCESSOR_COUNT
Number of dag processors, supported in Composer 3 environments or greater.
--dag-processor-cpu=DAG_PROCESSOR_CPU
CPU allocated to Airflow dag processor, supported in Composer 3 environments orgreater.
--dag-processor-memory=DAG_PROCESSOR_MEMORY
Memory allocated to Airflow dag processor, ex. 1GB, 3GB, 2. If units are notprovided, defaults to GB, supported in Composer 3 environments or greater.
--dag-processor-storage=DAG_PROCESSOR_STORAGE
Storage allocated to Airflow dag processor, ex. 600MB, 3GB, 2. If units are notprovided, defaults to GB, supported in Composer 3 environments or greater.
Group of arguments for setting triggerer settings in Composer 2.0.31 or greater.

At most one of these can be specified:

--disable-triggerer
(DEPRECATED) Disable a triggerer, supported in the Environments with Composer2.0.31 and Airflow 2.2.5 and greater.

This flag is deprecated. Use --triggerer-count 0 instead.

Or at least one of these can be specified:
Group of arguments for setting triggerer settings during update in Composer2.0.31 or greater.
--enable-triggerer
(DEPRECATED) Enable use of a triggerer, supported in the Environments withComposer 2.0.31 and Airflow 2.2.5 and greater.

This flag is deprecated. Use --triggerer-count instead.

--triggerer-count=TRIGGERER_COUNT
Number of triggerers, supported in the Environments with Composer 2.0.31 andAirflow 2.2.5 and greater.
--triggerer-cpu=TRIGGERER_CPU
CPU allocated to Airflow triggerer. Supported in the Environments with Composer2.0.31 and Airflow 2.2.5 and greater.
--triggerer-memory=TRIGGERER_MEMORY
Memory allocated to Airflow triggerer, ex. 512MB, 3GB, 2. If units are notprovided, defaults to GB. Supported in the Environments with Composer 2.0.31 andAirflow 2.2.5 and greater.
Or at least one of these can be specified:
Group of arguments for modifying the Airflow configuration.
--update-airflow-configs=[KEY=VALUE,…]
A list of Airflow config override KEY=VALUE pairs to set. If a config overrideexists, its value is updated; otherwise, a new config override is created.

KEYs should specify the configuration section and property name, separated by ahyphen, for examplecore-print_stats_interval. The section may notcontain a closing square brace or period. The property name must be non-emptyand may not contain an equals sign, semicolon, or period. By convention,property names are spelled withsnake_case. VALUEs may contain anycharacter.

Arguments available for item removal.

At most one of these can be specified:

--clear-airflow-configs
Removes all Airflow config overrides from the environment.
--remove-airflow-configs=[KEY,…]
A list of Airflow config override keys to remove.
Or at least one of these can be specified:
Group of arguments for modifying environment variables.
--update-env-variables=[NAME=VALUE,…]
A list of environment variable NAME=VALUE pairs to set and provide to theAirflow scheduler, worker, and webserver processes. If an environment variableexists, its value is updated; otherwise, a new environment variable is created.

NAMEs are the environment variable names and may contain upper and lowercaseletters, digits, and underscores; they must not begin with a digit.

User-specified environment variables should not be used to set Airflowconfiguration properties. Instead use the--update-airflow-configsflag.

Arguments available for item removal.

At most one of these can be specified:

--clear-env-variables
Removes all environment variables from the environment.

Environment variables that have system-provided defaults cannot be unset withthe--remove-env-variables or--clear-env-variablesflags; only the user-supplied overrides will be removed.

--remove-env-variables=[NAME,…]
A list of environment variables to remove.

Environment variables that have system-provided defaults cannot be unset withthe--remove-env-variables or--clear-env-variablesflags; only the user-supplied overrides will be removed.

Or at least one of these can be specified:
Group of arguments for modifying environment labels.
--update-labels=[KEY=VALUE,…]
List of label KEY=VALUE pairs to update. If a label exists, its value ismodified. Otherwise, a new label is created.

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.

At most one of these can be specified:
--clear-labels
Remove all labels. If--update-labels is also specified then--clear-labels is applied first.

For example, to remove all labels:

gcloudcomposerenvironmentsupdate--clear-labels

To remove all existing labels and create two new labels,foo andbaz:

gcloudcomposerenvironmentsupdate--clear-labels--update-labelsfoo=bar,baz=qux
--remove-labels=[KEY,…]
List of label keys to remove. If a label does not exist it is silently ignored.If--update-labels is also specified then--update-labels is applied first.
Or at most one of these can be specified:
Group of arguments for modifying the PyPI package configuration.
--update-pypi-packages-from-file=UPDATE_PYPI_PACKAGES_FROM_FILE
The path to a file containing a list of PyPI packages to install in theenvironment. Each line in the file should contain a package specification in theformat of the update-pypi-package argument defined above. The path can be alocal file path or a Google Cloud Storage file path (Cloud Storage file pathstarts with 'gs://').
Or at least one of these can be specified:
--update-pypi-package=PACKAGE[EXTRAS_LIST]VERSION_SPECIFIER
A PyPI package to add to the environment. If a package exists, its value isupdated; otherwise, a new package is installed.

The value takes the form of:PACKAGE[EXTRAS_LIST]VERSION_SPECIFIER,as one would specify in a pip requirements file.

PACKAGE is specified as a package name, such asnumpy. EXTRAS_LISTis a comma-delimited list of PEP 508 distribution extras that may be empty, inwhich case the enclosing square brackets may be omitted. VERSION_SPECIFIER is anoptional PEP 440 version specifier. If both EXTRAS_LIST and VERSION_SPECIFIERare omitted, the= and everything to the right may be left empty.

This is a repeated argument that can be specified multiple times to updatemultiple packages. If PACKAGE appears more than once, the last value will beused.

Arguments available for item removal.

At most one of these can be specified:

--clear-pypi-packages
Removes all PyPI packages from the environment.

PyPI packages that are required by the environment's core software cannot beuninstalled with the--remove-pypi-packages or--clear-pypi-packages flags.

--remove-pypi-packages=[PACKAGE,…]
A list of PyPI package names to remove.

PyPI packages that are required by the environment's core software cannot beuninstalled with the--remove-pypi-packages or--clear-pypi-packages flags.

Or at most one of these can be specified:
--update-web-server-allow-ip=[description=DESCRIPTION],[ip_range=IP_RANGE]
Specifies a list of IPv4 or IPv6 ranges that will be allowed to access theAirflow web server. By default, all IPs are allowed to access the web server.
ip_range
IPv4 or IPv6 range of addresses allowed to access the Airflow web server.
description
An optional description of the IP range.
--web-server-allow-all
Allows all IP addresses to access the Airflow web server.
--web-server-deny-all
Denies all incoming traffic to the Airflow web server.
OPTIONAL FLAGS
--async
Return immediately, without waiting for the operation in progress to complete.
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 help for details.

NOTES
These variants are also available:
gcloudalphacomposerenvironmentsupdate
gcloudbetacomposerenvironmentsupdate

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 2026-01-21 UTC.