Skip to content
GitHubXDiscordRSS

ThingType

Learn how to create, update, and manage AWS IoT ThingTypes using Alchemy Cloud Control.

The ThingType resource allows you to manage AWS IoT ThingTypes which are used to define the characteristics of a group of devices in AWS IoT. This resource can be utilized to create, update, and deprecate ThingTypes for your IoT devices.

Create a basic ThingType with a specified name and optional properties.

import AWS from "alchemy/aws/control";
const basicThingType = await AWS.IoT.ThingType("basicThingType", {
ThingTypeName: "TemperatureSensor",
ThingTypeProperties: {
searchableAttributes: ["location", "status"]
}
});

Configure a ThingType with deprecation settings and tags for better organization.

const advancedThingType = await AWS.IoT.ThingType("advancedThingType", {
ThingTypeName: "HumiditySensor",
ThingTypeProperties: {
searchableAttributes: ["location", "model"]
},
DeprecateThingType: true,
Tags: [
{ Key: "Environment", Value: "Production" },
{ Key: "Type", Value: "Sensor" }
]
});

Deprecate an existing ThingType that is no longer needed.

const deprecateThingType = await AWS.IoT.ThingType("deprecateThingType", {
ThingTypeName: "OldTemperatureSensor",
DeprecateThingType: true
});

Create a ThingType that includes multiple tags for better management and identification.

const taggedThingType = await AWS.IoT.ThingType("taggedThingType", {
ThingTypeName: "PressureSensor",
ThingTypeProperties: {
searchableAttributes: ["location", "model"]
},
Tags: [
{ Key: "Department", Value: "Engineering" },
{ Key: "Usage", Value: "Research" }
]
});