I am trying to setup AWS Managed grafana using terraform. I am following this examples:
I can able to setup the grafana via terraform. Then I created dashboard.json and tried to apply dashboard via terraform. But I am not able to find any suitable link for it. Can anyone please help me on this?
2
Answers
It doesn’t look like theres a resource in the terraform provider for adding a dashboard just yet. Available resources
There is however an AWS REST API for it: https://docs.aws.amazon.com/grafana/latest/userguide/Grafana-API-Dashboard.html
I’ve recently been investigating this myself and decided to just create them manually and store json backups of the dashboard configuration for when it becomes available.
At my place we use Pulumi, which would make it easier to add a custom integration to add dashboard to the Grafana instance, so I will be looking in to that when I have more time.
you will have to use the grafana provider for Terraform.
Here is a sample code that might help you: https://github.com/kunduso/aws_managed_grafana_workspace_dashboard/tree/main/amg_dashboard