From 7aaa1f93b898c45b9a2cfc8b95803acec706fa86 Mon Sep 17 00:00:00 2001 From: Michaela Date: Sat, 30 Jan 2021 21:38:25 +1000 Subject: [PATCH] fix for crt error --- main.tf | 2 +- sonde-api-to-iot-core/lambda_function.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 3458297..e62d4d8 100644 --- a/main.tf +++ b/main.tf @@ -492,7 +492,7 @@ resource "aws_elasticsearch_domain" "ElasticsearchDomain" { dedicated_master_enabled = true dedicated_master_type = "t3.small.elasticsearch" instance_count = 2 - instance_type = "t3.small.elasticsearch" + instance_type = "m5.large.elasticsearch" zone_awareness_enabled = true } cognito_options { diff --git a/sonde-api-to-iot-core/lambda_function.py b/sonde-api-to-iot-core/lambda_function.py index 0e9d4c0..12f1ea9 100644 --- a/sonde-api-to-iot-core/lambda_function.py +++ b/sonde-api-to-iot-core/lambda_function.py @@ -7,6 +7,7 @@ import functools from aws_xray_sdk.core import xray_recorder from aws_xray_sdk.core import patch_all from awscrt import io, mqtt, auth, http +from awscrt.exceptions import AwsCrtError from awsiot import mqtt_connection_builder import uuid import threading @@ -79,7 +80,7 @@ def lambda_handler(event, context): qos=mqtt.QoS.AT_MOST_ONCE) try: msg.result() - except RuntimeError: + except (RuntimeError, AwsCrtError): mqtt_connection = mqtt_connection_builder.websockets_with_default_aws_signing( endpoint="a2sgq5szfqum7p-ats.iot.us-east-1.amazonaws.com", client_bootstrap=client_bootstrap,