need to divide costs in the same account with different S3 and S3 Glacier services

0

Hi, very basic account with very few services.

In the same account, I have multiple S3 buckets and S3 glacier vaults. I need the billing to be divided in two categories by Tags or User created cost Tags I created. These values are complementary, so say one would be 43% of the monthly cost, the other would be the 57% of total cost.

Can you please suggest how to do it? I did manual tagging, but they can't show up in cost explorer as dimensions.

I did cost allocation tags with different values, created cost categories by using such tags, but still those reports are showing 100% even if I filter it correctly.

asked 4 months ago142 views
2 Answers
0

Hello,

If I understood correctly, you have a S3 Bucket with objects in Standard Storage Class, and a Bucket with Objects in Glacier, and you want to get the cost for each bucket. You are correct in using Cost Allocation Tags per bucket: https://docs.aws.amazon.com/AmazonS3/latest/userguide/CostAllocTagging.html

I did a simple test, I created 2 buckets, copied a bunch or large objects each and moving all the objects in one of the buckets to Glacier. I then added the same tag (Cost Allocation Tag enabled) to both bucket but with different values (EG standard, glacier).

The day after I could see in Cost Explorer the cost related to the buckets, I set S3 as Filter and as Dimension my tag.

AWS
answered 4 months ago
0

You can also use Cost and Usage Report (CUR - https://aws.amazon.com/aws-cost-management/aws-cost-and-usage-reporting/ ) if you need a more programmatic way to achieve the same result:

This is a basic query to find the data:

SELECT line_item_resource_id, resource_tags_user_gio_inc_cost_allocation_cost_center,  SUM(line_item_unblended_cost) AS cost
FROM cur
WHERE 
    year = '2024'
    AND month = '1'
    AND line_item_line_item_type = 'Usage'
    AND line_item_product_code LIKE '%S3'
    AND (resource_tags_user_gio_inc_cost_allocation_cost_center = 's3glacier' OR resource_tags_user_gio_inc_cost_allocation_cost_center = 's3standard')
GROUP BY 1,2
ORDER BY 3 DESC
line_item_resource_idresource_tags_user_gio_inc_cost_allocation_cost_centercost
mybucket-glaciers3glacier0.133245255
mybuket-standards3standard0.077734254
AWS
answered 4 months ago

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.

Guidelines for Answering Questions