0

I'm creating an SSM Command document to use with Run Command. This Run Command will operate on a schedule. One thing I'm unclear about is if there is any way to prevent choosing instances (as pictured below). I need this one command to run against a specific instance every time and I need run command to know exactly which instances to target for the automated schedule.

Can I pass in the instance-id maybe somewhere in the document or elsewhere so that the same instance is targeted for every run? Also, if I don't want to pass in an instance ID, can I pass in a tag key-value pair?

enter image description here

J. Patwary
  • 427
  • 1
  • 7
  • 22
  • You have "Choose instances manually". – Marcin May 06 '22 at 00:35
  • Sorry let me clarify, I won’t always be on the console to manually select the instance. E.g. this run command might run at 1 am automatically- how does the target instance get specified then? Eg if I run this on a scheduled cloudwatch rule then will I pass in the instance id or instance tag in cloudwatch? – J. Patwary May 06 '22 at 04:12

1 Answers1

0

I realized SSM Maintenance Window lets you select instances based on instance ID or tag when selecting targets after creating the maintenance window. Tasks can then be assigned afterwards.

J. Patwary
  • 427
  • 1
  • 7
  • 22