Amazon EC2 is a web service that provides resizable compute capacity in the cloud. It allows users to rent virtual machines on which to run applications. EC2 provides several instance types optimized for different use cases like compute-intensive, memory-intensive, or storage-intensive workloads. Security groups act as virtual firewalls that control access to instances. Users can choose between on-demand, reserved, or spot instances depending on their workload and pricing needs. Reserved instances provide significant discounts compared to on-demand but require longer-term commitments.