rename window EC2 server and TAG name

0

I need to change the name of multiple windows ec2 instances.

manual way is:

  1. RDP to server
  2. Change name in system
  3. Reboot
  4. Change TAG Name from NAme: old_Name to new_name

any idea how I can automate this, script with powershell or SSM?

1 Antwort
0

Hi Drago,

You should be able to do this using AWS Systems Manager / SSM Automation. The runbook can have the following basic steps:

  1. Describe the Instance. (To get details of the Instance) - Use the aws:executeAwsApi action.
  2. Confirm the instance is managed by SSM and its connection status is "Online". - Use the aws:assertAwsResourceProperty action
  3. 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.
  4. Tag the instance. - Use the aws:executeAwsApi action.
  5. 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

AWS
beantwortet vor 2 Jahren
  • 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

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen