Channel
Learn how to create, update, and manage AWS IoTAnalytics Channels using Alchemy Cloud Control.
The Channel resource lets you manage AWS IoTAnalytics Channels for collecting and processing IoT data streams.
Minimal Example
Section titled “Minimal Example”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 }});
Advanced Configuration
Section titled “Advanced Configuration”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" } ]});
Adoption of Existing Channel
Section titled “Adoption of Existing Channel”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});