GuideReference
TrainingSupportCommunity
Guide

CP code

akamai_cp_code

Retrieve an ID for a Content Provider (CP) code.

data "akamai_cp_code" "my_cp_code" {
  name        = "My CP code name"
  group_id    = "12345"
  contract_id = "C-0N7RAC7"
}

output "my_cp_code" {
  value = data.akamai_cp_code.my_cp_code
}
// The example includes other data sources as dependencies.
locals {
  group_name  = "My group name"
  cpcode_name = "My CP code name"
}

data "akamai_group" "my_group" {
  group_name  = local.group_name
  contract_id = data.akamai_contract.my_contract.id
}

data "akamai_contract" "my_contract" {
  group_name = local.group_name
}

data "akamai_cp_code" "my_cp_code" {
  name        = local.cpcode_name
  group_id    = data.akamai_group.my_group.id
  contract_id = data.akamai_contract.my_contract.id
}
Changes to Outputs:
  + my_cp_code = {
      + contract_id = "C-0N7RAC7"
      + group_id    = "12345"
      + id          = "123456"
      + name        = "My CP code name"
      + product_ids = [
          + "prd_Obj_Delivery",
        ]
    }

Arguments

Send your group ID, contract ID, and CP code name in the body of the declaration to get a CP code ID.

ArgumentRequiredDescription
nameYour CP code's name.
group_idYour group's ID.
contract_idYour contract's ID.

Attributes

Returned to you is the CP code's id and a list of its product_ids.

AttributeArgument
contract_idYour contract's ID.
group_idYour group's ID.
idYour CP code's ID.
nameYour CP code's name.
product_idsA list of products for your CP code.