importboto3importjson# A session manages state about a particular configuration.# I recommend you specify profile and region - that is a good development practice.session=boto3.Session(profile_name='train',region_name='eu-west-1')# Obtain the IoT Client.iot_c=session.client('iot')# Create an AWS IoT Thing and device Thing Attributes.iot_c.create_thing(thingName="TestThing001",attributePayload={'attributes':{# max three attributes; valid types: <class 'str'>'fw_version':"0.1",'hw_version':"2",'vendor':"abc"}})# List IoT Things managed by the AWS Thing Registry in a region defined by Session.r=iot_c.list_things()print(json.dumps(r['things'],indent=2))