rds.replication-slots.create

Declare a logical slot (pgoutput); on a cluster it is kept on every member

POST /rds/api/instances/{id}/replication-slotsIAM rds:CreateDBReplicationSlotChanges state

Needs logicalReplication on. Connect the consumer to port 5432 (direct, not the pooler) with a role that has REPLICATION, e.g. the master user. An inactive slot holds WAL until max_slot_wal_keep_size invalidates it; the health check warns from 1 GiB.

Request syntax

POST /rds/api/instances/{id}/replication-slots
{
  "name": "string",
  "database": "string",
  "plugin": "enum"
}

Path parameters

  • idRequired

    string

    Constraints: 3-64 chars, /^(?!ewdoc-)[a-z0-9-]+$/

Request body

  • nameRequired

    string

    Slot name: a-z, 0-9, _; starts with a letter

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

  • databaseRequired

    string

    The database the slot decodes

    Constraints: 1-63 chars

  • pluginOptional

    enum

    Output plugin

    One of: pgoutput

    Default: "pgoutput"

Response

201 with { slot, declared }: the slot as the leader shows it (null if not created yet) and the declaration (name, database, plugin).

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Fields of data

  • slotAlways

    object, may be null

    The slot as the leader shows it; null: not created yet
  • slot.​nameAlways

    string

    Slot name
  • slot.​databaseAlways

    string, may be null

    Database the slot decodes
  • slot.​pluginAlways

    string, may be null

    Output plugin, e.g. pgoutput
  • slot.​managedAlways

    boolean

    Declared through the API (kept on every member), or made in SQL
  • slot.​activeAlways

    boolean

    A consumer is reading it now
  • slot.​activePidAlways

    number, may be null

    Server process of that consumer
  • slot.​temporaryAlways

    boolean

    Dropped when its session ends
  • slot.​walStatusAlways

    string, may be null

    reserved, extended, unreserved or lost (the WAL it needs is gone)
  • slot.​confirmedFlushLsnAlways

    string, may be null

    Position the consumer has confirmed
  • slot.​restartLsnAlways

    string, may be null

    Oldest WAL position the slot still needs
  • slot.​retainedBytesAlways

    number, may be null

    WAL the slot holds on the leader, bytes
  • slot.​survivesFailoverAlways

    boolean, may be null

    Whether it is kept when another member takes over; null on a single node
  • declaredAlways

    object

    The declaration kept by the platform
  • declared.​nameAlways

    string

    Slot name
  • declared.​databaseAlways

    string

    Database it decodes
  • declared.​pluginAlways

    "pgoutput"

    Output plugin

Checked against the handlers: every route test validates their answers against this schema.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow rds:CreateDBReplicationSlot on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud rds replication-slots create id --name example --database example

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_rds_replication-slots_create.