Skip to content

IoT Core

CloudMock emulates AWS IoT Core, supporting things, thing types, thing groups, policies, certificates, topic rules, jobs, and tagging. The Thing → Certificate → Policy relationship chain is fully implemented with certificate state management (ACTIVE, INACTIVE, REVOKED) and job lifecycle (IN_PROGRESS, COMPLETED, CANCELLED).

OperationStatusNotes
CreateThingSupportedCreates a thing with optional type and attributes
DescribeThingSupportedReturns thing details including version
ListThingsSupportedLists all things
UpdateThingSupportedUpdates thing type and attributes, increments version
DeleteThingSupportedDeletes a thing
CreateThingTypeSupportedCreates a thing type
DescribeThingTypeSupportedReturns thing type details with metadata
ListThingTypesSupportedLists thing types
DeleteThingTypeSupportedDeletes a thing type
CreateThingGroupSupportedCreates a thing group with optional parent
DescribeThingGroupSupportedReturns thing group details
ListThingGroupsSupportedLists thing groups
DeleteThingGroupSupportedDeletes a thing group
AddThingToThingGroupSupportedAdds a thing to a group
RemoveThingFromThingGroupSupportedRemoves a thing from a group
CreatePolicySupportedCreates an IoT policy
GetPolicySupportedReturns policy details
ListPoliciesSupportedLists policies
DeletePolicySupportedDeletes a policy
AttachPolicySupportedAttaches a policy to a target (cert ARN)
DetachPolicySupportedDetaches a policy from a target
ListAttachedPoliciesSupportedLists policies attached to a target
ListTargetsForPolicySupportedLists targets a policy is attached to
CreateKeysAndCertificateSupportedCreates mock keys and certificate
DescribeCertificateSupportedReturns certificate details and status
ListCertificatesSupportedLists certificates
UpdateCertificateSupportedChanges certificate status (ACTIVE/INACTIVE/REVOKED)
DeleteCertificateSupportedDeletes a certificate
AttachThingPrincipalSupportedAttaches a certificate to a thing
DetachThingPrincipalSupportedDetaches a certificate from a thing
ListThingPrincipalsSupportedLists certificates attached to a thing
CreateTopicRuleSupportedCreates a topic rule (SQL must start with SELECT)
GetTopicRuleSupportedReturns topic rule details
ListTopicRulesSupportedLists topic rules
DeleteTopicRuleSupportedDeletes a topic rule
CreateJobSupportedCreates a job targeting things/groups
DescribeJobSupportedReturns job details and status
ListJobsSupportedLists all jobs
CancelJobSupportedCancels an IN_PROGRESS job
TagResourceSupportedAdds tags to a resource
UntagResourceSupportedRemoves tags from a resource
ListTagsForResourceSupportedLists tags for a resource
import { IoTClient, CreateThingCommand, CreateKeysAndCertificateCommand, AttachThingPrincipalCommand } from '@aws-sdk/client-iot';
const client = new IoTClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
// Create a thing
const { thingName, thingArn } = await client.send(new CreateThingCommand({
thingName: 'my-sensor',
}));
// Create and attach certificate
const { certificateArn, certificateId } = await client.send(
new CreateKeysAndCertificateCommand({ setAsActive: true })
);
await client.send(new AttachThingPrincipalCommand({
thingName: 'my-sensor',
principal: certificateArn,
}));
console.log(thingArn, certificateArn);
import boto3
client = boto3.client('iot',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
thing = client.create_thing(thingName='my-sensor')
cert = client.create_keys_and_certificate(setAsActive=True)
client.attach_thing_principal(
thingName='my-sensor',
principal=cert['certificateArn']
)
# Create a job
client.create_job(
jobId='firmware-update-001',
targets=[thing['thingArn']],
description='Firmware update',
documentSource='s3://my-bucket/firmware-job.json',
)
cloudmock.yml
services:
iot:
enabled: true
  • Certificates are stubs and cannot be used for real MQTT connections
  • Topic rules are stored but do not trigger actions
  • MQTT message broker is not implemented
  • Job execution tracking per-device is not implemented (only job-level status)