- 最新
- 最多得票
- 最多評論
You can configure and use Automation document like "AWS-StartEC2Instance" and "AWS-StopEC2Instance" in Maintenance window with Tags.
I would recommend you to configure parameter for Instance ID with below value, select registered targets with Tags and do not need to specify Instance ID other than below value:
{{RESOURCE_ID}}
I hope this solution will fix your issue.
Thank you for your question. If I understand your goal correctly, you would like to run maintenance window at specific point in time on specific instances. Currently, you are using "Tags" to encode when an instance can be patched. If this is the case, I think you can try to use the flags: (1) --schedule, (2) --duration and (3) --schedule-timezone to encode the time when maintenance window runs when using the "ssm create-maintenance-window" command. Hope this helps!
I need to simply start and stop an EC2 instance based on the Tag that is assigned to it rather than using the Instance ID. So i can't use the built in runbook - "AWS-StartEC2Instance" as this only has parameter for instance id and not for any tags.
相關內容
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
Thanks for this. So i have cloned the AWS-StartEC2Instance runbook and then replaced the text in the document for {{InstanceIds}} with {{RESOURCE_ID}}. When i execute this document i get the message - "Failed to resolve input: RESOURCE_ID to type StringList. RESOURCE_ID is not defined in the Automation Document."
You need to declare {{RESOURCE_ID}} under the "Instance ID" parameter text box while registering the Automation task in maintenance window. You do not need to declare or modify content/code of AWS-StartEC2Instance automation document.