Introduction
Welcome to our blog series on FinOps where we'll discuss how to analyze and manage your cloud costs. In this opening post, we focus on simplifying the initial steps of managing AWS costs using AWS Cost and Usage Reports (CUR). We will first go over the steps to set up the CUR report and identify the scope for optimization.
What are CUR Reports?
AWS Cost and Usage Reports provide a detailed breakdown of your AWS usage and expenses, illustrating how charges are accrued across different services. These reports are essential for effective cost management and are stored in an Amazon S3 bucket, tailored to your specific monitoring needs.
Benefits of Using CUR for Cost Tracking
Setting Up CUR Traditionally
Creating an S3 Bucket via AWS CLI:
We can quickly navigate through the AWS Management Console or you can quickly create an S3 bucket using the AWS Command Line Interface (CLI) with the following command:
aws s3 mb s3://your-cur-bucket --region your-region
aws s3api put-bucket-acl --bucket your-cur-bucket --acl private
aws s3api put-bucket-versioning --bucket your-cur-bucket --versioning-configuration Status=Enabled
Configuring S3 Bucket Policies via CLI:
You can also attach a policy to the bucket to allow AWS services to deposit CUR data using this CLI command:
aws s3api put-bucket-policy --bucket your-cur-bucket --policy '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "cur.amazonaws.com"
},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::your-cur-bucket/*"
}
]
}'
Enabling CUR Reports:
You can enable CUR reports directly via the AWS CLI by specifying your preferences for data granularity and specifics of the report:
aws cur put-report-definition --report-definition file://your-report-definition.json
Validation and Troubleshooting:
Check the S3 bucket for new report deliveries and ensure that report contents reflect chosen configurations.
Streamlined DagKnows Setup
You may have noticed that the steps above can be completely automated for robustness. DagKnows platform allows you to effortlessly automate these steps in Python or CLI. Here’s a link to the completely automated CUR report setup (https://community.dagknows.com/tasks/wB19e6CsXikO3Hd8TaiF).There are several obvious advantages to automating the steps: