Connecting AWS CUR — SaaS
PerfectScale has created a detailed guide to help you effortlessly enable AWS CUR.
In order to start using AWS CUR, follow the steps provided below:
Create Cost and Usage Reports
-
Sign in to the Billing and Cost Management console.
-
Go to
Data Exportsin the navigation pane and chooseCreate. -
In the Export type choose
Legacy CUR export. -
Enter a
Report namefor your report (for example:cur-perfectscale-example). -
Select
Refresh automaticallyin the Export Content / Data refresh settings. -
In the Data export delivery options for Report data time granularity choose one of the following options:
Hourlyto aggregate the line items in the report by hour.Dailyto aggregate the line items in the report by day.Monthlyto aggregate the line items in the report by month.
To get more detailed data, PerfectScale recommends aggregating the line items in the report
Hourly. -
For Report data integration choose Amazon Athena.
-
In the Data export storage settings, configure the section following one of these steps:
- Select the existing bucket (if you already have S3 bucket).
- Select Create a bucket, enter a bucket name, and choose the Region for the new bucket.
-
For the S3 path prefix, enter the report path prefix you want to prepend to the name of your report.
-
Add Tags if needed.
-
Review the settings for your report and click
Create report.
It can take up to 24 hours for AWS to deliver your first report to your Amazon S3 bucket.
CUR master account support
If your AWS account is a part of an AWS Organization or if you manage multiple AWS accounts within the same organization, you can centralize billing data using the management (primary) account of the AWS Organization. This setup allows you to configure AWS CUR only once and get a detailed view of costs and usage across all accounts, enabling better cost management across your entire organization.
When CUR is enabled at the organization level, it automatically collects cost and usage data from all member accounts, simplifying expense tracking and management across multiple accounts in a centralized way. This setup allows you to utilize a single AWS CUR for all pricing profiles, requiring only a change in the region where your Kubernetes cluster is installed.
If you are setting up CUR in the master account, ensure that all subsequent configurations (CUR, Athena, and IAM) are also completed in this account.
Set up Amazon Athena
Set up Amazon Athena using AWS CloudFormation templates.
AWS CloudFormation doesn't support cross-region resources. In order to use an AWS CloudFormation template, all the resources should be created in the same AWS Region. The Region must support the following services:
- AWS Lambda
- Amazon Simple Storage Service (Amazon S3)
- AWS Glue
- Amazon Athena
-
Go to the Amazon S3 console.
-
In the S3 bucket that you opted to receive the AWS CUR report (cur-perfectscale-example) in the folder report path prefix(your-report-path-prefix)/report name (your-report-name) you will find template file crawler-cfn.yml.
AWS generate automatically template file and it can take up to 24h to generate from creating CUR
-
Go to Object actions, and click
Download as. -
Navigate to the AWS CloudFormation console.
-
In case of using AWS CloudFormation for the first time, select
Create New Stackand clickWith new resources (standard)in the dropdown list.
Create new stack
Otherwise -
Create Stack. -
Select
Choose an existing templatein Prerequisite - Prepare template. -
Select
Upload a template filein Specify template. -
After clicking
Choose fileselect the downloaded.ymltemplate, and clickOpen. -
As a next step, enter the Stack name for your template, name
cur-perfectscale-example, add tags, if needed, and go to the next page. -
Tick the check box at the bottom of the page and click
Submit.
:white_check_mark: I acknowledge that AWS CloudFormation might create IAM resourcesThe template creates the following resources:
- Three IAM roles
- An AWS Glue database
- An AWS Glue crawler
- Two Lambda functions
- An Amazon S3 notification
-
To ensure the template is configured properly, check the
statusinstack info.
Template status
Run Amazon Athena queries
-
Go to the Amazon Athena service and select Query editor.
-
Click
Edit settingson the top right corner
Amazon Athena settings1
-
In the
Query result location and encryptionwrite down the path to the created for the CUR bucket, or use another bucket (for example,s3://cur-perfectscale-example/athena/) and clickSave.
Amazon Athena settings2
-
Return to the Query editor and run the following query to ensure the configuration works properly:
select status from cost_and_usage_data_status
Amazon Athena settings3
Configure the authentication method
There are two ways to grant us access to your CUR:
- Delegate access across AWS accounts using IAM roles (recommended).
- Create a separate IAM user.