aws-samples/ecs-cid-sample

'ECS' object has no attribute 'update_container_instances_state': AttributeError

veqryn opened this issue · 3 comments

Seems impossible from the code, but it is happening and stopping it from working. Perhaps this function isn't available in lambda?

'ECS' object has no attribute 'update_container_instances_state': AttributeError
Traceback (most recent call last):
File "/var/task/asg_drain_ecs_tasks.py", line 166, in lambda_handler
tasksRunning, tmpMsgAppend = checkContainerInstanceTaskStatus(Ec2InstanceId)
File "/var/task/asg_drain_ecs_tasks.py", line 90, in checkContainerInstanceTaskStatus
ecsResponse = ecsClient.update_container_instances_state(cluster=clusterName,containerInstances=[containerInstanceId],status='DRAINING')
AttributeError: 'ECS' object has no attribute 'update_container_instances_state'

Nevermind, I figured it out: Lambda has boto 1.4, and packaging 1.5.8 with the lambda solved it.

Hi
I am having a similar issue when calling list_tags_for_resource.
I have tried packaging boto (1.9.116) along with the lambda, but still getting the same error message. Ran the same script locally, it ran without any issues.

Thanks

It can also come from a version issue in botocore. In my case, the default python3.7 runtime's botocore version needed to be upgraded in order to ECS tag_resource to work.

'ECS' object has no attribute 'tag_resource'