Skip to content

Create a database instance.

POST
/v1/projects/{projectId}/db/instances
Code sample: Shell / cURL
curl --request POST \
--url https://stratum.example.com/v1/projects/example/db/instances \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "engine": "postgres", "engineVersion": "example", "instanceClass": "example", "allocatedStorage": 1, "maxAllocatedStorage": 1, "storageClass": "example", "multiAZ": false, "availabilityZone": "example", "dbSubnetGroupName": "example", "dbParameterGroupName": "example", "vpcSecurityGroupIds": [ "example" ], "masterUsername": "example", "masterUserPassword": "example", "backupRetentionPeriod": 7, "preferredBackupWindow": "example", "preferredMaintenanceWindow": "example", "autoMinorVersionUpgrade": true, "deletionProtection": false, "publiclyAccessible": false, "extensions": [ "example" ], "tags": { "additionalProperty": "example" } }'

Records the desired state and returns 202 with the row in creating; the db reconciler (ScopeLeader, 30 s) builds the engine VM in the operator sibling project p-system-db, the data volume, the endpoint in the customer VPC and the master secret, then flips the row to available. The subnet group and parameter group must exist in the project; engineVersion must be published (GET /v1/db/engine-versions); instanceClass must be an active class. Counted against db.instances.count and db.storage_bytes. publiclyAccessible: true is refused at 2.0. Cedar-gated on db:CreateDBInstance.

projectId
required
string
/^p-[a-z0-9-]+$/
Media typeapplication/json
object
name
required
string
/^[a-z][a-z0-9-]{1,38}[a-z0-9]$/
engine
required
string
Allowed values: postgres
engineVersion
required

16 (latest published minor) or an exact 16.4 from GET /v1/db/engine-versions.

string
instanceClass
required
string
allocatedStorage
required

GiB.

integer
>= 20 <= 16384
maxAllocatedStorage
integer
nullable
storageClass

One of the operator’s tiers; the default class when omitted.

string
multiAZ
boolean
availabilityZone

Placement preference for the primary; must be one of the subnet group’s AZs.

string
dbSubnetGroupName
required
string
dbParameterGroupName

Defaults to default.postgres<major>.

string
vpcSecurityGroupIds
Array<string>
masterUsername
required

postgres and the pg_ prefix are the engine’s and refused.

string
/^[a-z][a-z0-9_]{0,62}$/
masterUserPassword

Optional. Omitted: the service generates the password into the instance’s master secret and rotates it monthly on a db_master schedule it keeps on that secret. Given: the password is yours and is never rotated automatically (the RDS model) — it changes only when you change it: actions/rotate-master-credential rotates it once, and a schedule you set on the secret (stratumctl secrets rotation set <secret-id> --type db_master --target <db-instance-id> --cron '0 3 1 * *') rotates it on yours. 8–128 printable ASCII characters without /, @, " or a space. Never returned.

string
>= 8 characters <= 128 characters
backupRetentionPeriod
integer
default: 7 >= 1 <= 35
preferredBackupWindow
string
preferredMaintenanceWindow
string
autoMinorVersionUpgrade
boolean
default: true
deletionProtection
boolean
publiclyAccessible

Refused when true at 2.0.

boolean
extensions

The curated extensions the service creates in every database of this instance (supportedExtensions on the engine version): the untrusted ones the master role cannot create itself. An extension that needs a shared_preload_libraries entry the parameter group does not carry is refused here.

Array<string>
tags
object
key
additional properties
string

Accepted — the instance is creating.

Media typeapplication/json

A Stratum Database instance. The customer sees the resource and its endpoint; the engine VMs live in the operator sibling project p-system-db and are never listed here.

object
id
required

db-…

string
arn
required

arn:stratum:db:<region>:<projectId>:db-instance/<id>

string
projectId
required
string
name
required

Unique among the project’s live instances; also the DNS label’s base.

string
engine
required
string
Allowed values: postgres
engineVersion
required

The exact major.minor running (16.4); a create may ask for "16" and gets the latest published minor.

string
instanceClass
required

db.<family>.<size> from GET /v1/db/instance-classes.

string
allocatedStorage
required

GiB of the dedicated data volume; grows online, never shrinks.

integer
maxAllocatedStorage

Storage autoscaling ceiling in GiB; null = off.

integer
nullable
storageClass
required
string
storageEncrypted
required
boolean
multiAZ
required
boolean
multiAZStatus

Only when multiAZ: building until the standby streams, synced while it streams within the lag threshold (the primary waits for it on every commit), degraded while it is absent or behind (the primary commits asynchronously; the standby is rebuilt) — also right after a failover, until the vacated side is rebuilt.

string
nullable
Allowed values: synced degraded building
availabilityZone
string
nullable
secondaryAvailabilityZone
string
nullable
dbSubnetGroupName
required
string
dbParameterGroupName
required
string
vpcSecurityGroupIds
required

The customer’s one network knob — security groups on the endpoint port.

Array<string>
endpoint

The instance’s endpoint in the customer VPC; null until the endpoint address exists.

object
address

db-<id>.db.<region>.<parentDomain>, resolving to ip inside the VPC; empty until the name is published.

string
ip

The VPC-internal VIP — an address in the subnet group’s subnet that follows the primary across failover and blue/green.

string
port
integer
masterUsername
required
string
masterUserSecret

Where the master password lives — a secret in the customer’s project, readable by whoever the project’s IAM says and by the engine’s service account through the resource policy the service keeps on it. A password the service generated rotates monthly on the secret’s db_master schedule; one given as masterUserPassword at create is never rotated automatically, only by actions/rotate-master-credential or a schedule the customer sets. rotating while a rotation (scheduled, or actions/rotate-master-credential) is in flight.

object
secretArn
string
status
string
Allowed values: creating active rotating
backupRetentionPeriod
required

Days, 1..35.

integer
preferredBackupWindow
required

HH:MM-HH:MM UTC.

string
preferredMaintenanceWindow
required

ddd:HH:MM-ddd:HH:MM UTC.

string
autoMinorVersionUpgrade
required

“Keep me current”: the pending maintenance actions — a newer minor of the major AND a newer engine image behind the current version — apply in the maintenance window on their own. Off: they are listed on pendingMaintenanceActions and wait for an opt-in.

boolean
deletionProtection
required
boolean
publiclyAccessible
required

Always false at 2.0.

boolean
status
required

The RDS vocabulary mapped onto the reconciler’s phases.

string
Allowed values: creating available modifying backing-up rebooting failing-over upgrading storage-full resetting-master-credentials restore-error unavailable deleting failed
statusReason
string
nullable
backend

The service-owned engine backend in p-system-db (operator view only; null for tenants)..

object
groupId

The auto scaling group of engine VMs.

string
volumeId

The data volume.

string
instanceId

The current primary engine VM.

string
privateIp

The engine VM’s address on the backend network.

string
endpointNicId

The Stratum-owned port in the customer’s subnet the engine VM carries as its second interface (as amended).

string
endpointVipId

The network service VIP fronting the endpoint port — endpoint.ip is its address; failover and blue/green re-point it.

string
standby

The standby member of a Multi-AZ instance — its own VM, data volume and endpoint port; absent on single-AZ.

object
instanceId
string
volumeId
string
privateIp
string
endpointNicId
string
projectId

The operator sibling project the engine VMs and the backup bucket live in.

string
walBucketId

The bucket holding this instance’s snapshots and WAL archive. It is the SERVICE’s bucket, in the sibling project — a tenant cannot open it, which is why it is here and not on the tenant’s view.

string
walBucketName
string
agentSeenAt
string format: date-time
nullable
agentState

The engine state the agent last reported.

string
agentVersion

The db-agent version the engine VM is running.

string
pendingModifiedValues
required

Disruptive changes waiting for the maintenance window: instanceClass, engineVersion, multiAZ, plus applyImmediately while the customer asked for them now. Readable until the reconciler has applied them — the row’s own fields flip when the replacement engine reports from the target, never before. Empty ({}) when nothing is pending.

object
key
additional properties
any
pendingMaintenanceActions
required

What the operator’s catalog holds that this instance does not run yet: a newer minor of its major, a newer image behind its version. Empty when the instance is current. Applied in the maintenance window with autoMinorVersionUpgrade, or on an opt-in.

Array<object>

One thing the operator’s engine catalog holds that this instance does not run yet. Observed by the reconciler every pass on a live engine; applied in the maintenance window when autoMinorVersionUpgrade is on or the customer opted in (actions/apply-pending-maintenance).

object
action
required

db-upgrade — a newer published minor of the instance’s major; system-update — a newer engine image behind its current version (OS and agent updates, a rebuilt engine).

string
Allowed values: db-upgrade system-update
description
required
string
engineVersion

The db-upgrade target minor.

string
imageId

The system-update image (operator view only).

string
optInStatus

The customer’s opt-in on this action, when any.

string
Allowed values: immediate next-maintenance
autoApply
required

Whether the action applies in the next maintenance window without further action.

boolean
parameterApplyStatus

The engine’s word on its parameter group: pending-reboot when a static parameter changed and waits for a restart — the next maintenance window, a reboot, or a modify with applyImmediately. Absent until the engine has reported.

string
Allowed values: in-sync pending-reboot failed
blueGreenId

The blue/green deployment this instance belongs to, whichever side it is on; absent when it has none. A client can tell from a LIST — with no call per row — that the shape-changing actions (modify, delete, credential rotation) are refused while a deployment is live.

string
blueGreenRole

Which copy this is: blue the customer’s own instance a live deployment deploys FROM, green the copy being built, old the retained former blue after a switchover. Absent with blueGreenId.

string
Allowed values: blue green old
blueGreenStatus

The deployment’s status, so a list can say one is running without a second call.

string
parameterApplyError

Why the engine did NOT apply its parameter group — a shared_preload_libraries entry whose library the running engine image does not carry. The engine keeps serving the configuration it has; parameterApplyStatus is failed while this is set.

string
nullable
extensions

The curated extensions the service keeps in this instance’s databases. The master role is never superuser, so an untrusted extension — pg_stat_statements and the rest of GET /v1/db/engine-versions’ supportedExtensions — is created by the service, in every database and in template1 so a new database inherits it. A TRUSTED extension (pg_trgm, citext, pgcrypto…) is not listed here: the master role creates those itself. Removing one drops it, unless something depends on it.

Array<string>
extensionApplyStatus

The engine’s word on extensions: in-sync once every one exists everywhere it belongs, applying while it does not, failed with extensionApplyError when the engine refused one. Absent until the engine has reported.

string
Allowed values: in-sync applying failed
extensionApplyError

The engine’s own words for an extension it would not create or drop (most often a drop something depends on).

string
nullable
latestRestorableTime

How far the continuous WAL archive reaches — the newest point a point-in-time restore can target. Null until the first segment is archived.

string format: date-time
nullable
tags
required
object
key
additional properties
string
createdBy
required
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time

Example

{
"engine": "postgres",
"multiAZStatus": "synced",
"masterUserSecret": {
"status": "creating"
},
"status": "creating",
"pendingMaintenanceActions": [
{
"action": "db-upgrade",
"optInStatus": "immediate"
}
],
"parameterApplyStatus": "in-sync",
"blueGreenRole": "blue",
"extensionApplyStatus": "in-sync"
}

Bad request.

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance
string format: uri-reference
requestId
required
string
code
required
string
issues

The findings of a rejected IAM policy document (custom and resource policies).

Array<object>

One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.

object
code
required

The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.

string
statement
required

Index of the statement at fault; -1 for the document as a whole.

integer
>= -1
detail
required
string
action

The offending action, where one is at fault (ACTION_NOT_APPLICABLE).

string
errors

Field errors, for codes that carry them: each problem at its field (see FieldError). Documented on the responses that set it, e.g. approveNodeJoin’s INVALID_INPUT and JOIN_APPROVAL_REFUSED. Absent otherwise.

Array<object>

One field’s problem, the stage-2 installer API’s shape. field is the field’s path, message what is wrong with it.

object
field
required

The field’s path, e.g. links[0].interface, disks[1].confirm, mgmt.address or role; empty for the whole request.

string
message
required
string
details

Structured facts about the refusal, for codes that carry them. The shape is fixed per code and documented on the response that answers it, e.g. IMAGE_POOL_MISMATCH (see ImagePoolMismatchDetails) and IMAGE_IN_USE. Absent for codes that carry none.

object
key
additional properties
any

Example

{
"issues": [
{
"code": "ACTION_NOT_APPLICABLE",
"action": "compute:CreateVpc"
}
]
}

Authenticated but not authorized.

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance
string format: uri-reference
requestId
required
string
code
required
string
issues

The findings of a rejected IAM policy document (custom and resource policies).

Array<object>

One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.

object
code
required

The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.

string
statement
required

Index of the statement at fault; -1 for the document as a whole.

integer
>= -1
detail
required
string
action

The offending action, where one is at fault (ACTION_NOT_APPLICABLE).

string
errors

Field errors, for codes that carry them: each problem at its field (see FieldError). Documented on the responses that set it, e.g. approveNodeJoin’s INVALID_INPUT and JOIN_APPROVAL_REFUSED. Absent otherwise.

Array<object>

One field’s problem, the stage-2 installer API’s shape. field is the field’s path, message what is wrong with it.

object
field
required

The field’s path, e.g. links[0].interface, disks[1].confirm, mgmt.address or role; empty for the whole request.

string
message
required
string
details

Structured facts about the refusal, for codes that carry them. The shape is fixed per code and documented on the response that answers it, e.g. IMAGE_POOL_MISMATCH (see ImagePoolMismatchDetails) and IMAGE_IN_USE. Absent for codes that carry none.

object
key
additional properties
any

Example

{
"issues": [
{
"code": "ACTION_NOT_APPLICABLE",
"action": "compute:CreateVpc"
}
]
}

Conflicting state.

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance
string format: uri-reference
requestId
required
string
code
required
string
issues

The findings of a rejected IAM policy document (custom and resource policies).

Array<object>

One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.

object
code
required

The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.

string
statement
required

Index of the statement at fault; -1 for the document as a whole.

integer
>= -1
detail
required
string
action

The offending action, where one is at fault (ACTION_NOT_APPLICABLE).

string
errors

Field errors, for codes that carry them: each problem at its field (see FieldError). Documented on the responses that set it, e.g. approveNodeJoin’s INVALID_INPUT and JOIN_APPROVAL_REFUSED. Absent otherwise.

Array<object>

One field’s problem, the stage-2 installer API’s shape. field is the field’s path, message what is wrong with it.

object
field
required

The field’s path, e.g. links[0].interface, disks[1].confirm, mgmt.address or role; empty for the whole request.

string
message
required
string
details

Structured facts about the refusal, for codes that carry them. The shape is fixed per code and documented on the response that answers it, e.g. IMAGE_POOL_MISMATCH (see ImagePoolMismatchDetails) and IMAGE_IN_USE. Absent for codes that carry none.

object
key
additional properties
any

Example

{
"issues": [
{
"code": "ACTION_NOT_APPLICABLE",
"action": "compute:CreateVpc"
}
]
}

Request rate limit exceeded. The API-boundary throttle caps request throughput per principal and per project; code is RATE_LIMITED (distinct from the quota engine’s QUOTA_EXCEEDED). The Retry-After header carries the seconds to wait. Applies to any authenticated endpoint — it is enforced by middleware, not per-path.

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance
string format: uri-reference
requestId
required
string
code
required
string
issues

The findings of a rejected IAM policy document (custom and resource policies).

Array<object>

One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.

object
code
required

The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.

string
statement
required

Index of the statement at fault; -1 for the document as a whole.

integer
>= -1
detail
required
string
action

The offending action, where one is at fault (ACTION_NOT_APPLICABLE).

string
errors

Field errors, for codes that carry them: each problem at its field (see FieldError). Documented on the responses that set it, e.g. approveNodeJoin’s INVALID_INPUT and JOIN_APPROVAL_REFUSED. Absent otherwise.

Array<object>

One field’s problem, the stage-2 installer API’s shape. field is the field’s path, message what is wrong with it.

object
field
required

The field’s path, e.g. links[0].interface, disks[1].confirm, mgmt.address or role; empty for the whole request.

string
message
required
string
details

Structured facts about the refusal, for codes that carry them. The shape is fixed per code and documented on the response that answers it, e.g. IMAGE_POOL_MISMATCH (see ImagePoolMismatchDetails) and IMAGE_IN_USE. Absent for codes that carry none.

object
key
additional properties
any

Example

{
"issues": [
{
"code": "ACTION_NOT_APPLICABLE",
"action": "compute:CreateVpc"
}
]
}
Retry-After
integer

Seconds to wait before retrying.

Upstream temporarily unavailable (driver / scheduler / dependency).

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance
string format: uri-reference
requestId
required
string
code
required
string
issues

The findings of a rejected IAM policy document (custom and resource policies).

Array<object>

One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.

object
code
required

The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.

string
statement
required

Index of the statement at fault; -1 for the document as a whole.

integer
>= -1
detail
required
string
action

The offending action, where one is at fault (ACTION_NOT_APPLICABLE).

string
errors

Field errors, for codes that carry them: each problem at its field (see FieldError). Documented on the responses that set it, e.g. approveNodeJoin’s INVALID_INPUT and JOIN_APPROVAL_REFUSED. Absent otherwise.

Array<object>

One field’s problem, the stage-2 installer API’s shape. field is the field’s path, message what is wrong with it.

object
field
required

The field’s path, e.g. links[0].interface, disks[1].confirm, mgmt.address or role; empty for the whole request.

string
message
required
string
details

Structured facts about the refusal, for codes that carry them. The shape is fixed per code and documented on the response that answers it, e.g. IMAGE_POOL_MISMATCH (see ImagePoolMismatchDetails) and IMAGE_IN_USE. Absent for codes that carry none.

object
key
additional properties
any

Example

{
"issues": [
{
"code": "ACTION_NOT_APPLICABLE",
"action": "compute:CreateVpc"
}
]
}