How do I create Prometheus Exporters and Alertmanager Rules with Terraform?

My team is new to Grafana Cloud, and still exploring it. We need to write prometheus exporters and alert manager rules, and automate the deployment of these to our Grafana Cloud stack using Terraform.
Could someone please guide me on how to go about this.

**I checked the resources here Terraform Registry
But couldn’t find any related to exporters or Alertmanager rules.

Hi! For writing Prometheus exporters yourself your best resource will be the Prometheus document on Writing Exporters here: Writing exporters | Prometheus. Once your exporter is written and you are able to collect Prometheus metrics via a local Prometheus, you can remote_write those metrics to our hosted Prometheus backend as described here: Ship Metrics and Logs | Grafana Labs

As for AlertManager rules and automating the deployment of these rules as code to Grafana Cloud here are our most useful resources for this:

These API endpoints should be compatible with deployment versioning/instrumentation tools like Terraform. Be sure that you use an API Key created from inside your grafana.net instance to authenticate usage. The API Keys can be generated from the Configurations > API Keys page inside your Grafana.

Thanks a lot for your response.
I will look into this and leave a comment if I have further questions.