> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/cloud-cost-management/resources/cacm-architecture-diagrams/autostopping_for_aws_ec2.md).

# AutoStopping for AWS EC2

<figure><img src="/files/Z66SXo9H2qvwjXm9NC3s" alt=""><figcaption><p>Click to view full size image</p></figcaption></figure>

#### AutoStopping for AWS EC2: High-Level Overview <a href="#autostopping-for-aws-ec2-high-level-overview" id="autostopping-for-aws-ec2-high-level-overview"></a>

In this diagram, we will discuss about the interaction between CCM services and the customer's infrastructure, showcasing how AutoStopping for AWS VMs works. The onboarding process is marked by Harness taking a pivotal role in managing the existing Application Load Balancer (ALB) within the customer environment. In cases where no ALB is present, Harness initiates the creation of a new one. Simultaneously, a freshly instantiated Proxy Manager comes into play, diligently tracking traffic directed towards the target resources.

**Components and Flow:**

1. CCM Services:

* A suite of CCM services collaborates seamlessly, orchestrating the AutoStopping mechanism tailored for AWS EC2. These services serve as the backbone, driving automation and intelligence.

2. Customer Infrastructure:

* The customer's infrastructure houses AWS EC2, subject to AutoStopping rules defined by CCM.

3. ALB Management by Harness:

* Harness takes charge of managing the existing ALB within the customer environment during the onboarding process.
* If no ALB is found, Harness proactively creates a new one, establishing a crucial element for directing and managing traffic.

4. Harness-managed Lambda Creation:

* A newly created Proxy Manager becomes an essential component, actively tracking traffic directed towards AWS EC2.
* The Proxy Manager's role is central to detecting and analyzing traffic patterns for effective AutoStopping actions.
