If you want to ping your AWS EC2 instance, you need to configure your security group for that instance. Follow these steps:
- Login to your AWS account and go to EC2.
- Select the instance you want to enable ping.
- Go to its Security Group.
- Click on the Inbound Rules.
- Click on the Edit Inbound Rules button.
- Click on Add Rule.
- Select the Custom ICMP rule – IPv4 as Type.
- Select Echo Request as the Protocol. The Port Range by default will be N/A; keep it that way.
- Choose Anywhere in the Source column.
- Click on Save Rules.

After these steps, you will be able to ping to your server.