Terraform Installation Guide
Prerequisites
- An Apono Admin account
- An Apono API Token ready (follow the instructions to create one if you haven't created on yet)
- Terraform CLI installed
- Know the required Apono parameters and secrets for adding a Terraform resource to your Apono account.
Edit the Terraform configuration file (.tf)
- 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.
- Authenticate the Apono connection by adding your API Key:
provider "apono" {
personal_token = "[YOUR_API_KEY]"
}
- 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 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 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
- Save the .tf configuration file with all of your changes.
- Run terraform init in a terminal, followed by terraform apply.
- Terraform will list all of the changes to make and ask for confirmation. Enter “yes”.
- When the configuration has been updated, Terraform indicates that it was successful.
Updated 26 days ago