The new destination option for AWS IoT Core enables UDP Gateway to publish messages to AWS IoT Core's data plane, allowing integration with IoT device ecosystems, IoT Core Rules, and Thing Shadows. This integration is ideal for bridging UDP-based device protocols into AWS IoT Core's MQTT infrastructure, where powerful Rules Engine capabilities can route, transform, and process device data.
The IoT Data adapter supports two distinct operating modes that determine how UDP packets are published to MQTT topics:
In static mode, all UDP packets are published to a single MQTT topic with metadata wrapped in a JSON packet envelope. The envelope includes source IP/port, timestamp, batch tag, and the payload encoded according to the destination's formatter setting.
When to use static mode:
Configuration: No special configuration required. Static mode is the default when
DynamicTopicSuffix is not set or is false.
In dynamic topic suffix mode, each UDP packet is published to a unique MQTT topic based on extracted payload data or source network information. The raw binary payload is sent without JSON wrapping, preserving the original device protocol format.
When to use dynamic mode:
Configuration options:
DynamicTopicSuffix (boolean, default: false) - Set to true to
enable dynamic topic suffix modeTopicSuffixExpression (string, optional) - A binary range expression that extracts bytes
from the UDP payload (e.g., "[0:4]" extracts the first 4 bytes). If not specified, the
topic suffix defaults to {source_ip}/{source_port}TopicSuffixFormatter (string, default: "hex") - Controls how extracted bytes
are converted to a string for the topic. Options: "hex", "ascii",
"utf8", "base64"Topic construction:
{base_topic_from_arn}/{dynamic_suffix}
Where the suffix is either:
TopicSuffixExpression evaluated against the payload, or{source_ip}/{source_port} if no expression is providedExample configuration (JSON):
{
"DestinationArn": "arn:aws:iot:us-east-1:123456789012:topic/devices",
"DynamicTopicSuffix": true,
"TopicSuffixExpression": "[0:4]",
"TopicSuffixFormatter": "hex"
}
This configuration would publish packets to topics like devices/A1B2C3D4, where
A1B2C3D4
is the hex representation of the first 4 bytes of each UDP payload.
The following patterns demonstrate common use cases for IoT Data destinations, leveraging the strengths of both UDP Gateway and AWS IoT Core.
Route messages to device-specific topics based on a device identifier extracted from the payload. This enables per-device processing pipelines and IoT Core Rules that operate on individual devices.
Configuration (YAML):
DestinationArn: arn:aws:iot:us-east-1:123456789012:topic/devices DynamicTopicSuffix: true TopicSuffixExpression: "[0:4]" # 4-byte device ID from payload start TopicSuffixFormatter: hex
Behavior: A UDP packet with bytes [0xA1, 0xB2, 0xC3, 0xD4, ...] is published to
devices/A1B2C3D4 with the raw binary payload preserved.
Use cases:
IoT Core Rule example:
SELECT * FROM 'devices/+' WHERE get_thing_shadow(topic(2)).thingName IS NOT NULL
Route by source IP address and port when devices don't include identifiers in the payload. This is useful for legacy devices or network-based device tracking.
Configuration (YAML):
DestinationArn: arn:aws:iot:us-east-1:123456789012:topic/sources
DynamicTopicSuffix: true
# No TopicSuffixExpression - defaults to {source_ip}/{source_port}
Behavior: A UDP packet from 192.168.1.100:51234 is published to
sources/192.168.1.100/51234.
Use cases:
Aggregate all UDP traffic to a single topic for analytics, monitoring, or debugging. This uses static mode to preserve full metadata about each packet.
Configuration (YAML):
DestinationArn: arn:aws:iot:us-east-1:123456789012:topic/udp/inbound # Default static mode - no dynamic suffix configuration
Behavior: All packets are published to udp/inbound with a JSON metadata
envelope
that includes source IP/port, timestamp, batch tag, and base64-encoded payload.
Use cases:
The dynamic suffix is appended directly to the base topic from the ARN. This focused approach keeps UDP Gateway simple while leveraging IoT Core's powerful Rules Engine for complex routing scenarios.
Single dynamic segment appended to base topic:
devices/{extracted_id} - Device identifier from payloadsources/{ip}/{port} - Source network information (default)sensors/{sensor_type} - Single extracted fieldTopic construction pattern: {base_topic_from_arn}/{dynamic_suffix}
Multiple dynamic segments or suffix insertion:
devices/{id}/shadow/update - Cannot append literal text after dynamic partsensors/{building}/{floor}/{type} - Multiple dynamic segments not supported$aws/things/{id}/shadow/update - Thing Shadow direct updates require workaroundThis suffix-based approach provides clear separation of concerns:
Complex topic hierarchies and specialized patterns (like Thing Shadows) are better implemented using IoT Core Rules, which can access device registries, transform payloads, and republish to any topic structure. This keeps UDP Gateway configuration simple while enabling flexible evolution of routing logic without gateway redeployment.
Like other Destinations, IoT Data respects the destination's batching configuration:
Count - Maximum messages per batchSize - Maximum total bytes per batchTime - Maximum wait time before sendingImportant: Each message in the batch is published as a separate MQTT message (not as a single batched message). The publications occur concurrently for efficiency, but IoT Core receives individual messages on their respective topics.
Batching recommendations:
The IoT Data adapter uses the region specified in the destination ARN to connect to the appropriate AWS IoT Data endpoint. Ensure that your UDP Gateway deployment has network access to the target region's endpoint.
Ensure your IAM role has iot:Publish permissions in all target regions.
iot service identifier and specify a topic pathDestinations for AWS IoT Data are available now for all customers.
Get started with Proxylity UDP Gateway today. No upfront costs ‐ pay only for what you use.
Buy with AWS Try the Examples Explore Documentation