Get your registered API.

data "akamai_apidefinitions_api" "my_api" {
  id = 123456
}

output "my_api" {
  value = data.akamai_apidefinitions_api.my_api
}
my_api = {
  api    = jsonencode(
    {
      basePath   = "/api"
      constraints  = {
        enforceOn   = {
          request     = true
          undefinedParameters = {
            requestBody    = true
            requestCookie  = true
            requestHeader  = true
            requestQuery   = true
            responseBody   = true
            responseHeader = true
          }
        }
        requestBody = {
          consumeType = [
            "any",
          ]
        }
      }
      description  = "Adding test endpoints."
      enableApiGateway = true
      hostnames  = [
       "my-apidefinitions-hostname.net"
      ]
      name     = "my_api"
      resources  = {
        "/tests/{id}"  = {
          get  = {
            parameters = [
              {
                in   = "header"
                name   = "X-Test"
                required = true
                type   = "string"
              },
              {
                in  = "path"
                maxLength = 5
                minLength = 1
                name  = "id"
                required  = true
                type  = "string"
              },
            ]
          }
          name = "movie"
        }
      }
    }
  )
  contract_id  = "C-0N7RAC7"
  group_id     = 12345
  id     = 123456
  latest_version   = 3
  name     = null
  production_version = 2
  staging_version  = 3
}

Arguments

Provide either the ID or name of your API to get its details.

ArgumentDescription
idYour API's ID.
nameYour API's name.

Attributes

Returned to you is a jsonencoded api object containing your API details and information about its activation status on the networks.

AttributeDescription
contract_idYour contract ID.
group_idYour group ID.
idYour API ID
latest_versionThe number of the latest created version of your API.
production_versionThe API version active on the production network.
staging_versionThe API version active on the staging network.
api
basePathThe root path of your API.
constraintsA list of request and response constraint types and their enablement statuses.
  • enforceOn
    • request
    • undefinedParameters
      • requestBody
      • requestCookie
      • requestHeader
      • requestQuery
      • responseBody
      • responseHeader
  • requestBody. Contains a consumeType array that lists which type of data to consume. Possible values are:
    • json
    • xml
    • urlencoded
    • json/xml/urlencoded
    • json/urlencoded
    • json/xml
    • xml/urlencoded
    • none
descriptionA human-readable statement about your API.
enableApiGatewayThe API Gateway enablement status.
hostnamesAn array of your API's hostnames.
nameYour API's name.
resourcesYour API's resources.