Resource: yet_cloud_database
An environment's database — Overlite, Postgres or Redis — run there for the applications attached to it.
Note: Destroyed, it stops — its volume stays on the server. Back it up first with the yet_cloud_database_backup action.
Example Usage
resource "yet_cloud_database" "orders" {
kind = "postgres"
name = "orders"
environment_id = yet_cloud_environment.production.id
features = ["pgvector"]
memory_mb = 1024
}
# An Overlite on a runtime of the company's, copied every 6 hours, the last 14 kept.
resource "yet_cloud_database" "ledger" {
kind = "overlite"
name = "ledger"
environment_id = yet_cloud_environment.production.id
backup_every = 6
backup_keep = 14
}Schema
Required
environment_id(String) The environment it runs in.kind(String)overlite,postgresorredis.name(String) Its name in the environment: lowercase letters, digits and dashes, up to 32, starting with a letter.
Optional
backup_every(Number) How often it is copied, in hours: 1 to 168, or0for never. Copies are kept for an Overlite on a runtime of the company's.backup_keep(Number) How many of its copies are kept, the newest: 1 to 365. Cloud keeps 7 while it is0, never set.features(Set of String) What it runs with:pgvectorfor Postgres;volatile,evictfor Redis.hostname(String) Its name on the edge, when it answers outside.memory_mb(Number) The memory it may use, in MB.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
backup_target(String) Where its copies go: yet's bucket ("") or the company's own (company) — chosen in Yet's apps, as it takes the AWS key the company's Settings keep.env_var(String) The variable attached applications find it in.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_database.orders
id = "01J9Z8K3V7Q2M4N6P8R0S2T4V6"
}With terraform import:
terraform import yet_cloud_database.orders 01J9Z8K3V7Q2M4N6P8R0S2T4V6