> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS IoT SiteWise

> Client-mode REST API connector for a curated AWS IoT SiteWise slice: BatchPutAssetPropertyValue, GetAssetPropertyValueHistory, CreateAsset, and ListAssets

Technical Preview

## Overview

A client-mode connector for a **curated cloud-IoT** slice of [AWS IoT SiteWise](https://docs.aws.amazon.com/iot-sitewise/latest/userguide/what-is-sitewise.html) covering property ingest from UNS topics, property history queries, and asset create from Sparkplug birth:

| Catalog connector event | Entity / path | Notes |
| - | - | - |
| POST properties batch put | `POST /properties` | Data-plane BatchPutAssetPropertyValue |
| GET property history | `GET /properties/history` | Data-plane GetAssetPropertyValueHistory |
| POST assets create (Sparkplug birth) | `POST /assets` | Control-plane CreateAsset — switch BASE to `api.iotsitewise` |
| GET ListAssets (auth smoke) | `GET /assets` | Control-plane ListAssets — switch BASE to `api.iotsitewise` |

Default `BASE_ADDRESS` is data-plane `https://data.iotsitewise.eu-west-1.amazonaws.com` (no trailing slash; substitute `{region}`). Topics use `cloud-iot/aws-iot-sitewise/<object>/<verb>`.

See the base guide: [REST API Connectors](/latest/lot-language/routes/rest-api-routes).

> [!NOTE]
>
> **Control-plane ops:** set `BASE_ADDRESS` to `https://api.iotsitewise.{region}.amazonaws.com` for CreateAsset and ListAssets. SigV4 service name on both planes is `iotsitewise`.

> [!NOTE]
>
> **Data-plane SigV4:** Pass `Authorization`, `x-amz-date`, and `x-amz-content-sha256` from an upstream signer via MQTT JSON placeholders. Prefer Hub secrets for AWS keys — never commit them into the `.lot`.

> [!NOTE]
>
> Prefer Hub secrets for AWS keys used by an upstream SigV4 signer. This template has not been verified against a live AWS account. Status remains blocked until an authenticated live smoke succeeds.

## Basic Syntax

```lot wrap theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
# Coreflux REST_API template — AWS IoT SiteWise curated slice
# Auth: SigV4 via {value.json.authorization}, {value.json.x_amz_date},
#       {value.json.x_amz_content_sha256}
# BASE_ADDRESS: https://data.iotsitewise.eu-west-1.amazonaws.com (data plane)

DEFINE ROUTE AwsIotSitewiseRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://data.iotsitewise.eu-west-1.amazonaws.com"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '60'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT BatchPutAssetPropertyValue
        WITH SOURCE_TOPIC "cloud-iot/aws-iot-sitewise/properties/batch-put"
        WITH DESTINATION_TOPIC "cloud-iot/aws-iot-sitewise/properties/batch-put/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/properties"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "{value.json.authorization}"
            ADD "x-amz-date" "{value.json.x_amz_date}"
            ADD "x-amz-content-sha256" "{value.json.x_amz_content_sha256}"
        WITH BODY "{payload}"
    ADD EVENT GetAssetPropertyValueHistory
        WITH SOURCE_TOPIC "cloud-iot/aws-iot-sitewise/properties/history"
        WITH DESTINATION_TOPIC "cloud-iot/aws-iot-sitewise/properties/history/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/properties/history?propertyAlias={value.json.property_alias}&startDate={value.json.start_date}&endDate={value.json.end_date}&maxResults={value.json.max_results}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
            ADD "x-amz-date" "{value.json.x_amz_date}"
            ADD "x-amz-content-sha256" "{value.json.x_amz_content_sha256}"
    ADD EVENT CreateAsset
        WITH SOURCE_TOPIC "cloud-iot/aws-iot-sitewise/assets/create"
        WITH DESTINATION_TOPIC "cloud-iot/aws-iot-sitewise/assets/create/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/assets"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "{value.json.authorization}"
            ADD "x-amz-date" "{value.json.x_amz_date}"
            ADD "x-amz-content-sha256" "{value.json.x_amz_content_sha256}"
        WITH BODY "{payload}"
    ADD EVENT ListAssets
        WITH SOURCE_TOPIC "cloud-iot/aws-iot-sitewise/assets/list"
        WITH DESTINATION_TOPIC "cloud-iot/aws-iot-sitewise/assets/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/assets?filter={value.json.filter}&maxResults={value.json.max_results}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
            ADD "x-amz-date" "{value.json.x_amz_date}"
            ADD "x-amz-content-sha256" "{value.json.x_amz_content_sha256}"
```

## Configuration

| Setting | Value |
| - | - |
| Connector name | `AwsIotSitewiseRestApi` |
| Type | `REST_API` (client) |
| BASE\_ADDRESS | `https://data.iotsitewise.eu-west-1.amazonaws.com` (data plane; change region as needed) |
| Topic prefix | `cloud-iot/aws-iot-sitewise/...` |
| Default Content-Type | `application/json` |
| Auth | SigV4 headers from MQTT placeholders (service `iotsitewise`) |
| Status | Technical preview — needs AWS keys + region |

## MQTT topics

| Event | Source | Response |
| - | - | - |
| BatchPutAssetPropertyValue | `cloud-iot/aws-iot-sitewise/properties/batch-put` | `.../properties/batch-put/response` |
| GetAssetPropertyValueHistory | `cloud-iot/aws-iot-sitewise/properties/history` | `.../properties/history/response` |
| CreateAsset | `cloud-iot/aws-iot-sitewise/assets/create` | `.../assets/create/response` |
| ListAssets | `cloud-iot/aws-iot-sitewise/assets/list` | `.../assets/list/response` |

## Auth details

1. Sign each request with AWS Signature Version 4 using service name **`iotsitewise`** (both planes).
2. Map signed values into MQTT JSON: `authorization`, `x_amz_date`, `x_amz_content_sha256` (and optional STS session token).
3. Store `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` as Hub secrets for the upstream signer — never in the deployable `.lot`.
4. Use data-plane BASE for BatchPut / history; switch to control-plane BASE (`api.iotsitewise.{region}.amazonaws.com`) for CreateAsset / ListAssets.

## Related

* [REST API Connectors](/latest/lot-language/routes/rest-api-routes)
* [AWS IoT Core](/latest/lot-language/routes/rest-api-apps/aws-iot-core) (same SigV4 placeholder pattern)
* [Amazon S3](/latest/lot-language/routes/rest-api-apps/amazon-s3) (same SigV4 placeholder pattern)
* [BatchPutAssetPropertyValue](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchPutAssetPropertyValue.html)
* [GetAssetPropertyValueHistory](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_GetAssetPropertyValueHistory.html)
* [CreateAsset](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAsset.html)
* [ListAssets](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_ListAssets.html)
* [SiteWise endpoints](https://docs.aws.amazon.com/general/latest/gr/iot-sitewise.html)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.