Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

bot3 ecs.execute_command: Task Identifier is invalid

I have defined a task in AWS ECS. I have copied the task ARN into the API call:

rsp = ecs.execute_command(
        container='test',
        command=json.dumps(event),
        task='arn:aws:ecs:##-####-#:############:task-definition/test:1',
        interactive=True
    )

I receive the following error complaining about the task identifier:

botocore.errorfactory.InvalidParameterException: An error occurred (InvalidParameterException) when calling the ExecuteCommand operation: Task Identifier is invalid

I am not sure what is wrong as the task identifier has been copied from the AWS web interface where the task was created. Am I just missing something extremely obvious?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Double Check the Components: A valid ECS task ARN looks something like this:

arn:aws:ecs:[region]:[account-id]:task/[cluster-name]/[task-id]

Distinguish between Task Definition ARN and Task ARN, they are different.

Check if the Task is in the "RUNNING" State

Check your Permission, do you have the correct IAM role?

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading