in lambda-bulk-importer/main.py [0:0]
def get_thing_group(thingGroupName):
try:
response = iot_client.describe_thing_group(thingGroupName=thingGroupName)
return response.get('thingGroupArn')
except botocore.exceptions.ClientError as error:
if error.response['Error']['Code'] == 'ResourceNotFoundException':
print("ERROR: You need to configure the Thing Group [" + thingGroupName + "] in your target region first.")
if error.response['Error']['Code'] == 'UnauthorizedException':
print("ERROR: There is a deployment problem with the attached Role. Unable to reach IoT Core object.")
return None
except:
print("ERROR: Unexpected fault")
return None