GuideReference
TrainingSupportCommunity
Guide

Get values for base Akamai items that many of our subproviders use.

Groups

Pass the query empty to get all of your groups or both a group name and contract ID in the data block to get high level details about a given group.

// Get all
data "akamai_groups" "my_groups" {
}

output "my_groups" {
  value = data.akamai_groups.my_groups
}


// Get one
data "akamai_group" "my_group_id" {
    group_name  = "My group name"
    contract_id = "ctr_C-0N7RAC7"
}

output "my_group_id" {
    value = data.akamai_group.my_group_id
}
// Get all
+ my_groups = {
    + groups = [
        + {
            + contract_ids    = [
               + "ctr_C-0N7RAC7",
              ]
            + group_id        = "grp_12345"
            + group_name      = "My group name"
            + parent_group_id = "grp_09876"
          },
        + {
            + contract_ids    = [
                + "ctr_C-0N7RAC7",
              ]
            + group_id        = "grp_54321"
            + group_name      = "My group name 2"
            + parent_group_id = "grp_12345"
          },
    ]
    + id     = "example7ec3a80992d3cbad0afd253cbc8951"
  }


// Get one
+ my_group_id = {
    + contract_id = "ctr_C-0N7RAC7"
    + group_name  = "My group name"
    + id          = "grp_12345"
  }
variable "group_id" {
  type        = string
  description = "My group ID"
  default     = "12345"
}
// local
group_id = data.akamai_group.my_group_id.id

// tvars
group_id = var.group_id

Contracts

Pass the query empty to get all of your contracts or a group's name or ID in the data block to get high level details about a given group's contract.

// Get all
data "akamai_contracts" "my_contracts" {
}

output "my_contracts" {
  value = data.akamai_contracts.my_contracts
}


// Get one
data "akamai_contract" "my_contract" {
     group_name = "my group name"
}

output "my_contract" {
    value = data.akamai_contract.my_contract
}
// Get all
+ 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"
    }


// Get one
+ my_contract = {
    + group_id   = "grp_12345"
    + group_name = "my group name"
    + id         = "ctr_C-0N7RAC7"
  }
variable "contract_id" {
  type        = string
  description = "My contract ID"
  default     = "C-0N7RAC7"
}
// local
contract_id = data.akamai_contract.my_contract.id

// tvars
contract_id = var.contract_id

Product IDs

Product Code
Web Performance Solutions
Dynamic Site Accelerator prd_Site_Accel
Ion Standard prd_Fresca
Ion Premier prd_SPM
Dynamic Site Delivery prd_Dynamic_Site_Del
Rich Media Accelerator prd_Rich_Media_Accel
IoT Edge Connect prd_IoT
Security Solutions
Kona Site Defender prd_Site_Defender
Media Delivery Solutions
Download Delivery prd_Download_Delivery
Object Delivery prd_Object_Delivery
Adaptive Media Delivery prd_Adaptive_Media_Delivery

Note that if you have previously used the Property Manager API or CLI set-prefixes toggle option, you might have to remove the prd_ prefix.

Domain suffixes

Edge Hostname TypeDomain Suffix
Enhanced TLSedgekey.net
Standard TLSedgesuite.net
Shared Certakamaized.net
Non-TLSedgesuite.net

Secure hostnames

To view Enhanced TLS hostnames, you need at least Secure Site Delivery CNAMEs - View only access. Use the roles data source to determine your access level.

  1. Get a list of your properties and use a property's ID in the hostnames data source.

    data "akamai_properties" "my_properties" {
        group_id    = "12345"
        contract_id = "C-0N7RAC7"
    }
    
    output "my_properties" {
      value = data.akamai_properties.my_properties
    }
    
    + my_properties = {
          + contract_id = "C-0N7RAC7"
          + group_id    = "12345"
          + id          = "grp_12345ctr_C-0N7RAC7"
          + properties  = [
              + {
                  + contract_id        = "ctr_C-0N7RAC7"
                  + group_id           = "grp_12345"
                  + latest_version     = 8
                  + note               = "Added hostname."
                  + product_id         = "prd_Adaptive_Media_Delivery"
                  + production_version = 8
                  + property_id        = "prp_12345"
                  + property_name      = "my_property1"
                  + rule_format        = ""
                  + staging_version    = 3
                },
                + {
                  + contract_id        = "ctr_C-0N7RAC7"
                  + group_id           = "grp_12345"
                  + latest_version     = 3
                  + note               = "File type update."
                  + product_id         = "prd_Object_Delivery"
                  + production_version = 3
                  + property_id        = "prp_98765"
                  + property_name      = "my_property2"
                  + rule_format        = ""
                  + staging_version    = 2
                },
            ]
        }
    
  2. Pass your group, contract, and property IDs to get a list of your hostnames and certificate statuses.

    data "akamai_property_hostnames" "my_property_hostnames" {
        group_id    = "12345"
        contract_id = "C-0N7RAC7"
        property_id = "12345"
    }
    
    + my_property_hostnames = {
          + contract_id = "C-0N7RAC7"
          + group_id    = "12345"
          + hostnames   = [
              + {
                  + cert_provisioning_type = "DEFAULT"
                  + cert_status            = [
                      + {
                          + hostname          = "_acme-challenge.my-property-hostnames.com"
                          + production_status = "ACTIVE"
                          + staging_status    = "ACTIVE"
                          + target            = "ac.123456a1234abc1abcdefg12345a1234.my-property-hostnames.com.validate-akdv.net"
                        },
                    ]
                  + cname_from             = "my-property-hostnames.com"
                  + cname_to               = "my-property-hostnames.com.edgesuite.net"
                  + cname_type             = "EDGE_HOSTNAME"
                  + edge_hostname_id       = "ehn_1234567"
                },
            ]
          + id          = "prp_1234567"
          + property_id = "prp_123456"
          + version     = 3
        }