Different Ways to change .Pem file of AWS instance Part : - 2 ( Using Reset-Access Document )

- In part one we have seen how to change .Pem file using session manager, Now in this part we are going to use Automation document to change the key-pair and get access to your AWS instance. This will replace the old key with new key-pair and you can connect to your instance.
- This is automation technique. So we don't need to do much things, all the things is done by AWS by automation document called Reset-Access. This is useful when your instance is ebs backed.
- This automation technique is also in the System Manager so you need to attach role to instance, So we can run Automation document on the instance whose key-pair is lost. If you haven't attach the System Manager role to AWS instance then this can be done using how to connect AWS instance when you lost .Pem file.
- After attaching the IAM role to instance follow below steps and regain key-pair.Now follow below step to reset .Pem file.
Step : - 1 Open System Manager and select the Automation under the Action and Change option and click on Execution button when automaton window open.
Step 2 : - Select self service support workflows then on right side select AWSSupport-ResetAccess and open it.
Step 3 : - This automation document will reset key-pair value with the help of new helper-instance, Now Enter the instance id and proceed for the execution by leaving everything as it is.
Step 4 : - Then this automation document start performing its execution, if you are using it for Linux instance then some windows process will show failed. So wait till the end and you will see success on overall status.
Step 5 : - When this document get success, new created instance would terminate by it self. Now your instance's key-pair is replace with new key-pair. You find this key on Parameter Store by your instance id.
Step 6 : - Open this file and get access to your instance with new key , the private key is under the value option.





The information that you have shared is really useful for everyone.
ReplyDeleteDevOps Online Training