This code sample sets up an open source data infrastructure on the Aiven platform using Terraform, consisting of a PostgreSQL® instance sending metrics to InfluxDB®, which can be visualized with Grafana®.
Read more about this setup on the Managing your Aiven infrastructure with Terraform article.
For more information, check the Aiven Terraform Provider official documentation.
- Terraform, at least v0.13
- Aiven account
Populate the terraform.tfvars
file with your Aiven access token and project name.
To create the infrastructure, run the following commands:
$ terraform plan
$ terraform apply
To connect to the deployed PostgreSQL instance, run the following command:
$ psql "$(terraform output -raw postgresql_service_uri)"
Run the following command to find the Grafana URL, username and password:
$ terraform output -raw grafana_service_uri
$ terraform output -raw grafana_service_username
$ terraform output -raw grafana_service_password
Open the Grafana URL in your web browser with the outputted username and password.
To destroy the infrastructure, set the termination_protection
flag under the PostgreSQL resource to false
and run the command below:
$ terraform destroy
Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada, and used with their permission.
InfluxDB® is a trademark [registered / owned] by InfluxData, which is not affiliated with, and does not endorse, this product.
Terraform and Grafana are trademarks and property of their respective owners. All product and service names used in this website are for identification purposes only and do not imply endorsement.
This project is licensed under the Apache License, Version 2.0.