Skip to main content

Deployment file reference

After you create an Astro Deployment, you can use the Astro CLI to create a Deployment file that contains its unique configurations represented as code. That includes worker queues, environment variables, Astro Runtime version, and more. You can use Deployment files to manage Deployments programmatically on Astro.

When you inspect a Deployment to generate a Deployment file, its current configuration is generated as a YAML Deployment file. The file includes the name, description, and metadata that is unique to the Deployment.

A Deployment template file is different from the Deployment file. A template file does not have the metadata and environment_variables section, and the name and description fields are empty. Deployment template files are used to create new Deployments, while a Deployment file of an existing Deployment can be used to update its configuration. To create a Deployment template file in YAML format, run astro deployment inspect <your-deployment-id> --template > your-deployment.yaml.

Use this document as a reference for all fields in both Deployment files and Deployment template files.

Deployment file example

info

To see the minimum values required to create a Deployment using a template file, see Create a Deployment using a template file.

The following is an example Deployment file for Astro Hosted:

deployment:
configuration:
name: test
description: ""
runtime_version: 12.0.0
dag_deploy_enabled: true
ci_cd_enforcement: false
scheduler_size: SMALL
is_high_availability: false
is_development_mode: false
executor: CELERY
scheduler_count: 1
workspace_name: Demo Workspace
deployment_type: STANDARD
cloud_provider: AZURE
region: westus2
default_task_pod_cpu: "0.25"
default_task_pod_memory: 0.5Gi
resource_quota_cpu: "10"
resource_quota_memory: 20Gi
workload_identity: ""
worker_queues:
- name: default
max_worker_count: 10
min_worker_count: 0
worker_concurrency: 5
worker_type: A5
metadata:
deployment_id: cm0cvxk2r000108jt6vdw9sg2
workspace_id: cm0cvy04p000308jt62nze0hc
cluster_id: N/A
release_name: N/A
airflow_version: 2.10.0
current_tag: 12.0.0
status: CREATING
created_at: 2024-08-23T20:00:40.72Z
updated_at: 2024-08-23T20:00:40.72Z
deployment_url: cloud.astronomer.io/cm0cvyx0m000408jt112i7aax/deployments/cm0cvz60c000508jtbgnrese4/overview
webserver_url: org-astro-dev-ex.astronomer.run/cm0cvzely000608jt5v5p27bo
airflow_api_url: org-astro-dev-ex.astronomer.run/cm0cvzowp000708jt2r7662bm/api/v1
alert_emails:
- test-emailclskz4wu5000508jz4gm25q5j@testdomain
hibernation_schedules:
- hibernate_at: 1 * * * *
wake_at: 2 * * * *
description: hibernation schedule 1
enabled: true

The following sections describe configuration options for your Deployment file:

deployment.environment_variables

You can create, update, or delete environment variables in the environment_variables section of the template file. This is equivalent to configuring environment variables in the Deployment's Environment Variables tab in your Deployment's Environment settings. Each variable in this section must include a key and a value.

By default, each variable is created as a non-secret variable. To set any new or existing environment variables as secret, specify is_secret: true in the same section as the key and value. For example:

 - is_secret: true
key: PROJECT_NAME
value: test_project

When you inspect a Deployment, the value of secret environment variables do not appear in the Deployment file.

To delete an environment variable, remove the lines that contain its key, its value, and other associated fields. Then, reapply the file to the Deployment. Any variables that exist on the Deployment, but are not included in the most recently applied Deployment file, are deleted.

If you commit a template file to a GitHub repository, do not add secret environment variables in the file. Instead, add them manually in the Astro UI. This ensures that you do not commit secret values to a version control tool in plain-text.

warning

When you add environment variables using a Deployment file, you must provide a value for your environment variable. Leaving this value blank or as an empty string ("") will cause the astro deployment create command to fail.

deployment.configuration

The configuration section contains all of the basic settings that you can configure from the Deployment Details page in the Astro UI. See:

deployment.worker_queues

The worker_queues section defines the worker queues for Deployments that use the Celery executor. This section is not applicable to Deployments that use Kubernetes executor.

If you don't enter specific values for the default worker queue for a Deployment, Astro uses default values based on the worker types available on your cluster. Each additional worker queue must include a name and worker_type. The Astro CLI uses default values for any other unspecified fields.

Other fields

  • scheduler_size and is_high_availability are not applicable to Astro Hybrid.
  • deployment_type can be HOSTED_SHARED or HOSTED_DEDICATED for Astro Hosted depending on your cluster type. Use HOSTED_SHARED for standard clusters and HOSTED_DEDICATED for dedicated clusters. For Astro Hybrid, the only option is HYBRID.
  • cluster_name is the name for the cluster that appears in the Astro UI for Astro Hosted and Hybrid.

Was this page helpful?