GCP.Composer reference
Environment
Section titled “Environment”Source:
src/GCP/Composer/Environment.ts
A Cloud Composer environment (Managed Apache Airflow).
Changing environmentId, location, node network/subnetwork, node
service account, encryption, private-IP settings, python version, or the
storage bucket replaces the environment. Labels, PyPI packages, Airflow config overrides, env vars,
image version, workloads, and environment size update in place — one
update type per Composer patch, applied sequentially.
Provisioning typically takes 20–45 minutes. Polls the LRO via
getProjectsLocationsOperations (Composer has no wait long-poll).
New environments must name their service account explicitly in
config.nodeConfig.serviceAccount; Composer no longer falls back to the
default Compute Engine account. The account needs roles/composer.worker
(or broader) on the project. Changing it replaces the environment.
Environment: Creating an Environment
Section titled “Environment: Creating an Environment”Generated name, Composer 3 small
const airflow = yield* GCP.Composer.Environment("Airflow", { config: { environmentSize: "ENVIRONMENT_SIZE_SMALL", nodeConfig: { serviceAccount: "composer-env@my-project.iam.gserviceaccount.com", }, softwareConfig: { imageVersion: "composer-3-airflow-2" }, },});Explicit id, labels, and PyPI packages
const airflow = yield* GCP.Composer.Environment("Airflow", { environmentId: "app-airflow", location: "us-central1", labels: { env: "prod" }, config: { environmentSize: "ENVIRONMENT_SIZE_SMALL", nodeConfig: { serviceAccount: "composer-env@my-project.iam.gserviceaccount.com", }, softwareConfig: { imageVersion: "composer-3-airflow-2", pypiPackages: { numpy: "==2.1.0" }, }, },});Environment: Updating software
Section titled “Environment: Updating software”const airflow = yield* GCP.Composer.Environment("Airflow", { environmentId: "app-airflow", config: { softwareConfig: { airflowConfigOverrides: { "core-dags_are_paused_at_creation": "True" }, envVariables: { EXAMPLE_VAR: "test" }, }, },});EnvironmentsUserWorkloadsConfigMap
Section titled “EnvironmentsUserWorkloadsConfigMap”Source:
src/GCP/Composer/EnvironmentsUserWorkloadsConfigMap.ts
A user workloads ConfigMap for Airflow tasks that run with the Kubernetes executor or KubernetesPodOperator.
Supported on Cloud Composer 3 (composer-3-airflow-2 and newer).
ConfigMaps have no labels field, so Alchemy tracks them by name and
never adds keys to data. environmentName and configMapId are
identity — changing either replaces the ConfigMap.
EnvironmentsUserWorkloadsConfigMap: Creating a User Workloads ConfigMap
Section titled “EnvironmentsUserWorkloadsConfigMap: Creating a User Workloads ConfigMap”Generated name
const airflow = yield* GCP.Composer.Environment("Airflow", { config: { environmentSize: "ENVIRONMENT_SIZE_SMALL", nodeConfig: { serviceAccount: "composer-env@my-project.iam.gserviceaccount.com", }, softwareConfig: { imageVersion: "composer-3-airflow-2" }, },});const config = yield* GCP.Composer.EnvironmentsUserWorkloadsConfigMap( "TaskConfig", { environmentName: airflow.name, data: { LOG_LEVEL: "INFO" }, },);Explicit id
const config = yield* GCP.Composer.EnvironmentsUserWorkloadsConfigMap( "TaskConfig", { environmentName: airflow.name, configMapId: "task-config", data: { LOG_LEVEL: "DEBUG", REGION: "us-central1" }, },);EnvironmentsUserWorkloadsConfigMap: Updating data
Section titled “EnvironmentsUserWorkloadsConfigMap: Updating data”const config = yield* GCP.Composer.EnvironmentsUserWorkloadsConfigMap( "TaskConfig", { environmentName: airflow.name, configMapId: "task-config", data: { LOG_LEVEL: "WARN" }, },);EnvironmentsUserWorkloadsSecret
Section titled “EnvironmentsUserWorkloadsSecret”Source:
src/GCP/Composer/EnvironmentsUserWorkloadsSecret.ts
A user workloads Secret for Airflow tasks that run with the Kubernetes executor or KubernetesPodOperator.
Supported on Cloud Composer 3 (composer-3-airflow-2 and newer).
Secrets have no labels field, so Alchemy tracks them by name and
never adds keys to data. environmentName and secretId are
identity — changing either replaces the Secret. Data values must be
base64-encoded.
EnvironmentsUserWorkloadsSecret: Creating a User Workloads Secret
Section titled “EnvironmentsUserWorkloadsSecret: Creating a User Workloads Secret”Generated name
const airflow = yield* GCP.Composer.Environment("Airflow", { config: { environmentSize: "ENVIRONMENT_SIZE_SMALL", nodeConfig: { serviceAccount: "composer-env@my-project.iam.gserviceaccount.com", }, softwareConfig: { imageVersion: "composer-3-airflow-2" }, },});const secret = yield* GCP.Composer.EnvironmentsUserWorkloadsSecret( "TaskSecret", { environmentName: airflow.name, data: { password: btoa("s3cret") }, },);Explicit id
const secret = yield* GCP.Composer.EnvironmentsUserWorkloadsSecret( "TaskSecret", { environmentName: airflow.name, secretId: "task-secret", data: { token: btoa("abc123") }, },);EnvironmentsUserWorkloadsSecret: Updating data
Section titled “EnvironmentsUserWorkloadsSecret: Updating data”const secret = yield* GCP.Composer.EnvironmentsUserWorkloadsSecret( "TaskSecret", { environmentName: airflow.name, secretId: "task-secret", data: { token: btoa("rotated") }, },);ExecuteAirflowCommand
Section titled “ExecuteAirflowCommand”Source:
src/GCP/Composer/ExecuteAirflowCommand.ts
Runtime binding for Cloud Composer environments.executeAirflowCommand.
Starts an Airflow CLI command in the environment. Bind this operation
to an Environment in a Function/Action init phase. Provide
ExecuteAirflowCommandHttp. Poll with
environments.pollAirflowCommand using the returned executionId.
Grants roles/composer.editor on the project because it is the
narrowest predefined role with
composer.environments.executeAirflowCommand, and Composer
environments have no per-resource IAM policy.
ExecuteAirflowCommand: Running Airflow CLI
Section titled “ExecuteAirflowCommand: Running Airflow CLI”const execute = yield* GCP.Composer.ExecuteAirflowCommand(airflow);const started = yield* execute({ body: { command: "dags", subcommand: "list" },});ExecuteAirflowCommandHttp
Section titled “ExecuteAirflowCommandHttp”Source:
src/GCP/Composer/ExecuteAirflowCommandHttp.tsKind: Layer · Provides:GCP.Composer.ExecuteAirflowCommand
HTTP implementation of ExecuteAirflowCommand.
Grants roles/composer.editor on the project because
composer.environments.executeAirflowCommand is in no narrower
predefined role and Composer environments have no resource-level IAM.
GetEnvironment
Section titled “GetEnvironment”Source:
src/GCP/Composer/GetEnvironment.ts
Runtime binding for Cloud Composer environments.get.
Bind this operation to an Environment in a Function/Action init
phase. Provide GetEnvironmentHttp.
GetEnvironment: Observing Environments
Section titled “GetEnvironment: Observing Environments”const getEnvironment = yield* GCP.Composer.GetEnvironment(airflow);const live = yield* getEnvironment();GetEnvironmentHttp
Section titled “GetEnvironmentHttp”Source:
src/GCP/Composer/GetEnvironmentHttp.tsKind: Layer · Provides:GCP.Composer.GetEnvironment
HTTP implementation of GetEnvironment.
GetUserWorkloadsConfigMap
Section titled “GetUserWorkloadsConfigMap”Source:
src/GCP/Composer/GetUserWorkloadsConfigMap.ts
Runtime binding for Cloud Composer userWorkloadsConfigMaps.get.
Bind this operation to an EnvironmentsUserWorkloadsConfigMap
in a Function/Action init phase. Provide
GetUserWorkloadsConfigMapHttp.
GetUserWorkloadsConfigMap: Observing ConfigMaps
Section titled “GetUserWorkloadsConfigMap: Observing ConfigMaps”const getConfigMap = yield* GCP.Composer.GetUserWorkloadsConfigMap( config,);const live = yield* getConfigMap();GetUserWorkloadsConfigMapHttp
Section titled “GetUserWorkloadsConfigMapHttp”Source:
src/GCP/Composer/GetUserWorkloadsConfigMapHttp.tsKind: Layer · Provides:GCP.Composer.GetUserWorkloadsConfigMap
HTTP implementation of GetUserWorkloadsConfigMap.
GetUserWorkloadsSecret
Section titled “GetUserWorkloadsSecret”Source:
src/GCP/Composer/GetUserWorkloadsSecret.ts
Runtime binding for Cloud Composer userWorkloadsSecrets.get.
Bind this operation to an EnvironmentsUserWorkloadsSecret in a
Function/Action init phase. Provide GetUserWorkloadsSecretHttp.
Data values in the response are cleared by the API.
GetUserWorkloadsSecret: Observing Secrets
Section titled “GetUserWorkloadsSecret: Observing Secrets”const getSecret = yield* GCP.Composer.GetUserWorkloadsSecret(secret);const live = yield* getSecret();GetUserWorkloadsSecretHttp
Section titled “GetUserWorkloadsSecretHttp”Source:
src/GCP/Composer/GetUserWorkloadsSecretHttp.tsKind: Layer · Provides:GCP.Composer.GetUserWorkloadsSecret
HTTP implementation of GetUserWorkloadsSecret.