Create Pricing Data Source

If you have RHEL usage in your CUR you can skip this step, this step sets up a provided Cost and Usage report with RHEL usage for analysis.

Create the pricing data source

We will create a data source with approximately 24 hours of usage. This is a sample data source which contains multiple workloads, which is representative of running small web server applications.

Create the pricing data

  1. Log into the console via SSO.

  2. Go to the S3 service dashboard

  3. Create a bucket, with a name starting with cost-

  4. Go into the bucket and create 2 folders, before and after: Images/s3_folders.png

  5. Go into the before folder and upload the following file: Code/BeforeCUR.gz

  6. Go into the after folder and upload the following file: Code/AfterCUR.gz

You now have your sample usage files ready to be setup.

Setup Athena

  1. Go into the Athena service dashboard

  2. Create the costmaster database if it does not exist, copy and paste the following command:

     create database if not exists costmaster;
    
  3. Create the before table, modify the location line at the bottom, in the query below by replacing (bucketname) with the name of your bucket, and paste the following query into Athena:

Create before table - Athena query
  1. Create the after table, modify the location line at the bottom, in the query below by replacing (bucketname) with the name of your bucket, and paste the following query into Athena:
Create after table - Athena query

Test and Verify

  1. Confirm the before table is readable, copy and paste the following query into Athena and ensure it returns lines:

     SELECT * FROM "costmaster"."before" limit 10;
    
  2. Confirm the after table is readable, copy and paste the following query into Athena and ensure it returns lines:

     SELECT * FROM "costmaster"."after" limit 10;
    

Images/athena_verify.png

You have successfully setup the cost and usage data source. We have a database of licensed and unlicensed usage to analyze and verify.