Skip to content

UpdateThingShadow

Source: src/AWS/IoT/UpdateThingShadow.ts

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

Bind it to a Thing to write the thing’s device shadow — the thing name is injected automatically. Provide the implementation with Effect.provide(AWS.IoT.UpdateThingShadowHttp).

Set Desired State

const updateShadow = yield* AWS.IoT.UpdateThingShadow(thing);
yield* updateShadow({
payload: JSON.stringify({ state: { desired: { led: "on" } } }),
});

Write a Named Shadow

yield* updateShadow({
shadowName: "telemetry",
payload: JSON.stringify({ state: { reported: { t: 22.5 } } }),
});