I am new to AWS cost monitoring. I am trying to create some pipelines via AWS Step Functions composed of 2 Lambdas and 1 ECS job, along with the Step Function itself. I want to monitor the costs for these specific services and create some alerts based on thresholds. For example, if the usage of these 3 services exceeds $10, I want to receive an alert.
I checked the budgets and also set some alerts based on the usage, but I'm not sure if there's any way to monitor combined services.
I've been using AWS for years and still have cost creep up. Best advice is to get familiar with the services they provide to monitor and control cost.
Tagging: Tag your Step Function, Lambdas, and ECS tasks with a common tag (e.g., "WorkflowName"). You can also consider adding a cost allocation tag (e.g., "WorkflowX").
Cost Explorer: Use Cost Explorer to filter by the common tag ("WorkflowName") to view the combined costs associated with your workflow across all services.
Custom Metrics (Optional): Use the GetCostAndUsage API with CloudWatch to define a custom metric representing the total cost of your workflow based on the tagged resources. Set up CloudWatch alarms based on this custom metric to trigger notifications when the cost exceeds your threshold ($10 in your case).