deploy.rabbitmq.bind

Bind a managed RabbitMQ broker as one of its users (private, in the app’s VPC)

PUT /deploy/api/apps/{id}/rabbitmqIAM deploy:ManageBrokerBindingChanges stateDestructive

Generates {prefix}AMQP_URL (amqps://user:password@<broker address>:5671/%2F — the balancer with 3 nodes), AMQP_HOSTS (every node:5671, for clients that take a list), AMQP_USERNAME, AMQP_PASSWORD and AMQP_CA_FILE (the platform CA in the container) at every rollout. Needs secrets:GetSecretValue on the user’s password. A bound user cannot be deleted. Saving does not restart the app. Pass redeploy: true to roll the live deployment’s own source onto the new configuration (also needs deploy:DeployApp); otherwise the response and GET …/env report pending until someone redeploys.

Depending on the resource, the call checks secrets:GetSecretValue, deploy:DeployApp instead; hold all of them to be sure it is allowed.

Request syntax

PUT /deploy/api/apps/{id}/rabbitmq
{
  "brokerId": "string",
  "userName": "string",
  "envPrefix": "string",
  "redeploy": "boolean"
}

Path parameters

  • idRequired

    string

    Constraints: uuid

Request body

  • brokerIdRequired

    string

    The managed RabbitMQ broker to bind

    Constraints: /^rmq-[0-9a-f]{12}$/

  • userNameRequired

    string

    The broker user the app signs in as

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

  • envPrefixOptional

    string

    Put in front of every generated variable name (e.g. CACHE_ gives CACHE_REDIS_URL), so one app can hold several bindings of a kind; default empty

    Constraints: max 32 chars, /^([A-Z][A-Z0-9_]*_)?$/

  • redeployOptional

    boolean

    Also roll the live deployment onto the new configuration; default false

Response

201 with `data`: the binding — id, engine, resourceId, userName, envPrefix and generatedKeys (the variable names it generates). The top-level `redeploy` is null unless redeploy was requested; then { ok: true, deploymentId, generation, reusedDeploymentId } or { ok: false, error }.

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

Fields of data

  • idAlways

    string

    Binding id
  • engineAlways

    one of kafka, rabbitmq, docdb

    kafka, rabbitmq or docdb
  • resourceIdAlways

    string

    The bound cluster or broker
  • userNameAlways

    string

    User the app signs in as
  • envPrefixAlways

    string

    Prefix of the generated variable names; empty for none
  • generatedKeysAlways

    array of string

    Variable names the binding generates

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 deploy:ManageBrokerBinding 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 deploy rabbitmq bind id --broker-id example --user-name example

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