Getting Started

DE-CIX PDM Team Updated by DE-CIX PDM Team

Getting Started with the IX-API Terraform Provider

This guide explains how to install and configure the IX-API Terraform provider to manage your DE-CIX services.

Prerequisites

  • Terraform >= 1.0 — Download Terraform
  • DE-CIX IX-API credentials — either an API key and secret (legacy authentication) or OAuth2 client credentials (client ID and client secret). Contact your DE-CIX account team to obtain these.

Step 1 – Install the Provider

Create a main.tf file in a new directory and declare the provider requirement:

terraform {
required_providers {
ixapi = {
source = "registry.terraform.io/ix-api-net/ixapi"
version = "~> 1.0"
}
}
}

Run terraform init to download the provider:

$ terraform init

Step 2 – Configure Authentication

The provider supports two authentication strategies: legacy (API key + secret) and OAuth2.

Legacy Authentication

provider "ixapi" {
api = "https://ixapi.de-cix.net/api/v2"
api_key = var.api_key
api_secret = var.api_secret
}

We recommend storing credentials in environment variables rather than in your Terraform files:

Environment Variable

Description

IX_API_HOST

The IX-API endpoint URL

IX_API_KEY

Your API key

IX_API_SECRET

Your API secret

With environment variables set, the provider block can be simplified:

provider "ixapi" {}

OAuth2 Authentication

provider "ixapi" {
auth = "oauth2"
api = "https://ixapi.de-cix.net/api/v2"
api_key = var.api_key
api_secret = var.api_secret
oauth2_token_url = "https://ixapi.de-cix.net/auth/oauth2/token"
oauth2_scopes = "ix-api"
}

For authentication setup and all available provider arguments, see Provider Configuration.

Step 3 – Verify Your Setup

Use a data source to confirm the provider can authenticate and reach the API:

data "ixapi_accounts" "all" {}

output "accounts" {
value = data.ixapi_accounts.all.accounts
}

Run terraform apply and check the output. If your credentials are correct, Terraform lists the accounts associated with your API key. Note the account ID — you will use it as var.account_id in subsequent configurations.

Step 4 – Enable the Cloud ROUTER Extension

To use DE-CIX Cloud ROUTER resources, set the feature flag in the provider block:

provider "ixapi" {
api = "https://ixapi.de-cix.net/api/v2"
api_key = var.api_key
api_secret = var.api_secret
extension_de_cix_cloud_router_enabled = true
}

Without this flag, all ixapi_de_cix_* resources and data sources are unavailable and will produce an error during terraform plan.

Next Steps

How did we do?

Terraform Provider Overview

Provider Configuration

Get in touch