Amazon Elastic Compute Cloud (Amazon EC2) is a computing environment provided by AWS. It supports highly scalable computing capacity in AWS.
Instead of buying hardware for servers we can use Amazon EC2 to deploy our applications. So there is no need to buy and maintain the hardware within our own datacenter. We can just rent the Amazon EC2 servers.
Based on our varying needs we can use as few and as many Amazon EC2 instances. It even provides auto-scaling options in which the instances scale up or down based on the load and traffic spikes.
It is easier to deploy applications on EC2. Even we can configure security and networking in Amazon EC2 much easily than our own custom data center.