Not able to rdp to Windows EC2 instance after deleting firewall rules on instance


I tried to install python packages from pip on the windows ec2 instance, but I'm getting error:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000012FE96940D0>, 'Connection to timed out. (connect timeout=15)')': /simple/pip-tools/

For this I was advised to flush the firewall rules on the jnstance, and check if the pip is working. To delete the firewall rules, I executed following syntax:

netsh advfirewall firewall delete rule name=all

As soon as I executed this command, my remote desktop session(initiated using Windows Remote Desktop) got terminated, and now I'm not able to establish the remote desktop session again.

Can anyone please help to understand, how can I rdp to windows instance?

[N.B.: I will really appreciate if any reference on why pip install not be working, can also be shared. I have whitelisted all outbound traffic on security group and network acl(for nacl all inbound traffic has also been whitelisted) on following ip address:

  8. ]
1 Answer

It is very likely that the RDP rules for incoming rules have been deleted.
The firewall must be disabled using AWSSupport-TroubleshootRDP in Systems Manager automation.
The following blog is in Japanese, but does the same thing.

※To use Systems Manager, attach the IAM policy "AmazonSSMMManagedInstanceCore" to the EC2 IAM role.
If your answer leads to a resolution, please approve the answer for the betterment of the community.

profile picture
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions