惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
量子位
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
Google DeepMind News
Google DeepMind News
小众软件
小众软件
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
雷峰网
雷峰网
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Trying AWS IoT Core's New GetConnection and ListSubscript...
ほうき星 · 2026-05-29 · via DEV Community

This article is a machine translation of the contents of the following URL, which I wrote in Japanese:

AWS IoT Core 単体で MQTT クライアントの接続状態を取得できるようになったので試す #awsIoT - Qiita

はじめに こんにちは、ほうき星 @H0ukiStar です。 本日 AWS IoT Core に以下のようなアップデートがありました。 Posted on: May 28, 2026 Today, AWS IoT Core launches two new MQTT c...

favicon qiita.com

Introduction

Hello, I'm @H0ukiStar.

Today, AWS IoT Core announced the following update.

Posted on: May 28, 2026
Today, AWS IoT Core launches two new MQTT connection management APIs, GetConnection and ListSubscriptions, enabling you to easily access MQTT client connection and subscription information for your Internet of Things (IoT) devices. These APIs help you troubleshoot connectivity issues, monitor client behavior, and audit connection patterns across your device fleet.

https://aws.amazon.com/about-aws/whats-new/2026/05/aws-iot-core-apis-mqtt/

Previously, checking device connection status required using Fleet Indexing or implementing your own state management with features such as Device Shadow. With this update, it is now possible to check device connection status directly using AWS IoT Core alone.

I previously introduced methods for checking connection status using Fleet Indexing and Device Shadow in the following article, so feel free to check it out as well.

AWS IoT Core でモノの接続状態をオンデマンドで取得する2つの方法 #lambda - Qiita

はじめに こんにちは、ほうき星です。 皆さんは、AWS IoT Core に接続した自作 IoT デバイス(Raspberry Pi / ESP32 など)が 「今オンラインなのか、それともオフラインなのか」を確認したいと思ったことはありませんか? 私は自作した IoT ...

favicon qiita.com

Trying It Out

Let's try the new APIs.

At the time of writing, these APIs do not appear to be available in the AWS SDK yet, so the API requests must be signed manually using SigV4.

This time, I used awscurl for signing. You can install it with the following command:

pip install awscurl

Enter fullscreen mode Exit fullscreen mode

You can also retrieve the API endpoint using the AWS CLI as shown below.

aws iot describe-endpoint --endpoint-type iot:Data-ATS

{
    "endpointAddress": "abcd1234567890-ats.iot.ap-northeast-1.amazonaws.com"
}

Enter fullscreen mode Exit fullscreen mode

GetConnection

This API allows you to retrieve information such as the connection status and Keep Alive configuration of a specified MQTT client.

Send the following request using awscurl.

awscurl \
  --service iotdevicegateway \
  --region ap-northeast-1 \
  "https://abcd1234567890-ats.iot.ap-northeast-1.amazonaws.com/connections/<clientId>"

Enter fullscreen mode Exit fullscreen mode

[!WARNING]
For SigV4 signing, you must specify iotdevicegateway as the service name instead of iot.

You can retrieve information such as whether the client is currently connected and when the connection was established.

{
    "connected": true,
    "cleanSession": true,
    "clientId": "clientId",
    "thingName": "thingName",
    "keepAliveDuration": 15,
    "connectedSince": 1780061470032
}

Enter fullscreen mode Exit fullscreen mode

You can also retrieve socket information by adding includeSocketInformation=true.

awscurl \
  --service iotdevicegateway \
  --region ap-northeast-1 \
  "https://abcd1234567890-ats.iot.ap-northeast-1.amazonaws.com/connections/<clientId>?includeSocketInformation=true"

Enter fullscreen mode Exit fullscreen mode

{
    "connected": true,
    "cleanSession": true,
    "clientId": "clientId",
    "thingName": "thingName",
    "sourceIp": "sourceIp",
    "sourcePort": sourcePort,
    "targetIp": "targetIp",
    "targetPort": 8883,
    "keepAliveDuration": 15,
    "connectedSince": 1780061470032
}

Enter fullscreen mode Exit fullscreen mode

ListSubscriptions

This API allows you to retrieve the topics subscribed to by a specified client.

Send the following request using awscurl.

awscurl \
  --service iotdevicegateway \
  --region ap-northeast-1 \
  "https://abcd1234567890-ats.iot.ap-northeast-1.amazonaws.com/connections/<clientId>/subscriptions"

Enter fullscreen mode Exit fullscreen mode

[!WARNING]
For SigV4 signing, you must specify iotdevicegateway as the service name instead of iot.

You can retrieve the topics currently subscribed to by the specified client as shown below.

{
    "nextToken": "",
    "subscriptions": [
        {
            "topicFilter": "$aws/things/<thingName>/shadow/update/delta",
            "qos": 0
        }
    ]
}

Enter fullscreen mode Exit fullscreen mode

Conclusion

With the newly introduced GetConnection and ListSubscriptions APIs, it is now possible to retrieve MQTT client connection status and subscription information directly from AWS IoT Core.

Previously, checking connection status often required custom implementations using Fleet Indexing, Device Shadow, or Lifecycle Events. With these new APIs, monitoring client state should become much simpler.

Although the APIs do not yet appear to be available in the AWS SDK, they can already be used today by manually signing requests with SigV4.

If you're interested, give them a try.