Skip to content
GitHubXDiscord

ResourceSpecificLogging

The ResourceSpecificLogging resource allows you to configure logging settings for specific AWS IoT resources, enabling you to manage logging levels for better observability and troubleshooting. For more details, refer to the AWS IoT ResourceSpecificLoggings documentation.

Create a basic ResourceSpecificLogging with required properties to enable logging for a specific AWS IoT resource.

import AWS from "alchemy/aws/control";
const resourceSpecificLogging = await AWS.IoT.ResourceSpecificLogging("basicLogging", {
TargetType: "Thing",
TargetName: "MyIoTDevice",
LogLevel: "INFO"
});

Configure ResourceSpecificLogging with additional optional properties such as adopting an existing resource.

const advancedLogging = await AWS.IoT.ResourceSpecificLogging("advancedLogging", {
TargetType: "Topic",
TargetName: "MyIoTTopic",
LogLevel: "ERROR",
adopt: true // Adopts the existing resource if it already exists
});

Set up ResourceSpecificLogging to capture detailed debugging logs for an IoT resource.

const debugLogging = await AWS.IoT.ResourceSpecificLogging("debugLogging", {
TargetType: "Rule",
TargetName: "MyIoTRule",
LogLevel: "DEBUG"
});

Create multiple ResourceSpecificLoggings for different types of resources to manage logging centrally.

const thingLogging = await AWS.IoT.ResourceSpecificLogging("thingLogging", {
TargetType: "Thing",
TargetName: "MyIoTDevice",
LogLevel: "INFO"
});
const topicLogging = await AWS.IoT.ResourceSpecificLogging("topicLogging", {
TargetType: "Topic",
TargetName: "MyIoTTopic",
LogLevel: "WARN"
});