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.

ArgumentRequiredDescription
group_idYour group's ID.
contract_idYour contract's ID.
filter_by_nameFilters CP codes by a CP code's name.
filter_by_productFilters 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:
  • cp_code_id. The CP code's ID.
  • created_date. The ISO 8601 timestamp indicating when the CP code was created.
  • name. The CP code's name.
  • product_ids. A list of product IDs for a given CP code.
filter_by_name Indicates the applied filter by a CP code's name.
filter_by_product Indicates the applied filter by a product ID.

Did this page help you?