GuideReference
TrainingSupportCommunity
Guide

Resource

akamai_gtm_resource

Get details about a specific resource assigned to a GTM domain.

data "akamai_gtm_resource" "my_gtm_resource"  {
  domain = "my_gtm_domain.akadns.net"
  resource_name = "resource1"
}

output "my_gtm_resource" {
  value = data.akamai_gtm_resource.my_gtm_resource
} 
Changes to Outputs:
  + add_resource = {
      + aggregation_type               = "sum"
      + constrained_property           = ""
      + description                    = "Testing resource"
      + domain                         = "my_gtm_domain.akadns.net"
      + host_header                    = "header"
      + id                             = "resource1"
      + leader_string                  = "leader"
      + links                          = [
          + {
              + href = "https://akab-h05tnam3wl42son7nktnlnnx-kbob3i3v.luna.akamaiapis.net/config-gtm/v1/domains/example_domain.akadns.net/resources/resource1"
              + rel  = "self"
            },
        ]
      + load_imbalance_percentage      = 0
      + resource_instances             = [
          + {
              + datacenter_id           = 1
              + load_object             = ""
              + load_object_port        = 1234
              + load_servers            = [
                  + "0.0.0.1",
                ]
              + use_default_load_object = false
            },
          + {
              + datacenter_id           = 2
              + load_object             = ""
              + load_object_port        = 1234
              + load_servers            = [
                  + "0.0.0.2",
                ]
              + use_default_load_object = false
            },
        ]
      + resource_name                  = "resource1"
      + type                           = "Non-XML load object via HTTP"
      + upper_bound                    = 0
    } 

Arguments

Pass a domain and its resource name in the data block.

ArgumentRequiredDescription
domain✔️The GTM domain name.
resource_name✔️The name of the GTM resource.

Attributes

Returned are high-level details about the resources assigned to your GTM domain.

ArgumentDescription
aggregation_typeSpecifies how GTM handles different load numbers when multiple load servers are used for a data center or property. Value is one of:
  • latest. Takes the values with the latest timestamp.
  • median. Takes the median of the values.
  • sum. Takes the sum of the values.
constrained_propertySpecifies the name of the property that this resource constraints.
descriptionA descriptive note to help you track what the resource constraints.
domainThe GTM domain name.
host_headerSpecifies the host header used when fetching the load object.
idIdentifier for this instance of the data source.
leader_stringSpecifies the text that comes before the load_object. GTM assumes that the current load is the first number to appear after this string, minus any white space. The value is a maximum of 256 characters. The default is null.
linksAn object providing the direct URL to the GTM resource. Contains:
  • rel. The link relationship of the object.
  • href. The fully-qualified URL that defines the GTM resource.
load_imbalance_percentageIndicates the percent of load imbalance factor for the domain.
typeIndicates the kind of load_object format used to determine the load on the resource. Value is one of:
  • XML load object via HTTP
  • XML load object via HTTPS
  • Non-XML load object via HTTP
  • Non-XML load object via HTTPS
  • Download score
  • Push API
upper_boundAn optional sanity check that specifies the maximum allowed value for any component of the load object.
resource_instancesAn object listing instances of the resource by data center. Value options:
  • datacenter_id. A unique identifier for an existing data center in the domain.
  • load_object. Identifies the load object file used to report real-time information about the current load, maximum allowable load, and target load on each resource.
  • load_object_port. Specifies the TCP port of the load_object.
  • load_servers. Specifies the list of servers to requests the load object from.
  • use_default_load_object. Whether to use default load_object. If the load_object contains a number that exceeds this value, it rejects the entire load object as invalid and GTM continues to use the load values from the most recently acquired load_object.