Skip to content

SCAD: ECS container split cost and EC2 unblended cost correlation

0

Hi there, I have an app that uses ECS + EC2 and I need to display cost break down on an ECS task level. I am considering enabling Split Cost Allocation Data (SCAD) in CUR report for that purpose.

I need the sum of all ECS task costs (split and unused cost) to be equal to unblended cost of their parent EC2 instance. Based on this article, I would expect that to be the case.

However, looking at this document, that is definitely not true for splitLineItem/SplitCost and splitLineItem/UnusedCost columns, as well as for splitLineItem/NetSplitCost and splitLineItem/NetUnusedCost. I am trying to figure out are splitLineItem/PublicOnDemandSplitCost and splitLineItem/PublicOnDemandUnusedCost the proper columns to use for container costs?

With SCAD enabled, is there at all any reliable way to make a correlation between container costs on one side, and their parent EC2 instance on the other side?

  • Use splitLineItem/PublicOnDemandSplitCost and splitLineItem/PublicOnDemandUnusedCost for ECS task costs. The sum should closely match the EC2 instance’s unblended cost, but expect minor differences. There is no 100% perfect correlation due to AWS’s allocation logic.

  • There is indeed no good way to do what you are trying to do . This is because of a few reasons

    1. SCAD only splits the costs associated with the 'RunInstances' operation on the EC2 instance . So there will be a bunch of costs associated with the EC2 that are NOT split by SCAD
    2. Even among the RunInstance costs that SCAD does split, there is a cost associated with the ECS task, and there is also an UNUSED component. so effectively you need to include the UNUSED cost along with the cost of the task
    3. PublicOnDemand costs are NOT the same as Unblended costs.
    4. you are never going to find it incredibly hard to correlate the EC2 costs to the ECS task costs that are generated. This is because EC2 costs are not in Amoratized / NetAmoratized formats ; while the ECS task costs are in Amoratized / NetAmoratized

    Good luck trying to use SCAD. You can read more about the challenges here : https://medium.com/@sree-chalasani/why-aws-split-cost-allocation-data-is-unusable-aeef2f85e943

1 Answer
-1

When you enable Split Cost Allocation Data (SCAD) for Amazon ECS in your Cost and Usage Reports (CUR), you can indeed allocate EC2 instance costs to individual containerized workloads based on their resource consumption.

The split cost allocation data generates container-level costs by analyzing each container's EC2 instance resource consumption based on the amortized cost of the instance and the percentage of CPU and memory resources consumed by the containers running on the instance.

For correlating container costs with their parent EC2 instances, you should understand that SCAD introduces new usage records and cost metric columns for each containerized resource ID (ECS tasks) in your CUR. For each ECS task, two new usage records are added per hour to reflect the CPU and memory costs.

Regarding which columns to use for accurate correlation:

The split cost allocation data is calculated by computing the cost of individual ECS services and tasks running on the cluster. The system looks at each container's EC2 instance resource consumption and generates cost based on the amortized cost of the instance and the percentage of CPU and memory resources consumed.

While the documentation doesn't explicitly state which specific columns (splitLineItem/PublicOnDemandSplitCost and splitLineItem/PublicOnDemandUnusedCost) should be used for container costs, the split cost allocation data is designed to ensure that the sum of all container costs (split costs) plus unused costs should equal the total cost of the parent EC2 instance.

To enable this feature, note that only regular and payer accounts have access to Cost Management preferences and can opt into Split Cost Allocation Data. After enabling, it can take up to 24 hours for the data to be visible in your CUR.
Sources
Cost Allocation Data for Amazon ECS | AWS re:Post
Understanding split cost allocation data - AWS Data Exports
COST03-BP01 Configure detailed information sources - Cost Optimization Pillar

answered a year ago

AWS
EXPERT

reviewed a year ago

  • It is still not clarified which split line item costs and unused costs correspond to which original EC2 cost. More specifically, which split line item columns sums to the unblended costs of a parent EC2 instance?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.