Terraform Installation Guide

Prerequisites

  1. An Apono Admin account
  2. An Apono API Token ready (follow the instructions to create one if you haven't created on yet)
  3. Terraform CLI installed
  4. Know the required Apono parameters and secrets for adding a Terraform resource to your Apono account.

Edit the Terraform configuration file (.tf)

  1. In the section containing required providers, add Apono as follows:
terraform {
  required_providers {
    apono = {
      source = "apono-io/apono"
      version = "0.2.0"
    }
  }
}

Tip: Check the Terraform Registry for the latest Apono version.

  1. Authenticate the Apono connection by adding your API Key:
provider "apono" {
  personal_token = "[YOUR_API_KEY]"
}
  1. Add the declarations for the resources that Apono will have access to. For each resource construct an Apono resource declaration composed of the following elements:
ElementTypeValue
resourcestring"apono_integration" "[TERRAFORM_RESOURCE]"
connector_idstringThe Apono connector ID from the Connector page of the connector you are using for this integration.
namestringthe set name of the resource
typestringthe set type of the resource
metadataobjectthe metadata that must be passed to the resource
secretobjectfor AWS include the region in which the secret is stored

The exact parameters to use for each of the many resources can be found in Integrations Metadata in the API Reference.

Example: MySQL on GCP

in this example, the Apono connector is added to the MySQL resource in the Terraform configuration:

resource "apono_integration" "mysql" {
  name         = "Google Cloud SQL - MySQL"
  type         = "gcp-cloud-sql-mysql"
  connector_id = "[MY_APONO_CONNECTOR_ID]"
  metadata = {
    {
      "id": "hostname",
      "label": "Hostname",
      "values": [],
      "default": ""
    },
    {
      "id": "port",
      "label": "Port",
      "values": [],
      "default": "3306"
    }
  }
  secret = {
    secret_id = "gcp:secretmanager:secret/prod/apono
  }
}

Finish the Integration

  1. Save the .tf configuration file with all of your changes.
  2. Run terraform init in a terminal, followed by terraform apply.
  3. Terraform will list all of the changes to make and ask for confirmation. Enter “yes”.
  4. When the configuration has been updated, Terraform indicates that it was successful.