Resource: yet_cloud_application_resource
An application's own database — Overlite, Postgres or Redis — its add-on: run beside it on each of its stages, each stage's its own, and handed to it in a variable.
Note: For one database that several applications share, make it an environment's — yet_cloud_database — and attach it with yet_cloud_database_attachment.
Note: Destroyed, it stops at the agents' next look — its volume stays on each server. Back it up first with the yet_cloud_database_backup action.
Example Usage
# A Postgres of the API's own, on each of its stages.
resource "yet_cloud_application_resource" "db" {
application_id = yet_cloud_application.api.id
kind = "postgres"
features = ["pgvector"]
memory_mb = 1024
}
# A cache beside each copy of it, on every member of a pool.
resource "yet_cloud_application_resource" "cache" {
application_id = yet_cloud_application.api.id
kind = "redis"
env_var = "CACHE_URL"
placement = "member"
features = ["volatile"]
}Schema
Required
application_id(String) The application it is of.kind(String)overlite,postgresorredis.
Optional
env_var(String) The variable the application is handed its address in — capitals, digits and underscores:DATABASE_URLfor Overlite and Postgres,REDIS_URLfor Redis, unless set.features(Set of String) What it runs with:pgvectorfor Postgres;volatile,evictfor Redis.memory_mb(Number) The memory it may use, in MB: 128 to 65536, or0for no limit.placement(String) On a pool:shared— one, on its first member — ormember, one on each. Overlite and Postgres are shared, Redis each member's, unless set.stopped(Boolean) Whether it is stopped: kept, not running.studio_read_only(Boolean) Whether the studio only reads.studio_role(String) Who opens it in Cloud's studio:viewer,developeroradmin.version(String) The version it runs; the newest unless set.
Read-Only
id(String) The ID of this resource.image(String) The image it runs.
Import
In Terraform v1.5.0 and later, with an import block:
import {
to = yet_cloud_application_resource.db
id = "01J9Z8K3V7Q2M4N6P8R0S2T4V6"
}With terraform import:
terraform import yet_cloud_application_resource.db 01J9Z8K3V7Q2M4N6P8R0S2T4V6