> For the complete documentation index, see [llms.txt](https://docs.apono.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apono.io/docs/additional-integrations/terraform-installation-guide.md).

# 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](https://registry.terraform.io/providers/apono-io/apono/latest) for the latest Apono version.

2. Authenticate the Apono connection by adding your API Key:

```
provider "apono" {
  personal_token = "[YOUR_API_KEY]"
}
```

3. 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:

| Element       | Type   | Value                                                                                                                                  |
| ------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| resource      | string | "apono\_integration" "\[TERRAFORM\_RESOURCE]"                                                                                          |
| connector\_id | string | The Apono connector ID from the [Connector page](https://app.apono.io/connectors) of the connector you are using for this integration. |
| name          | string | the set name of the resource                                                                                                           |
| type          | string | the set type of the resource                                                                                                           |
| metadata      | object | the metadata that must be passed to the resource                                                                                       |
| secret        | object | for 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](https://docs.apono.io/reference/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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apono.io/docs/additional-integrations/terraform-installation-guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
