Skip to content

frostmoln_postgres_instance (Resource)

Manages a managed PostgreSQL database instance in the Frostmoln platform.

Example Usage

terraform
resource "frostmoln_postgres_instance" "main" {
  name       = "app-db"
  version    = "16"
  flavor_id  = "db.gp1.small"
  storage_gb = 50
  vpc_id     = frostmoln_vpc.main.id
  subnet_id  = frostmoln_subnet.db.id

  backup_enabled        = true
  backup_schedule       = "0 2 * * *"
  backup_retention_days = 35
}

output "postgres_endpoint" {
  value = "${frostmoln_postgres_instance.main.private_ip}:${frostmoln_postgres_instance.main.port}"
}

Schema

Required

  • flavor_id (String) The flavor ID/size for the database instance (e.g. "db.gp1.small", "db.gp1.medium").
  • name (String) The name of the PostgreSQL instance.
  • storage_gb (Number) The storage size in gigabytes. Can be increased in place (online resize); decreasing it is not supported.
  • subnet_id (String) The subnet ID where the database instance will be deployed.
  • version (String) The PostgreSQL version (e.g. "15", "16").
  • vpc_id (String) The VPC ID where the database instance will be deployed.

Optional

  • backup_enabled (Boolean) Whether automated backups are enabled.
  • backup_retention_days (Number) Number of days to retain backups. Minimum 35 (backups are immutably object-locked for 35 days); maximum 90. Defaults to 35 server-side.
  • backup_schedule (String) Cron expression for the backup schedule. Defaults to "0 2 * * *" server-side.
  • ha_enabled (Boolean) Whether high availability is enabled with a standby replica.
  • parameter_group_id (String) The ID of the parameter group to apply to the instance.

Read-Only

  • admin_username (String) The admin username for the PostgreSQL instance.
  • created_at (String) The timestamp when the instance was created.
  • id (String) The unique identifier of the PostgreSQL instance.
  • port (Number) The port number the PostgreSQL instance is listening on.
  • private_ip (String) The private IP address of the PostgreSQL instance.
  • public_ip (String) The public IP address, if assigned.
  • status (String) The current status of the PostgreSQL instance.
  • tenant_id (String) The tenant ID that owns this instance.
  • updated_at (String) The timestamp when the instance was last updated.