-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Describe the bug
In the ecs exec docs, it shows I can reference a task either by ID or by task arn. At the bottom of the docs, it then goes on to provide a sample command which references the task by it's full arn.
However, when I try to reference a task by arn (which I need to do based on how resources are formatted in my organization's IAM policies), I get the following error:
An error occurred (InvalidParameterException) when calling the ExecuteCommand operation: task length should be one of [32,36]
The command works fine with the task ID, but then it references the task in the format arn:aws:ecs:{region}:{acc-number}:task/{id} rather than including the cluster name in the middle like we would expect and shows in the arn in the console. This leads to the resulting resource name not aligning with the expectation for resource naming in my org's IAM policies.
Regardless of the issue in the paragraph above, the docs reflect that you can reference task by either arn or ID. If you aren't going to support arn as a way to reference a task, remove it from the docs.
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
I can run the aws ecs execute-command function with a task arn rather than task id
Current Behavior
I get an error An error occurred (InvalidParameterException) when calling the ExecuteCommand operation: task length should be one of [32,36] when I try to run the aws ecs execute-command function with a task arn rather than task id
Reproduction Steps
Run this command from the ecs exec docs:
aws ecs execute-command
--cluster MyCluster
--task arn:aws:ecs:us-east-1:123456789012:task/MyCluster/d789e94343414c25b9f6bd59eEXAMPLE
--container MyContainer
--interactive
--command "/bin/sh"
Possible Solution
remove whatever length validation has been put in place on the task attribute for the ecs execute-command function
Additional Information/Context
No response
CLI version used
2.33.15
Environment details (OS name and version, etc.)
MacOS