Month: September 2021

How do I find IoT certs status?

I want to know how many certificates I have in my AWS IoT and how many certificates are attached onto any things or not. import boto3, timefrom concurrent.futures import ThreadPoolExecutor client =boto3.client(“iot”) results = []attached = []non_attached = [] paginator = client.get_paginator(‘list_certificates’)page_iterator = paginator.paginate()for page in page_iterator:results.extend(page[‘certificates’])print(“Total certificates scanned are: “, len(results)) start_time = time.time()def check_certificates(certificate):principal = client.list_principal_things(principal=certificate[“certificateArn”])# print(“%s –…

Read More »