From 7144104e6a0d2f02e9cb05e2878d334d0fb91a81 Mon Sep 17 00:00:00 2001 From: Cong Dang Date: Wed, 24 Jan 2018 10:55:54 +0700 Subject: [PATCH] Correcting paramter for `ecs.describe_container_instances` and `ec2.describe_instances` Converted dictionary keys to list. --- lambda_health_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lambda_health_check.py b/lambda_health_check.py index 06a0ba4..3e35f97 100644 --- a/lambda_health_check.py +++ b/lambda_health_check.py @@ -159,12 +159,12 @@ def get_ecs_data(): if len(list_instance_arns.keys()) > 0: response = ecs.describe_container_instances( cluster=cluster_name, - containerInstances=list_instance_arns.keys()) + containerInstances=list(list_instance_arns.keys())) for instance in response['containerInstances']: list_ec2_instances[instance['ec2InstanceId']] = {'instanceArn': instance['containerInstanceArn']} list_instance_arns[instance['containerInstanceArn']]['instanceId'] = instance['ec2InstanceId'] if len(list_ec2_instances.keys()) > 0: - response = ec2.describe_instances(InstanceIds=list_ec2_instances.keys()) + response = ec2.describe_instances(InstanceIds=list(list_ec2_instances.keys())) for reservation in response['Reservations']: for instance in reservation['Instances']: list_ec2_instances[instance['InstanceId']]['privateIP'] = instance['PrivateIpAddress']