Skip to content

SendDirectMessage

Source: src/AWS/IoT/SendDirectMessage.ts

Runtime binding for the IoT data-plane SendDirectMessage operation (IAM action iot:SendDirectMessage).

Binding to a client id filter grants iot:SendDirectMessage on matching MQTT client ARNs (or all clients when the filter is omitted) and returns a callable that delivers a message directly to a connected client without publishing through a topic. Provide the implementation with Effect.provide(AWS.IoT.SendDirectMessageHttp).

const sendDirectMessage = yield* AWS.IoT.SendDirectMessage("sensor-*");
yield* sendDirectMessage({
clientId: "sensor-1",
topic: "commands/reboot",
payload: JSON.stringify({ at: "now" }),
});