Replies: 1 comment 1 reply
-
|
This is expected behavior. For SSM Automation,
It does not support combining multiple tag keys (logical AND) in Only one resource group or tag can be specified at a time If you need “instances that match multiple tags”, use one of these correct approaches. Approach 1 (recommended): create a Resource Group with a tag query that includes both tag conditions, then target the automation by that single Resource Group. Create/update a resource group (example query requiring both tags): aws resource-groups create-group Then run automation using that one resource group as the target: aws --region us-west-2 ssm start-automation-execution Approach 2: resolve InstanceIds yourself (multi-tag filter) and pass the explicit InstanceId list to the runbook (works if the document supports multiple InstanceIds). Example to get matching InstanceIds in one region: INSTANCE_IDS=$(aws ec2 describe-instances Then start the automation using those InstanceIds (format may vary by document; many SSM docs accept comma-separated or JSON list): aws --region us-west-2 ssm start-automation-execution Summary: Your command fails because Automation only allows one tag key (or one resource group) in |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
While running this command:-
aws --region us-west-2 ssm start-automation-execution
--document-name "AWS-ResizeInstance"
--parameters "InstanceType=t3a.small,AutomationAssumeRole=arn:aws:iam::<master_acc_id>:role/AWS-SystemsManager-AutomationAdministrationRole"
--target-parameter-name InstanceId
--targets Key=tag:MaintenanceDays,Values=30,127 Key=tag:MaintenanceTimeStart,Values=12
--target-locations Accounts=<target_acc_id>,Regions=us-west-2,us-east-2,ExecutionRoleName=AWS-SystemsManager-AutomationExecutionRole
It is throwing error :- botocore.errorfactory.InvalidAutomationExecutionParametersException: An error occurred (InvalidAutomationExecutionParametersException) when calling the StartAutomationExecution operation: Only one resource group or tag can be specified at a time
aws --version :-
aws-cli/2.15.36 Python/3.11.8 Linux/5.15.146.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.22 prompt/off
Beta Was this translation helpful? Give feedback.
All reactions