When you have organized your fleet into groups, you can use this feature to control your fleet. This is useful to solve problems such as mitigating security incidents or launching new features. You can also leverage Logging and Fine-grained Logging when you organize your thing using Thing Groups.
Your support team reported that some of your customers are opening trouble tickets complaining about a strange behavior on their devices. Only customers in the NYC location are being impacted. You want to enable a DEBUG log level to this group and start troubleshoot the issue.
AWS IoT can send all progress events about each message as it passes from your devices through the message broker, device gateway, and the rules engine.
You can configure logging in two ways:
To enable AWS IoT logging, you must create an AWS Identity and Access Management (IAM) role, register it with AWS IoT, and then configure logging on Cloudwatch.
An IAM role has already been created for you using the name IoTLogsRole-HASH. It contains the required permissions:
Role policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutMetricFilter",
"logs:PutRetentionPolicy"
],
"Resource": [
"*"
]
}
]
}
Trust Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "iot.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Open the AWS IoT Console, if it is not already opened:
iot core
on the Find Services<StackName>-IoTLogsRole-<HASH>
Still on the AWS IoT console:
NYC
You can use the AWS Cloudwatch console to see the AWS ioT logs.
Open the Amazon CloudWatch console, if it is not already opened:
cloudwatch
on the Find ServicesCongratulations! You have enabled logging to monitor your fleet. You can now move to the other section.