Environment Variables
Your application receives configuration through environment variables. SKE assembles these from multiple sources with a defined precedence order.
Sources of environment variables
Section titled “Sources of environment variables”- Secrets — set via
ske secret set, stored encrypted in your cloud provider. These take highest precedence. - ske.yml
envblock — environment-specific variables defined in your config file. Good for non-sensitive, environment-varying config. - Runtime defaults — SKE sets standard variables for the runtime (database connection strings, cache endpoints, queue URLs) based on your provisioned infrastructure.
- Framework defaults — the Laravel runtime sets sensible defaults like
LOG_CHANNEL=stderrandSESSION_DRIVER=cookie.
Precedence
Section titled “Precedence”Secrets override everything. If you set DB_HOST as a secret and it also appears in ske.yml or as a runtime default, the secret value wins.
Secrets > ske.yml env > Runtime defaults > Framework defaultsDefining variables in ske.yml
Section titled “Defining variables in ske.yml”name: my-appenvironments: production: env: APP_DEBUG: "false" CACHE_DRIVER: "redis" QUEUE_CONNECTION: "sqs" staging: env: APP_DEBUG: "true" CACHE_DRIVER: "array"These are committed to version control, so don’t put sensitive values here. Use secrets for anything that should stay private.
Runtime-injected variables
Section titled “Runtime-injected variables”SKE automatically sets environment variables based on your provisioned infrastructure:
| Variable | Source | Example |
|---|---|---|
DB_HOST |
Attached database | my-db.abc123.us-east-1.rds.amazonaws.com |
DB_PORT |
Attached database | 3306 |
DB_DATABASE |
Attached database | my_app |
DB_USERNAME |
Attached database | ske_admin |
DB_PASSWORD |
Attached database | (auto-generated) |
CACHE_HOST |
Attached cache | my-cache.abc123.cache.amazonaws.com |
CACHE_PORT |
Attached cache | 6379 |
SQS_PREFIX |
Queue configuration | https://sqs.us-east-1.amazonaws.com/123456789012 |
SQS_QUEUE |
Queue configuration | my-app-production-default |
These are set automatically when you attach a database, cache, or configure queues for an environment. You don’t need to set them manually.
Secrets vs. environment variables
Section titled “Secrets vs. environment variables”| Use a secret when… | Use ske.yml env when… |
|---|---|
| The value is sensitive (passwords, API keys) | The value is not sensitive |
| The value differs between local and deployed | The value is tied to the environment config |
| The value should not be in version control | The value should be reviewed in PRs |
| The value changes independently of deploys | The value changes with code |
Common variables to set as secrets
Section titled “Common variables to set as secrets”ske secret set APP_KEYske secret set DB_PASSWORDske secret set MAIL_PASSWORDske secret set AWS_ACCESS_KEY_IDske secret set AWS_SECRET_ACCESS_KEYske secret set STRIPE_SECRETske secret set SENTRY_DSN