Contracts

akamai_contracts

Get a list of contracts associated with your API client's credentials.

data "akamai_contracts" "my_contracts" {
}

output "my_contracts" {
  value = data.akamai_contracts.my_contracts
}
Changes to Outputs:
  + my_contracts = {
      + contracts = [
          + {
              + contract_id        = "ctr_C-0N7RAC7"
              + contract_type_name = "DIRECT_CUSTOMER"
            },
          + {
              + contract_id        = "ctr_C-20N7RAC7"
              + contract_type_name = "INDIRECT_CUSTOMER"
            },
          + {
              + contract_id        = "ctr_C-30N7RAC7"
              + contract_type_name = "INDIRECT_CUSTOMER"
            },
        ]
      + id        = "act_A-CCT1234"
    }
variable "contract_id" {
  type        = string
  description = "My contract ID"
  default     = "C-30N7RAC7" // one of the returned values
}
// local
contract_id = data.akamai_contracts.my_contracts.contracts[3].contract_id

// tvars
contract_id = var.contract_id

Argument

This data source is passed empty. The config_section argument in the Akamai provider block of your Terraform configuration provides the necessary information.

Attributes

Returned to you is a contracts set with a list of your contracts and their high-level details.

AttributeDescription
contract_idA contract's ID, including the ctr_ prefix.
contract_type_nameA contract's type. While this value is not used downstream, it helps you choose a contract ID for your work. The most common types are:
  • DIRECT_CUSTOMER
  • INDIRECT_CUSTOMER
  • TIER_1_RESELLER
  • VALUE_ADDED_RESELLER