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

The following is an example Deployment file that includes all possible key-value pairs for Astro Hosted:

deployment:
environment_variables:
- is_secret: false
key: PROJECT_NAME
updated_at: "2023-06-22T14:02:26.281Z"
value: test_project
- is_secret: true
key: API_KEY
updated_at: "2023-06-22T14:02:27.892Z"
value: ""
configuration:
name: test-standard
description: ""
runtime_version: 10.3.0
dag_deploy_enabled: true
ci_cd_enforcement: false
scheduler_size: SMALL
is_high_availability: false
executor: CELERY
cluster_name: "" ## Only used when deployment_type is DEDICATED
workspace_name: least-permission
deployment_type: STANDARD
cloud_provider: gcp
region: us-east4
default_task_pod_cpu: "0.25"
default_task_pod_memory: 0.5Gi
resource_quota_cpu: "10"
resource_quota_memory: 20Gi
default_worker_type: m5.xlarge ## Only used when executor is KUBERNETES
is_development_mode: true
hibernation_schedules:
- hibernate_at: "1 * * * * "
wake_at: "2 * * * *"
description: "My hibernation description"
enabled: true
workload_identity: arn:aws:iam::clskz0os1000308jz2prn0s8u:role/clskyy4h8000208jz60olha0w-release
worker_queues: ## worker_queues only used when executor is CELERY
- name: default
max_worker_count: 10
min_worker_count: 0
worker_concurrency: 5
worker_type: A5
alert_emails:
- test-emailclskz4wu5000508jz4gm25q5j@testdomain.io

The following sections describe each section in the 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 Variables page of a Deployment in the Astro UI. 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?

Sign up for Developer Updates

Get a summary of new Astro features once a month.

You can unsubscribe at any time.
By proceeding you agree to our Privacy Policy, our Website Terms and to receive emails from Astronomer.