Skip to content
GitHubXDiscord

Channel

The Channel resource lets you manage AWS IoTAnalytics Channels for collecting and processing IoT data streams.

Create a basic IoTAnalytics Channel with required properties and a common optional property.

import AWS from "alchemy/aws/control";
const basicChannel = await AWS.IoTAnalytics.Channel("basicChannel", {
ChannelName: "TemperatureDataChannel",
ChannelStorage: {
Type: "S3",
S3: {
Bucket: "iotanalytics-data-bucket",
KeyPrefix: "temperature-data/"
}
},
RetentionPeriod: {
NumberOfDays: 30,
Unlimited: false
}
});

Configure a channel with tags for better organization and management.

const taggedChannel = await AWS.IoTAnalytics.Channel("taggedChannel", {
ChannelName: "HumidityDataChannel",
ChannelStorage: {
Type: "S3",
S3: {
Bucket: "iotanalytics-data-bucket",
KeyPrefix: "humidity-data/"
}
},
RetentionPeriod: {
NumberOfDays: 60,
Unlimited: false
},
Tags: [
{
Key: "Environment",
Value: "Production"
},
{
Key: "Project",
Value: "WeatherMonitoring"
}
]
});

This example demonstrates how to adopt an existing channel instead of failing when it already exists.

const existingChannel = await AWS.IoTAnalytics.Channel("existingChannel", {
ChannelName: "PressureDataChannel",
ChannelStorage: {
Type: "S3",
S3: {
Bucket: "iotanalytics-data-bucket",
KeyPrefix: "pressure-data/"
}
},
RetentionPeriod: {
NumberOfDays: 90,
Unlimited: false
},
adopt: true // Adopt the existing resource
});