ssm unable to specify multiple targets
The documentation indicates that you can do this :
aws ssm send-command --document-name name --targets "Key=tag:tag name,Values=tag value" [...]
However, specifying multiple targets does not actually work
example :
aws ssm send-command --document-name "AWS-RunShellScript" --targets "Key=tag:clusterId,Values=abc" "Key=tag:nodeId,Values=xyz" --parameters commands=["date"]
An error occurred (InvalidParameters) when calling the SendCommand operation: Specifying multiple target filters is not supported yet.
This could be classified as a documentation issue.
The docs come from the service API: http://docs.aws.amazon.com/systems-manager/latest/APIReference/API_SendCommand.html#EC2-SendCommand-request-Targets
We can follow up and ask them to update their docs. Thanks for reporting.
Hello,
I'm also facing the issue but I can't even use the single target filters
Example :
aws ssm send-command --document-name "AWS-RunShellScript" --targets "Key=tag:Name,Values=test-acp" --parameters commands=["date"]
aws: error: the following arguments are required: --instance-ids
Any help will be appreciated
eu-west-3(Paris) doesn't support multiple tags
@ivarrian and @amalcp - Using the latest version of the CLI, this issue was re-tested successfully using two tag key/value pairs and two values:
Targeting two tag key/value pairs:
aws ssm send-command --document-name "AWS-RunPowerShellScript" --parameters commands=["echo helloWorld"] --targets Key=tag:Name,Values=ToolsInstance Key=tag:PatchGroup,Values=TestInstance
{
"Command": {
"CommandId": "<id removed>",
Targeting two values for a single tag key:
aws ssm send-command --document-name "AWS-RunPowerShellScript" --parameters commands=["echo foobar"] --targets Key=tag:Name,Values=ToolsInstance,TestInstance
{
"Command": {
"CommandId": "<id removed>",
Please let us know if it is still an issue.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.