I would like to understand what an Amazon Machine Image (AMI) is and how it is used in the AWS ecosystem. How does an AMI serve as a pre-configured template that includes an operating system, application software, and necessary configurations, allowing users to quickly launch EC2 instances? What types of AMIs—such as public, private, and shared AMIs—are available, and how do they differ in terms of use cases and customization? Additionally, how do organizations use AMIs to ensure consistency across environments, simplify scaling, automate deployments, and manage versioning of server configurations in cloud infrastructure?