Two security policies are required for proper platform operation: Device Policy for weather stations and Platform Policy for user access.
This policy enables weather devices to connect and publish telemetry data to IoT Core.
WeatherStationPolicies
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iot:Publish",
"Resource": "arn:aws:iot:<region>:<account_ID>:topic/weatherPlatform/telemetry/*"
},
{
"Effect": "Allow",
"Action": "iot:Connect",
"Resource": "arn:aws:iot:<region>:<account_ID>:client/*"
}
]
}
7. Click Create
This policy assignment automatically applies to all devices within the Thing Group.
This policy enables the web platform to interact with IoT devices, receive telemetry data, and send notifications.
WeatherPlatformPubSubPolicy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iot:Connect",
"Resource": "arn:aws:iot:<region>:<account_ID>:client/*"
},
{
"Effect": "Allow",
"Action": "iot:Receive",
"Resource": "arn:aws:iot:<region>:<account_ID>:topic/weatherPlatform/*"
},
{
"Effect": "Allow",
"Action": "iot:Subscribe",
"Resource": [
"arn:aws:iot:<region>:<account_ID>:topicfilter/weatherPlatform/telemetry/*",
"arn:aws:iot:<region>:<account_ID>:topicfilter/weatherPlatform/notifications"
]
},
{
"Effect": "Allow",
"Action": "iot:Publish",
"Resource": "arn:aws:iot:<region>:<account_ID>:topic/weatherPlatform/notifications"
}
]
}
This policy is attached to individual Cognito Identity IDs to grant authenticated users access to IoT Core resources. See the User IoT Policy Attachment section for detailed implementation steps.
After creating both policies, you should see: