Manage reporting groups

Break down your invoices and reports on your site's traffic by reporting groups rather than by contracts or products only.

When you use reporting groups, the Billing application adds up your traffic from all Content Provider (CP) codes tied to a contract and product, and calculates the total usage cost per group.

What you'll do

Organize CP codes into reporting groups.

Note: You can create only a certain number of CP codes and reporting groups within your account. To increase your limit, speak to your account representative.

What you need

You need to know which CP codes you want to assign to your reporting group before creating that group.

If you want to use a new CP code with your group, create it with the akamai_cp_code resource from the Property Manager subprovider. It automatically assigns the CP code to the correct product and contract.

resource "akamai_cp_code" "my_cp_code" {
  name        = "My CP Code"
  contract_id = "C-0N7RAC7"
  group_id    = "12345"
  product_id  = "prd_Object_Delivery"
}

To get existing CP codes, run the akamai_reportinggroups_cp_codes data source. Optionally, provide additional filters to narrow down your results. Compared to the akamai_cp_codes data source from the Property Manager subprovider, this data source returns more details of a CP code, like its type, name, time zone, account, contracts, and products it's assigned to.

data "akamai_reportinggroups_cp_codes" "my-cp-codes" {
  contract_id  = "C-0N7RAC7"
  group_id     = "54321"
  product_id   = "ObjectDelivery::ObjectDelivery"
}

output "my-cp-codes" {
  value = data.akamai_reportinggroups_cp_codes.my-cp-codes
}
my-cp-codes = {
  contract_id  = "C-0N7RAC7"
  cp_code_name = null
  cp_codes = [
    {
      access_group = {
        contract_id = "C-0N7RAC7"
        group_id    = "54321"
      }
      account_id = "A-CCT1234"
      contracts = [
        {
          contract_id = "C-0N7RAC7"
          status      = "ongoing"
        },
      ]
      cp_code_id        = 12345
      default_time_zone = "GMT 0 (Greenwich Mean Time)"
      name              = "My CP code"
      override_time_zone = {
        time_zone_id    = "0"
        time_zone_value = "GMT 0 (Greenwich Mean Time)"
      }
      products = [
        {
          product_id   = "ObjectDelivery::ObjectDelivery"
          product_name = "Object Delivery"
        },
      ]
      purgeable = true
      type      = "Regular"
    }
  ]
  group_id   = "54321"
  product_id = "ObjectDelivery::ObjectDelivery"
}

Create a reporting group

Use the akamai_reportinggroups_group resource to create a new reporting group and assign your CP codes to that group. Provide the following:

  • A name for your reporting group.
  • Details of an access group that controls access to specific CP codes.
  • A contract with the CP codes you want to assign to the reporting group.

Note: A reporting group is assigned to a contract and can only contain CP codes from that contract. However, each CP code can belong to multiple reporting groups.

resource "akamai_reportinggroups_group" "my-group" {
  reporting_group_name = "My reporting group"
  access_group = {
    contract_id = "C-0N7RAC7"
    group_id    = "54321"
  }
  contract = {
    contract_id = "C-0N7RAC7"
    cp_codes = [
      {
        cp_code_id = "12345"
      },
      {
        cp_code_id = "54321"
      }
    ]
  }
}

Once you create a reporting group, you can only update its name and assigned CP codes.

Important: Adding to or removing CP codes from a reporting group affects the traffic going forward. Contact your account representative to get historical billing information.