📘

Hello. Just a note to let you know the underlying API on which this data source is built is general release and has been vetted, but because this is a new feature for our Terraform provider, we've given it beta label.

This status just means we've paused for a bit to get your feedback to make sure this data source works like you need and expect.

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
apiThe JSON-formatted conversion of your OpenAPI schema returned from the API Definitions data source. Contains:
  • name. Your API's name.
  • hostnames. Your API's root path.
  • matchCaseSensitive. Values sent have to match the case you provide.
  • enableApiGateway. Enablement status of the API Gateway product. Default is true.
  • resources. Information about each of your resources.
  • basePath. The base path for your resources.
  • tags. A list of tags used by the OpenAPI Description with additional metadata.
  • description. A human-readable statement about your API.
  • matchPathSegmentParameter. Path segment parameters included in match criteria. Defaults is true.
  • graphQl. If the API uses GraphQL to provide data.
  • securitySchemes. Details about the key with which users access the endpoint.
  • constraints. A list of constraints on the API.
  • versioning. Information about your API's version.
contract_idYour contract ID.
group_idYour group ID.
idYour API's ID.
latest_versionThe version number for the latest created version of your API. This version may or may not be active.
production_versionThe version number for the activated API version in the production environment.
staging_versionThe version number for the activated API version in the staging environment.
nameYour API's name.