CP codes
akamai_cp_codes
List all CP codes available to you.
data "akamai_cp_codes" "my-cp-codes" {
  group_id    = "12345"
  contract_id = "C-0N7RAC7"
}
output "my-cp-codes" {
  value = data.akamai_cp_codes.my-cp-codes
}
data "akamai_cp_codes" "my-cp-codes" {
  group_id             = "12345"
  contract_id          = "C-0N7RAC7"
  filter_by_product_id = "prd_Obj_Delivery"
}
output "my-cp-codes" {
  value = data.akamai_cp_codes.my-cp-codes
}
Changes to Outputs:
  + my_cp_codes = {
      + account_id           = "A-CCT1234"
      + contract_id          = "C-0N7RAC7"
      + cp_codes             = [
          + {
              + cp_code_id   = "12345"
              + created_date = "2024-02-21T09:26:21Z"
              + name         = "My CP code 1"
              + product_ids  = [
                  + "prd_Obj_Delivery",
                ]
            },
          + {
              + cp_code_id   = "98765"
              + created_date = "2024-07-24T12:37:06Z"
              + name         = "My CP code 2"
              + product_ids  = [
                  + "prd_Download_Delivery",
                ]
            },
        ]
      + filter_by_name       = null
      + filter_by_product_id = null
      + group_id             = "12345"
    }
Changes to Outputs:
  + my_cp_codes = {
      + account_id           = "A-CCT1234"
      + contract_id          = "C-0N7RAC7"
      + cp_codes             = [
          + {
              + cp_code_id   = "12345"
              + created_date = "2024-02-21T09:26:21Z"
              + name         = "My CP code 1"
              + product_ids  = [
                  + "prd_Obj_Delivery",
                ]
            },
          + {
              + cp_code_id   = "98765"
              + created_date = "2024-02-21T13:58:34Z"
              + name         = "My CP code 2"
              + product_ids  = [
                  + "prd_Obj_Delivery",
                ]
            },
        ]
      + filter_by_name       = null
      + filter_by_product_id = "prd_Obj_Delivery"
      + group_id             = "12345"
    }
Arguments
Send your group and contract IDs in the body of the declaration to get all CP codes. You can provide optional arguments to narrow down your results.
| Argument | Required | Description | 
|---|---|---|
| group_id | ✔ | Your group's ID. | 
| contract_id | ✔ | Your contract's ID. | 
| filter_by_name | Filters CP codes by a CP code's name. | |
| filter_by_product | Filters CP codes by a product ID. | 
Attributes
Returned to you is a set of cp_codes for your contract and group.
| Attribute | Description | 
|---|---|
| account_id | The account's ID. | 
| group_id | The group's ID. | 
| contract_id | The contract's ID. | 
| cp_codes | The set of available CP codes. Includes: 
 | 
| filter_by_name | Indicates the applied filter by a CP code's name. | 
| filter_by_product | Indicates the applied filter by a product ID. | 
Updated 8 months ago
