Back to all configurations
Environment

Environment configuration

Create a project, an application, an application agent, an application agent credential to get an Application token.

Environment configuration

Configurations needed to create a new project with credentials.

Use case

To communicate with the IndyKite platform, a project, an application, an application agent, an application agent credential are needed.

Once they are created, the Application Agent token provided will be used to call endpoints from all APIs

(except the Config API which needs ServiceAccount credentials at the organization level to create the necessary configurations).

By default the scope of the application agent includes all APIS (except Config).

Once this environment is created, the Application Agent token will be used as Bearer token or API Key according to the API.

An IKG (graph) is also created with an _Application node.

Requirements

- ServiceAccount credentials created in the IndyKite Hub for your organization.

main.tf

terraform {
  required_providers {
    indykite = {
      source  = "indykite/indykite"
      version = 1.26. # or latest version
    }
  }
}

# indykite provider integrates IndyKite platform with Terraform scripting.
# Provider for now does not support any parameters and all is set within service account credential file.
provider "indykite" {}

# call the indykite_customer datasource
data "indykite_customer" "customer1" {
  name = "your-customer-name"
}

# call the indykite_application_space resource to create a new project
resource "indykite_application_space" "appspace1" {
  customer_id  = data.indykite_customer.customer.id
  name         = "project-name"
  display_name = "Prject display name"
  description  = "Description of your project"
  region       = "europe-west1" # or us-east1
  ikg_size     = "4GB"  # default 2GB
}

# call the indykite_application resource to create a new application
resource "indykite_application" "application1" {
  app_space_id = indykite_application_space.appspace.id
  name         = "application-name"
  display_name = "Application display name"
  description  = "Description of your application"
}

# call the indykite_application_agent to create a new application agent
resource "indykite_application_agent" "agent" {
  application_id = indykite_application.application.id
  name           = "application-agent-name"
  display_name   = "Application agent display name"
  description    = "Description of your application agent"
}

# call the indykite_application_agent_credential to create a new application agent credential
resource "indykite_application_agent_credential" "with_public" {
  app_agent_id = indykite_application_agent.agent.id
  display_name = "Credential display name"
  expire_time  = "2026-12-31T12:34:56-01:00" #must be less than 2 years to generate a token
}