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

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:

1deployment:
2 configuration:
3 name: test
4 description: ""
5 runtime_version: 12.0.0
6 dag_deploy_enabled: true
7 ci_cd_enforcement: false
8 scheduler_size: SMALL
9 is_high_availability: false
10 is_development_mode: false
11 executor: CELERY
12 scheduler_count: 1
13 workspace_name: Demo Workspace
14 deployment_type: STANDARD
15 cloud_provider: AZURE
16 region: westus2
17 default_task_pod_cpu: "0.25"
18 default_task_pod_memory: 0.5Gi
19 resource_quota_cpu: "10"
20 resource_quota_memory: 20Gi
21 workload_identity: ""
22 worker_queues:
23 - name: default
24 max_worker_count: 10
25 min_worker_count: 0
26 worker_concurrency: 5
27 worker_type: A5
28 metadata:
29 deployment_id: cm0cvxk2r000108jt6vdw9sg2
30 workspace_id: cm0cvy04p000308jt62nze0hc
31 cluster_id: N/A
32 release_name: N/A
33 airflow_version: 2.10.0
34 current_tag: 12.0.0
35 status: CREATING
36 created_at: 2024-08-23T20:00:40.72Z
37 updated_at: 2024-08-23T20:00:40.72Z
38 deployment_url: cloud.astronomer.io/cm0cvyx0m000408jt112i7aax/deployments/cm0cvz60c000508jtbgnrese4/overview
39 webserver_url: org-astro-dev-ex.astronomer.run/cm0cvzely000608jt5v5p27bo
40 airflow_api_url: org-astro-dev-ex.astronomer.run/cm0cvzowp000708jt2r7662bm/api/v1
41 alert_emails:
42 - test-emailclskz4wu5000508jz4gm25q5j@testdomain
43 hibernation_schedules:
44 - hibernate_at: 1 * * * *
45 wake_at: 2 * * * *
46 description: hibernation schedule 1
47 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:

1 - is_secret: true
2 key: PROJECT_NAME
3 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.

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

  • 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.
  • cluster_name is the name for the cluster that appears in the Astro UI.