Skip to content
GitHubXDiscord

Input

The Input resource allows you to manage AWS IoTEvents Inputs used for detecting changes in your IoT data. Inputs define the structure of the data that your IoTEvents detectors will use.

Create a basic IoTEvents Input with required properties along with a description and tags.

import AWS from "alchemy/aws/control";
const basicInput = await AWS.IoTEvents.Input("basicInput", {
InputDefinition: {
Inputs: [
{
Name: "temperature",
Type: "double"
},
{
Name: "humidity",
Type: "double"
}
]
},
InputName: "TemperatureAndHumidityInput",
InputDescription: "Input for monitoring temperature and humidity levels.",
Tags: [
{ Key: "Environment", Value: "Production" },
{ Key: "Application", Value: "IoTMonitoring" }
]
});

Configure an Input with a more complex definition and additional properties.

const advancedInput = await AWS.IoTEvents.Input("advancedInput", {
InputDefinition: {
Inputs: [
{
Name: "deviceStatus",
Type: "string"
},
{
Name: "batteryLevel",
Type: "integer"
},
{
Name: "location",
Type: "string"
}
]
},
InputName: "DeviceStatusInput",
InputDescription: "Input for tracking device status and battery levels.",
Tags: [
{ Key: "Environment", Value: "Staging" },
{ Key: "Application", Value: "DeviceManagement" }
]
});

Create an Input that includes dynamic attributes for flexible data ingestion.

const dynamicInput = await AWS.IoTEvents.Input("dynamicInput", {
InputDefinition: {
Inputs: [
{
Name: "eventType",
Type: "string"
},
{
Name: "eventData",
Type: "json"
}
]
},
InputName: "DynamicEventInput",
InputDescription: "Input designed to handle various event types and data.",
Tags: [
{ Key: "Environment", Value: "Development" },
{ Key: "Application", Value: "EventProcessing" }
],
adopt: true // Adopt existing resource if it already exists
});