1 Answer
- Newest
- Most votes
- Most comments
0
Hi Drago,
You should be able to do this using AWS Systems Manager / SSM Automation. The runbook can have the following basic steps:
- Describe the Instance. (To get details of the Instance) - Use the aws:executeAwsApi action.
- Confirm the instance is managed by SSM and its connection status is "Online". - Use the aws:assertAwsResourceProperty action
- Call / Invoke the AWS-RunPowerScript Run Command document to run a PowerShell Script that Renames the Computer. You can use the Rename-Computer PowerShell cmdlet - Use the aws:runCommand action.
- Tag the instance. - Use the aws:executeAwsApi action.
- Restart the Instance. - Use the aws:changeInstanceState action.
Reference: [+] Authoring Automation runbooks - https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-authoring-runbooks.html
answered a year ago
Relevant content
- asked a year ago
- asked 2 years ago
- asked 3 months ago
- asked 15 days ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
not sure how to start on this. I have no SSM experience. I know my ec2 instances are windows servers and have the SSM agent installed