CP code


The akamai_cp_code resource lets you create or reuse content provider (CP) codes. CP codes track web traffic handled by Akamai servers. Akamai gives you a CP code when you purchase a product. You need this code when you activate associated properties.

You can create additional CP codes to support more detailed billing and reporting functions.

By default, the Akamai Provider uses your existing CP code instead of creating a new one.



resource "akamai_cp_code" "cp_code" {
  name = "My CP Code"
  contract_id =
  group_id =
  product_id = "prd_Object_Delivery"
  timeouts {
    update = "1h"

Real world

This example includes other data sources as dependencies.

locals {
    group_name = "example group name"
    cpcode_name = "My CP Code"

data "akamai_group" "example" {
    name = local.group_name
    contract_id =

data "akamai_contract" "example" {
    group_name = local.group_name

resource "akamai_cp_code" "example_cp" {
    name = local.cpcode_name
    group_id =
    contract_id =
    product_id = "prd_Object_Delivery"

Argument reference

The following arguments are supported:

  • name -¬†(Required) A descriptive label for the CP code. If you're creating a new CP code, the name can't include commas, underscores, quotes, or any of these special characters: ^ # %.

  • contract_id -¬†(Required) A contract's unique ID, including the ctr_ prefix.

  • group_id -¬†(Required) A group's unique ID, including the grp_ prefix.

  • product_id -¬†(Required) A product's unique ID, including the prd_ prefix.

  • timeouts - Uses an update argument to override the HashiCorp processing timeout of 20 minutes. Value is a string containing a number and its time reference, h, m, s. You can pass one, two, or all values. For example:

    • 1h3m5s
    • 2h5m
    • 3m

Attributes reference

  • id - The ID of the CP code.


resource "akamai_cp_code" "example" {
    # (resource arguments)

You can import your Akamai CP codes using a comma-delimited string of the CP code, contract, and group IDs. IDs must be in this order:


For example:

$ terraform import akamai_cp_code.example cpc_123,ctr_1-AB123,grp_123