Interpolation Variables
Greyhound resolves ${variable} placeholders inside both .greyhound/config.yaml and .greyhound/applications.yaml before schemas are validated. These variables originate from the deployment context and are injected by createAppFromYaml / createAppImportsFromYaml via deepStringInterpolate.
Use ${variable} anywhere a string value is accepted (service env vars, image tags, repository references, etc.). Interpolation runs before TypeBox validation, so the resolved values must satisfy the underlying schema.
Static Variables
| Variable | Description |
|---|---|
${cluster.account.accountId} | AWS account ID for the cluster handling the deployment. |
${cluster.context} | Kubernetes context/identifier for the target cluster. |
${cluster.dnsDomain} | Default DNS domain configured on the cluster (empty string if undefined). |
${commit.sha} | Full SHA of the commit used for this deployment (may be per-service). |
${commit.branch} | Branch name for the commit (may be null when deploying by tag). |
${commit.tag} | Tag name for the commit (may be null when deploying by branch). |
${commit.tag_or_branch} | Tag when available, otherwise branch -- handy for generic labels. |
${env.name} | greyhound environment name receiving the deployment. |
Database Cluster Variables
For each Aurora cluster attached to the environment, the following variables are exposed:
${database.<poolName|index>.writer_endpoint}
${database.<poolName|index>.host}
${database.<poolName|index>.port}
${database.<poolName|index>.reader_endpoint}
<poolName>resolves to the Aurora pool name when the cluster was checked out from a pool.- If no pool name is available, a zero-based
<index>is used instead. ${...}.hostreturns the same string as${...}.writer_endpoint; the alias remains for compatibility, but preferwriter_endpointwhen you want to highlight write access.
These entries are ideal for constructing database URLs, connection strings, or injecting host/port data into app configs.
Where Interpolation Applies
| File | Notes |
|---|---|
.greyhound/config.yaml | App schema fields (services, jobs, builds, configmaps, etc.) can reference interpolation variables. |
.greyhound/applications.yaml | Application import fields (repositories, config sources, optional app names, environment overrides, etc.) also support interpolation. |
Example Usage
# .greyhound/config.yaml
services:
- name: api
image: 123456789012.dkr.ecr.us-east-1.amazonaws.com/api:${commit.sha}
env:
- name: CLUSTER_CONTEXT
value: ${cluster.context}
- name: FEATURE_FLAG
value: ${commit.tag_or_branch}
- name: DB_HOST
value: ${database.prod-write.writer_endpoint}
- name: DB_PORT
value: ${database.prod-write.port}
- name: DB_USER
valueFrom:
secretKeyRef:
name: db-credentials
key: username
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: db-credentials
key: password
# Kubernetes evaluates $(VAR_NAME) substitutions after interpolation
- name: DATABASE_URL
value: postgres://$(DB_USER):$(DB_PASSWORD)@$(DB_HOST):$(DB_PORT)/app