| 1 | import type * as mq from "@distilled.cloud/aws/mq"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Broker } from "./Broker.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `UpdateUser` operation (IAM action |
| 8 | * `mq:UpdateUser`), scoped to one {@link Broker}. |
| 9 | * |
| 10 | * Updates a broker user's password, console access, or groups — e.g. |
| 11 | * rotating credentials at runtime. On ActiveMQ the change is staged and |
| 12 | * applied at the next broker reboot or maintenance window; on RabbitMQ it |
| 13 | * takes effect immediately. Provide the implementation with |
| 14 | * `Effect.provide(AWS.MQ.UpdateUserHttp)`. |
| 15 | * ### Managing Users |
| 16 | * **Example:** Rotate a User's Password |
| 17 | * ```typescript |
| 18 | * const updateUser = yield* MQ.UpdateUser(broker); |
| 19 | * |
| 20 | * yield* updateUser({ |
| 21 | * Username: "tenant-42", |
| 22 | * Password: Redacted.make("NewSecretPassw0rd"), |
| 23 | * }); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface UpdateUser extends Binding.Service< |
| 29 | UpdateUser, |
| 30 | "AWS.MQ.UpdateUser", |
| 31 | ( |
| 32 | broker: Broker, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request: Omit<mq.UpdateUserRequest, "BrokerId">, |
| 36 | ) => Effect.Effect<mq.UpdateUserResponse, mq.UpdateUserError> |
| 37 | > |
| 38 | > {} |
| 39 | export const UpdateUser = Binding.Service<UpdateUser>("AWS.MQ.UpdateUser"); |