Cost Explorer (Gantt)
Cost Explorer (Gantt) provides a time-first visualization of AWS infrastructure cost mapped directly to real cloud resources. Instead of grouping cost by service and region, this view presents a resource-level financial timeline that allows engineers to reason about cost using the same mental model they use to design, provision, debug, and operate infrastructure.
This page documents the complete logical flow required to use Cost Explorer (Gantt) inside MechCloud. The flow starts with adding an AWS account, defining a Resource Context, provisioning infrastructure using Stateless IaC within that context, and finally visualizing cost using the same AWS account and Resource Context boundary.
End-to-End Logical Flow
Using Cost Explorer (Gantt) effectively requires understanding how MechCloud models infrastructure, automation boundaries, and cost visibility. The logical flow is as follows.
First, an AWS account is added to MechCloud. This establishes secure access and enables infrastructure discovery.
Next, a Resource Context is defined. This represents the logical grouping boundary within which Stateless IaC operates, similar to Kubernetes namespaces or AWS and Azure resource groups.
Stateless IaC is then used to provision and manage infrastructure inside this Resource Context, using the configured AWS account as the underlying provisioning and discovery layer.
Finally, Cost Explorer (Gantt) visualizes the cost of the resources belonging to that same Resource Context and AWS account, ensuring that cost analysis remains aligned with operational boundaries.
This model ensures a clean separation between cloud accounts, logical grouping, infrastructure provisioning, and cost visibility.
Prerequisites
Before using Cost Explorer (Gantt), ensure that your AWS account is added to MechCloud, a Resource Context is created, and infrastructure is provisioned using Stateless IaC. These prerequisites establish the secure access, operational boundaries, and resource inventory required for accurate cost visualization.
Step 1: Add Your AWS Account
Cost Explorer (Gantt) depends on the AWS integration configured in MechCloud. This integration allows MechCloud to securely discover infrastructure metadata, retrieve cost-related information, and continuously track resource lifecycles required to build accurate cost timelines.
Follow the AWS onboarding guide to connect your account:
https://docs.mechcloud.io/cloud-computing/add-an-account/aws
This process configures a secure cross-account IAM role, enables region discovery, and allows MechCloud to access the metadata required for cost visualization and infrastructure discovery.
Step 2: Configure IAM Permissions
The IAM role created during AWS onboarding must include the following policy. This permission set allows MechCloud to discover compute and storage resources, correlate lifecycle events, and build accurate cost timelines that include both running and terminated resources.
These permissions enable MechCloud to discover both running and terminated compute resources, fetch volume metadata, and resolve resource tags required for grouping and filtering. Without this permission set, timelines may appear incomplete or lack the context required for meaningful analysis.
Step 3: Create a Resource Context
A Resource Context defines the logical boundary within which Stateless IaC and related visualizations operate. It is conceptually equivalent to a namespace in Kubernetes or a resource group in AWS and Azure. The primary purpose of a Resource Context is to organize infrastructure into well-defined groups so that automation, visualization, and policy enforcement remain scoped to an explicit operational boundary.
A Resource Context does not have a direct relationship with any specific cloud account. Instead, it represents a logical grouping of resources. Cloud accounts are used to provision and discover infrastructure, while Resource Contexts define how those discovered resources are grouped and operated upon inside MechCloud.
This separation allows teams to define environments such as production, staging, shared services, or platform layers independently of how cloud accounts are structured. It also enables consistent operational boundaries even when resources span multiple accounts and regions.
Follow the Resource Context setup guide to create and manage contexts:
https://docs.mechcloud.io/cloud-computing/stateless-iac/resource-context
Step 4: Provision Infrastructure Using Stateless IaC
Once the AWS account and Resource Context are configured, infrastructure can be provisioned using Stateless IaC. All resources created using Stateless IaC are logically bound to the selected Resource Context, ensuring that operational boundaries are consistently enforced.
Stateless IaC uses the configured AWS account for provisioning while maintaining logical grouping through the Resource Context. This ensures that infrastructure lifecycle management, visibility, and cost analysis remain aligned.
Follow the Stateless IaC authoring guide to provision infrastructure:
https://docs.mechcloud.io/cloud-computing/stateless-iac
Accessing Cost Explorer (Gantt)
Cost Explorer (Gantt) is available under the Infrastructure section in MechCloud. This placement reflects its role as an operational visibility and analysis tool rather than a pure cloud configuration feature.
Navigate to Infrastructure → Cost Explorer (Gantt) to access the timeline view.
Selecting Time Range and Month
Cost Explorer supports visualization of AWS cost for the last three months, including the current month. To keep the timeline readable and operationally useful, only a single month can be visualized at a time. This ensures that engineers can focus on a precise time window when debugging cost behavior.
Use the month selector at the top of the screen to choose the month you want to analyze. When you switch months, the timeline reloads to display the selected month’s cost data, recalculating totals and re-rendering all resource timelines for that period.
For historical months, the timeline displays final billing values that represent the completed AWS invoice for that period. For the current month, the timeline shows both accumulated cost and projected estimates based on observed usage patterns.

Live Only vs All Resources
Cost Explorer provides two viewing modes: Live Only and All Resources. These modes allow engineers to switch between analyzing current spend and understanding historical infrastructure activity.
Live Only mode shows only resources that are currently active. This view is useful for understanding the present-day cost footprint, identifying ongoing spend, and spotting workloads that may require optimization or rightsizing.
All Resources mode includes both active and terminated resources. Terminated resources are displayed using striked-out text, allowing you to visually distinguish historical infrastructure from currently running workloads. This mode is particularly useful for debugging historical cost spikes, short-lived workloads, and ephemeral infrastructure created by experiments, CI/CD pipelines, or temporary environments.

Understanding Month-to-Date and Estimated Monthly Cost
For the current month, Cost Explorer displays two values for each grouping: month-to-date cost and estimated monthly cost. These two values provide both a real-time snapshot of spending and a forward-looking projection of month-end impact.
Month-to-date cost represents the actual accumulated spend up to the current point in time. Estimated monthly cost represents the projected total cost for the entire month if the current usage pattern continues unchanged.
For non-current months, both values are identical since billing data is already complete and no projection is required. This consistency ensures that historical analysis remains stable and comparable across time.

Reading the Gantt Timeline
The horizontal axis represents time across the selected month, while each row represents a real cloud resource such as an EC2 instance or an EBS volume. This layout allows engineers to directly correlate infrastructure activity with financial impact.
Each bar on the timeline represents a continuous runtime window for a resource. The length of the bar indicates how long the resource was active, and the value displayed on the bar represents the total cost incurred during that time slice. By scanning the timeline, engineers can immediately identify partial-month workloads, short-lived experiments, continuously running services, and irregular usage patterns.
Understanding Tooltip Information
Hovering over any bar in the timeline displays a detailed tooltip containing start time, end time, total duration, unit price, and incurred cost. This detailed view allows engineers to inspect precise billing characteristics without leaving the timeline context.
For resources that are still active in the current month, the tooltip also shows the estimated monthly cost based on the observed runtime and unit pricing.

For terminated or historical resources, only the actual incurred cost is shown, since no further projection is required.

This distinction allows engineers to immediately differentiate between finalized historical costs and ongoing spend that is still accumulating, improving decision-making during live cost optimization efforts.
Filtering and Scoping
Cost Explorer (Gantt) provides multiple filters that allow engineers to precisely scope the timeline view to the infrastructure they want to analyze. These filters make it possible to move seamlessly between high-level cost overviews and deep, resource-level investigation without changing tools or exporting data.
The Team filter allows users to switch between organizational scopes and ensures that cost visibility respects MechCloud’s multi-tenant access boundaries. The Cloud Provider and Cloud Account filters allow engineers to isolate cost to specific provider environments and individual accounts, which is particularly useful in multi-account AWS setups.
The Region filter enables focused analysis of geographic cost distribution. The Context filter applies the Resource Context boundary, restricting visualization strictly to the logical grouping defined for Stateless IaC operations. Together, these filters allow teams to progressively narrow the timeline from organization-wide cost down to individual workloads and even single resources.
Data Refresh and Cost Availability
Cost Explorer (Gantt) continuously refreshes infrastructure metadata so that resource lifecycles, runtime windows, and state transitions are reflected in near real time. This ensures that timeline behavior accurately mirrors current infrastructure activity.
Billing data follows AWS cost and usage processing cycles, which introduces a natural delay between resource usage and finalized billing records. As a result, historical months display stable, finalized cost values, while the current month displays a combination of accumulated cost and projected estimates.
Estimated monthly cost for the current month is calculated based on observed runtime patterns and unit pricing. As more usage data becomes available, projections are continuously refined, providing increasingly accurate month-end forecasts.
Typical Usage Patterns
Cost Explorer (Gantt) is commonly used for investigating unexpected AWS bill spikes, debugging zombie infrastructure, understanding partial-month workloads, correlating deployments with cost changes, and optimizing storage retention and compute utilization. By presenting cost as a timeline of infrastructure activity, it enables engineering teams to reason about financial impact using familiar operational workflows and reduces the cognitive overhead traditionally associated with cloud billing analysis.
Demo
Last updated