Accidentally i disabled RDP on EC2 windows machine and now I am not able to access it via RDP, Is there any way to re-enable RDP service on EC2 instance?
Yes, You can able to re-enable RDP using run the AWSSupport-ExecuteEC2Rescue Automation (AWS Systems Manager)
Please follow below steps carefully:
Open the AWS Systems Manager console at https://console.aws.amazon.com/systems-manager/.
In the navigation pane, choose Automation.
Choose Execute automation.
In the documents list, choose AWSSupport-ExecuteEC2Rescue. The document owner is Amazon.
In the Document details section verify that Document version is set to the highest default version. For example, 13 (default).
In the Execution mode section, choose Simple execution. Leave the Targets and Rate Control option disabled.
In the Input parameters section, specify the following parameters:
For UnreachableInstanceId, specify the ID of the unreachable instance.
For LogDestination, specify an Amazon S3 bucket if you want to collect operating system-level logs while troubleshooting your instance. Logs are automatically uploaded to the specified bucket.
For EC2RescueInstanceType, specify an instance type for the EC2Rescue instance. The default instance type is t2.small.(Please leave as it is if you are confused and go ahead)
For SubnetId, specify a subnet in an existing VPC in the same availability zone as the unreachable instance. By default, Systems Manager creates a new VPC, but you can specify a subnet in an existing VPC if you want. (Please leave as it is if you are confused and go ahead)
If you don't see the option to specify a bucket or a subnet ID, verify that you are using the latest Default version of the document.
For AssumeRole, if you created roles for this Automation by using the CloudFormation procedure described earlier in this topic, then specify the AssumeRole ARN that you copied from the CloudFormation console.
- Choose Execute automation.
It takes sometimes (5-10 minutes) and you are able to access your old instance with new IP.
Here is the AWS documentation for this issue: https://aws.amazon.com/premiumsupport/knowledge-center/troubleshoot-remote-desktop-connection-ec2-windows/