Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Updating policy of lambda function to allow DescribeContainerInstances #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sttas
Copy link

@sttas sttas commented Nov 11, 2020

Arn format of container instance do not have cluster name, so thats why lambda function provide this feedback:

[ERROR] AccessDeniedException: An error occurred (AccessDeniedException) when calling the DescribeContainerInstances operation: User: arn:aws:sts::user:assumed-role/test-draining-function-role/test-draining-function is not authorized to perform: ecs:DescribeContainerInstances on resource: arn:aws:ecs:eu-north-1:test:container-instance/instance_id
Traceback (most recent call last):
File "/var/task/index.py", line 47, in lambda_handler
if instance_has_running_tasks(msg['EC2InstanceId']):
File "/var/task/index.py", line 29, in instance_has_running_tasks
(instance_arn, container_status, running_tasks) = find_ecs_instance_info(instance_id)
File "/var/task/index.py", line 18, in find_ecs_instance_info
containerInstances=arns)
File "/var/runtime/botocore/client.py", line 316, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/var/runtime/botocore/client.py", line 635, in _make_api_call
raise error_class(parsed_response, operation_name)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant